Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@lachenmayer/longest-common-subsequence

lachenmayer19ISC1.0.1

Finds the longest common subsequence of two strings, and the diff between them.

strings, lcs, longest common subsequence, diff

readme

longest-common-subsequence

Finds the longest common subsequence of two strings, and the diff between them.

function lcs(a: string, b: string): { lcs: string, diff: Array<Diff> }

type Diff =
  | ['keepOld', number] // index in a
  | ['addNew', number] // index in b
  | ['removeOld', number] // index in a