lodash-merge-diff

1.1.2 • Public • Published

lodash-merge-diff

npm version

Returns object containing properties that were updated. Similar behavior to lodash.merge.

Install

Choose 1 of 3 options:

Install from NPM:

npm install lodash-merge-diff

Install latest from GitHub:

npm install github:kosinix/lodash-merge-diff

Tied to a specific version/release from GitHub:

npm install github:kosinix/lodash-merge-diff#1.0.0

Example

let orig = {
    documents: [
        {
            name: 'profilePic',
            files: []
        }
    ]
}
let patch = {
    documents: [
        {
            name: 'profilePic',
            files: [
                {
                    name: 'file.jpeg'
                }
            ]
        }
    ]
}

let result = {}
differ(orig, patch, result);

console.log(result)

Returns

{
    documents: [
        {
            files: [
                {
                    name: 'file.jpeg'
                }
            ]
        }
    ]
};

Test

Install mocha globally

npm install mocha -g

Run test

npm test

Readme

Keywords

none

Package Sidebar

Install

npm i lodash-merge-diff

Weekly Downloads

8

Version

1.1.2

License

ISC

Unpacked Size

7.5 kB

Total Files

5

Last publish

Collaborators

  • kosinix