DiffInteraction

git-casefile/impl. DiffInteraction

new DiffInteraction()

Class encapsulating usage of diff

Source:

Methods

(async) getHunks(baseContent, currentContent) → {Array.<Change>}

Get line number ranges of hunks that change between two text versions

Source:

Invoke diff to compute line-based hunks that change from a base version to a current version. The content for a version may be provided either as a path to a file already on disk or as an immediate string; when an immediate string is provided, it is saved to a temporary file so that two files paths can be provided for invoking diff.

Parameters:
Name Type Description
baseContent TextContent
currentContent TextContent
Returns:
Type
Array.<Change>