Skip to Content

@revideo/2d


@revideo/2d / code / patienceDiff

Function: patienceDiff()

patienceDiff(aLines, bLines): { lineCountDeleted: number; lineCountInserted: number; lines: { aIndex: number; bIndex: number; line: string; }[]; }

Defined in: 2d/src/lib/code/diff.ts:22 

Performs a patience diff on two arrays of strings, returning an object containing the lines that were deleted, inserted, and potentially moved lines. The plus parameter can result in a significant performance hit due to additional Longest Common Substring searches.

Parameters

aLines

string[]

The original array of strings

bLines

string[]

The new array of strings

Returns

{ lineCountDeleted: number; lineCountInserted: number; lines: { aIndex: number; bIndex: number; line: string; }[]; }

lineCountDeleted

lineCountDeleted: number

lineCountInserted

lineCountInserted: number

lines

lines: { aIndex: number; bIndex: number; line: string; }[]

© 2026 Haven Technologies, Inc.
Function: patienceDiff() – Revideo