compact-diff

0.0.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i compact-diff

Weekly Downloads

6,664

Version

0.0.3

License

ISC

Last publish

Collaborators

  • suisho
  • inuscript
  • terrierscript