levenshtein-edit-distance
Version:
Levenshtein edit distance
18 lines (17 loc) • 396 B
TypeScript
/**
* Levenshtein edit distance.
*
* @param {string} value
* Primary value.
* @param {string} other
* Other value.
* @param {boolean} [insensitive=false]
* Compare insensitive to ASCII casing.
* @returns {number}
* Distance between `value` and `other`.
*/
export function levenshteinEditDistance(
value: string,
other: string,
insensitive?: boolean | undefined
): number