(a: ReadonlyArray<A>, b: ReadonlyArray<A>)
| 8 | edits.reduce((n, edit) => edit._tag === "Equal" ? n : n + edit.items.length, 0) |
| 9 | |
| 10 | const lcsLength = <A>(a: ReadonlyArray<A>, b: ReadonlyArray<A>): number => { |
| 11 | let prev = new Array<number>(b.length + 1).fill(0) |
| 12 | for (const x of a) { |
| 13 | const next = [0] |
| 14 | for (let j = 0; j < b.length; j++) { |
| 15 | next.push(x === b[j] ? prev[j] + 1 : Math.max(prev[j + 1], next[j])) |
| 16 | } |
| 17 | prev = next |
| 18 | } |
| 19 | return prev[b.length] |
| 20 | } |
| 21 | |
| 22 | const isCanonical = (edits: ReadonlyArray<TextDiff.Edit<unknown>>): boolean => |
| 23 | edits.every((edit, i) => |
no test coverage detected