UNPKG

levenshtein-edit-distance

Version:
18 lines (17 loc) 396 B
/** * 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