1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 19:04:46 +00:00

refactor(pacakages/stdlib): add base jsdoc for each function

This commit is contained in:
2024-10-16 06:27:14 +07:00
parent eadf791942
commit 679bced9f1
28 changed files with 219 additions and 54 deletions

View File

@@ -1,5 +1,7 @@
/**
* Calculate the Levenshtein distance between two strings
* @name levenshteinDistance
* @category Text
* @description Calculate the Levenshtein distance between two strings
*
* @param {string} left First string
* @param {string} right Second string

View File

@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { templateObject } from './index';
import { templateObject } from '.';
describe('templateObject', () => {
// it('replace template placeholders with corresponding values from args', () => {

View File

@@ -1,7 +1,9 @@
export type Trigrams = Map<string, number>;
/**
* Extracts trigrams from a text and returns a map of trigram to count
* @name trigramProfile
* @category Text
* @description Extracts trigrams from a text and returns a map of trigram to count
*
* @param {string} text The text to extract trigrams
* @returns {Trigrams} A map of trigram to count
@@ -23,7 +25,9 @@ export function trigramProfile(text: string): Trigrams {
}
/**
* Calculates the trigram distance between two strings
* @name trigramDistance
* @category Text
* @description Calculates the trigram distance between two strings
*
* @param {Trigrams} left First text trigram profile
* @param {Trigrams} right Second text trigram profile