Install
Using npm:
npm install difference-json
Usage
Get the difference of arrays:
var diff = ;var result = ;//result equals: $set: 6 $was: 2 $index: 1 $set: 7 $was: 3 $index: 2
Get the difference of simple json objects:
var diff = ;var result = ;//result equals: name: $was: 'john' $set: 'andre'
Get the difference of simple nested json objects:
var diff = ;var result = ;//result equals: basket: sum: $set: 35 $was: 20
Related
- shape-json - Convert json to json with a predefined scheme
- shape-array - Convert array to json object
License
MIT © Andre Stehle