getTextDiff
Compares two texts and returns a structured diff at a character, word, or sentence level.
IMPORT
import { getTextDiff } from "@donedeal0/superdiff";FORMAT
Input
previousText: string | null | undefined,
currentText: string | null | undefined,
options?: {
separation?: "character" | "word" | "sentence", // "word" by default
accuracy?: "normal" | "high", // "normal" by default
detectMoves?: boolean // false by default
ignoreCase?: boolean, // false by default
ignorePunctuation?: boolean, // false by default
locale?: Intl.Locale | string // undefined by default
}Output
USAGE
Input
Output
Last updated