IF Commons GitHub

diff

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-host FR-012

A unified diff of two texts (commons 0003-host FR-012, FR-019): what ergonex render --dry-run shows of a generated file that would change, and what ergonex shell install shows of the one block it would write, so that a person sees the exact change before it is made.

The lines are compared by a longest common subsequence, which is exact and, for the files of a workspace (a few hundred lines), small. The hunks carry three lines of context, as diff -u does, and a text with no difference gives no hunk and an empty string. Line endings are LF here; a caller normalizes first.

Source: commons/ergonex/src/diff.ts

1 of 1 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

unifiedDifffunction
function unifiedDiff(name: string, before: string, after: string): string

The unified diff from before to after, headed by --- a/<name> and +++ b/<name>; an empty string where the texts are equal.

Imported by 6 tests of the run (6 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.