Closed ppaskaris closed 7 years ago
This fixes the feature whereby an add op followed immediately by a remove op are coalesced into a replace op.
Consider Jiff.diff(["a", "b", "c"], ["a", "b", "z"]);
Jiff.diff(["a", "b", "c"], ["a", "b", "z"]);
Before this fix:
[ { "op": "add", "path": "/2", "value": "z" }, { "op": "test", "path": "/3", "value": "c" }, { "op": "remove", "path": "/3" } ]
After this fix:
[ { "op": "test", "path": "/2", "value": "c" }, { "op": "replace", "path": "/2", "value": "z" } ]
Hi @ppaskaris, thanks! I'll have time within the next day or so to look at this.
This fixes the feature whereby an add op followed immediately by a remove op are coalesced into a replace op.
Consider
Jiff.diff(["a", "b", "c"], ["a", "b", "z"]);
Before this fix:
After this fix: