0.0.4 • Published 7 years ago

diff-object-array v0.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

diff-object-array

A javascript differencing implementation for array.

Installation

npm install diff-object-array --save

Examples

const diff = require('diff-object-array')

// for array width basic type
console.log(diff([1,2,3], [2,3,4])) 
// { arrayDeleted: [ 1 ], arrayAdded: [ 4 ] }

// for array width objects
console.log(diff([{id: 1}, {id: 2}, {id: 3}], [{id: 2}, {id: 3}, {id: 4}], 'id')) 
// { arrayDeleted: [ { id: 1 } ], arrayAdded: [ { id: 4 } ] }