Function editDistance

  • Compute the levenshtein edit distance between two strings. Equivalent to the the number of edits necessary to get from source to target.

    Returns

    the number of changes to edit source into target

    Example

    editDistance('snail', 'mail') === 2
    

    Parameters

    • source: string

      string to use as source

    • target: string

      target string

    • Optional options: Partial<EditDistanceOptions>

    Returns number

Generated using TypeDoc