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:

Parameter Type Description
oldText string The original text.
newText string The modified text.
oldName string The label for the original text.
newName string The label for the modified text.

Returns: stringThe formatted diff string.