object-diff-paths
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

object-diff-paths

Calculates a diff of 2 objects, and returns a list of the different object paths.

The object paths can then be used in lodash.get/lodash.set.

Installation

$ npm i object-diff-paths

Usage

const o1 = {
    a: {
        b: {
            c: { s: 't' },
        }
    }
};
const o2 = {...o1, a: {...o1.a, b: {...o1.a.b, d: 'e'}}};
 
const diff = objectDiff(o1, o2);
 
assert.deepEqual(diff, [
    'a.b.d'
]);

Package Sidebar

Install

npm i object-diff-paths

Weekly Downloads

405

Version

1.0.5

License

ISC

Unpacked Size

4.95 kB

Total Files

6

Last publish

Collaborators

  • interal