1.1.2 • Published 4 years ago

lodash-merge-diff v1.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

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