Skip to content

Cli.formatDiff method

Cli › formatDiff

Unofficial

Format two strings as a unified diff.

Signature:

formatDiff(oldText: string, newText: string, oldName: string, newName: string): string

Parameters:

ParameterTypeDescription
oldTextstringThe original text.
newTextstringThe modified text.
oldNamestringThe label for the original text.
newNamestringThe label for the modified text.

Returns: stringThe formatted diff string.