Broadly, jsdiff's diff functions all take an old text and a new text and perform three steps: Split both texts into arrays of "tokens". What constitutes a token varies; in diffChars, each character is a token, while in diffLines, each line is a token. Find the smallest set of single-token insertions and deletions needed to transform the first array of tokens into the second. This step depends upon