You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -572,11 +572,12 @@ Compares two texts and returns a structured diff at a character, word, or senten
572
572
previousText: string|null|undefined,
573
573
currentText: string|null|undefined,
574
574
options?: {
575
-
separation?: "character"|"word"|"sentence",// "word" by default
575
+
separation?: "character"|"word"|"sentence"// "word" by default
576
576
accuracy?:"normal"|"high", // "normal" by default
577
577
detectMoves?: boolean// false by default
578
578
ignoreCase?:boolean, // false by default
579
579
ignorePunctuation?: boolean, // false by default
580
+
preserveWhitespace?: boolean, // false by default
580
581
locale?: Intl.Locale|string// undefined by default
581
582
}
582
583
```
@@ -592,6 +593,7 @@ Compares two texts and returns a structured diff at a character, word, or senten
592
593
-`true`: semantically precise, but noisier — a single insertion shifts all following tokens, breaking equality.
593
594
-`ignoreCase`: if `true`, `hello` and `HELLO` are considered equal.
594
595
-`ignorePunctuation`: if `true`, `hello!` and `hello` are considered equal.
596
+
-`preserveWhitespace`: if `true`, each token keeps the whitespace preceding it, so the original text can be rebuilt from the diff and whitespace-only edits are detected. Only available in normal accuracy mode.
595
597
-`locale`: the locale of your text. Enables locale‑aware segmentation in high accuracy mode.
Copy file name to clipboardExpand all lines: package.json
+11-2Lines changed: 11 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@donedeal0/superdiff",
3
-
"version": "4.2.3",
3
+
"version": "4.2.4",
4
4
"type": "module",
5
5
"description": "Superdiff provides a rich and readable diff for arrays, objects, texts and coordinates. It supports stream and file inputs for handling large datasets efficiently, is battle-tested, has zero dependencies, and offers a top-tier performance.",
0 commit comments