compact-diff

Output compact diff result

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
compact-diff
110.0.37 years ago7 years agoMinified + gzip package size for compact-diff in KB

Readme

compact-diff Circle CI
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 if added
  • removed : Set value if removed
  • If added and removed is adjacenced, those output as same object