1.1.2 • Published 6 years ago
lodash-merge-diff v1.1.2
lodash-merge-diff
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-diffInstall latest from GitHub:
npm install github:kosinix/lodash-merge-diffTied to a specific version/release from GitHub:
npm install github:kosinix/lodash-merge-diff#1.0.0Example
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 -gRun test
npm test