compact-diff
v0.0.3
Published
Output compact diff result
Downloads
18,384
Readme
compact-diff
Compact result diff (kpdecker/jsdiff wrapper)
Usage
var compactDiff = require("compact-diff")
var result = compactDiff("foogesbaz", "foodorbaz")
// result = [
// { value: "foo" },
// { added: "dor", removed : "ges"},
// { value: "baz" }
// ]
fromEnding
Check diff from end of character
var compactDiff = require("compact-diff")
var result = diff.fromEnd("foobazbaz", "bazbazbaz")
// result = [
// { added: "baz", removed: "foo" },
// { value: "bazbaz" }
// ]
Output
This module output those array
value
: Set value if not change(added or removed)added
: Set value ifadded
removed
: Set value ifremoved
- If
added
andremoved
is adjacenced, those output as same object