Skip to content

Compare two arrays of objects and return a list of transformations create/update/remove

License

Notifications You must be signed in to change notification settings

edasarl/node-diff-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diff-list -- Compare two arrays of objects and return a list of transformations

Usage

var diff = require('diff-list');

var transforms = diff(srcRows, dstRows, {key: 'id'});

returns {put: [..], post: [..], del: [..]} transformations needed to be applied to src to obtain dst, not taking into account ordering.

Options

  • equal
    function of two parameters that returns true if they are equal,
    defaults to strict deep-equal.
  • key
    check if an item having that key already exists (put) or is new (post).

About

Compare two arrays of objects and return a list of transformations create/update/remove

Resources

License

Stars

Watchers

Forks

Packages

No packages published