{"_id":"absorb","_rev":"27-c5d69dcc655e2420e2b0afa852e5f2ce","name":"absorb","time":{"modified":"2022-06-13T02:20:16.311Z","created":"2015-02-14T02:29:22.839Z","0.0.0":"2015-02-14T02:29:22.839Z","0.0.1":"2015-02-14T02:35:23.743Z","0.0.2":"2015-02-14T03:00:07.898Z","0.0.3":"2015-02-14T03:24:24.655Z","0.0.4":"2015-02-14T03:46:22.508Z","0.1.0":"2015-06-11T18:17:24.136Z","1.0.0":"2015-07-02T17:41:28.591Z","1.0.1":"2015-08-25T16:29:22.594Z"},"maintainers":[{"name":"patrickmurphy","email":"patrick@patrickmurphyphoto.com"}],"dist-tags":{"latest":"1.0.1"},"description":"A recursive deep object merge utility function","readme":"Absorb\r\n================\r\n\r\nA recursive deep object merge utility function. ObjectParam1 absorbs properties from ObjectParam2\r\n\r\n## Installation\r\n\r\n\tnpm install absorb\r\n\r\n## Usage\r\n\r\n\tvar absorb = require('absorb');\r\n\tvar obj1, obj2, obj3;\r\n\t\r\n\tobj1 = { foo: 123, bar: 456 };\r\n\tobj2 = { bar: 123, key: 'value' }\r\n\t\r\n\tabsorb(obj1, obj2);\r\n\t\r\n\tconsole.log(obj1); // Output: { foo: 123, bar: 123, key: 'value' }\r\n\r\nYou can use the optional third parameter set to `true` to make a clone.\r\n\t\r\n\tobj1 = { foo: 123, bar: 456 };\r\n\tobj3 = absorb(obj1, obj2, true);\r\n\t\r\n\tconsole.log(obj1); // Output: { foo: 123, bar: 456 }\r\n\tconsole.log(obj3); // Output: { foo: 123, bar: 123, key: 'value' }\r\n\t\r\nYou can use the optional fourth parameter set to `true` to only add properties that are not already set in the destination object. Note: This will not overwrite sub-properties in deep objects, however it will add new ones\r\n\t\r\n\tobj1 = { person: {name: 'Patrick', lastname: 'Murphy'}, career: 'Software Engineer'};\r\n\tobj2 = { person: {name: 'Jered', height: '6`1'}, career: 'Investment Banker', hobbies: 'photography'};\r\n\tabsorb(obj1, obj2, false, true);\r\n\t\r\n\tconsole.log(obj1); // Output: { person: {name: 'Patrick', lastname: 'Murphy', height: '6`1'}, career: 'Software Engineer', hobbies: 'photography'};\r\n\r\n## Contributing\r\n\r\nIn lieu of a formal styleguide, take care to maintain the existing coding style.\r\nAdd unit tests for any new or changed functionality. Lint and test your code.\r\n\r\n\r\n## Release History\r\n\r\n* 1.0.1 Fix cloning not functioning correctly Issue reported on github\r\n* 1.0.0 Add PreserveObject parameter, allowing option to only merge if object 1 does not contain key\r\n* 0.1.0 Initial release","versions":{"0.1.0":{"name":"absorb","version":"0.1.0","description":"A recursive deep object merge utility function","main":"index.js","dependencies":{"is-object":"^1.0.1"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/PatrickMurphy/absorb.git"},"keywords":["merge","object","utility","recursive","clone","extend","copy"],"author":{"name":"Patrick Murphy","email":"patrick@patrickmurphyphoto.com","url":"http://resume.patrickmurphywebdesign.com"},"license":"ISC","bugs":{"url":"https://github.com/PatrickMurphy/absorb/issues"},"homepage":"https://github.com/PatrickMurphy/absorb#readme","gitHead":"da593c58e6b0a9a4528adfcf7557333c5ace2a50","_id":"absorb@0.1.0","_shasum":"c6bc15ef7cbce34d3b128681abe727b4ff46cac0","_from":".","_npmVersion":"2.9.1","_nodeVersion":"0.12.3","_npmUser":{"name":"patrickmurphy","email":"patrick@patrickmurphyphoto.com"},"dist":{"shasum":"c6bc15ef7cbce34d3b128681abe727b4ff46cac0","tarball":"https://registry.npmjs.org/absorb/-/absorb-0.1.0.tgz","integrity":"sha512-sEkVO27Q7VWIBg4FFE9iva9RizcbaGqxtpCd12QswfHOcypdYd883TTZ7QyxwFeiJ5m0i9cXdnhUiHH9DpKs0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsyWfGr2P5fWtqetpn1JMY1icGaxmYJadc7+f1lr/bYAIhAP3b9zN6+bFF7TJU7Vy2NzaLgVzeojy6Wx7phmH4d+Ty"}]},"maintainers":[{"name":"patrickmurphy","email":"patrick@patrickmurphyphoto.com"}]},"1.0.0":{"name":"absorb","version":"1.0.0","description":"A recursive deep object merge utility function","main":"index.js","dependencies":{"is-object":"^1.0.1"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/PatrickMurphy/absorb.git"},"keywords":["merge","object","utility","recursive","clone","extend","copy"],"author":{"name":"Patrick Murphy","email":"patrick@patrickmurphyphoto.com","url":"http://resume.patrickmurphywebdesign.com"},"license":"ISC","bugs":{"url":"https://github.com/PatrickMurphy/absorb/issues"},"homepage":"https://github.com/PatrickMurphy/absorb#readme","gitHead":"78f4f074cd1ce08e4258298084e9ad8db65f7b1e","_id":"absorb@1.0.0","_shasum":"a6a9974b7820d702a008f81b2ccce7aaaf93ce5e","_from":".","_npmVersion":"2.9.1","_nodeVersion":"0.12.3","_npmUser":{"name":"patrickmurphy","email":"patrick@patrickmurphyphoto.com"},"dist":{"shasum":"a6a9974b7820d702a008f81b2ccce7aaaf93ce5e","tarball":"https://registry.npmjs.org/absorb/-/absorb-1.0.0.tgz","integrity":"sha512-no1mcIwS4495oIGZAskPNKsl7f2iQubZvtb3JvQddW4En4CEl9u+v1mvM3CfVe5Zme6wQ6ThXTFF+yGBYffXKQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5Ukqe1ifmCQpVSadOlcFlNQjkGpaFwBHk8hjd97a2ZAIhAJzexB6rRACXF1VJfhI2+sxvMZJrzBpLgFXrLhhDS4Ax"}]},"maintainers":[{"name":"patrickmurphy","email":"patrick@patrickmurphyphoto.com"}]},"1.0.1":{"name":"absorb","version":"1.0.1","description":"A recursive deep object merge utility function","main":"index.js","dependencies":{"clone":"^1.0.2","is-object":"^1.0.1"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/PatrickMurphy/absorb.git"},"keywords":["merge","object","utility","recursive","clone","extend","copy"],"author":{"name":"Patrick Murphy","email":"patrick@patrickmurphyphoto.com","url":"http://resume.patrickmurphywebdesign.com"},"license":"ISC","bugs":{"url":"https://github.com/PatrickMurphy/absorb/issues"},"homepage":"https://github.com/PatrickMurphy/absorb#readme","gitHead":"7f4474ec6b9e60a567ab0a1067e734f4ce8dbda3","_id":"absorb@1.0.1","_shasum":"759b7f0a07135e7249a31431963626b2374d5b27","_from":".","_npmVersion":"2.9.1","_nodeVersion":"0.12.3","_npmUser":{"name":"patrickmurphy","email":"patrick@patrickmurphyphoto.com"},"dist":{"shasum":"759b7f0a07135e7249a31431963626b2374d5b27","tarball":"https://registry.npmjs.org/absorb/-/absorb-1.0.1.tgz","integrity":"sha512-YB/j9ecuB7UXRM7cVYpf7xb2jSqGPHQqknTz97mLC0mR0q/7wCo0p9iAKShVCUZ+kA/UrVle5oevOVhVzYpA1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGbTPr1GrUbd4juNqLuyHOSzGFpUc/fCeHmtUWCelYHQAiA2dOv3TXUI8MyT1gUPcMxpDVCVesi8JK0aVDMy8poyjg=="}]},"maintainers":[{"name":"patrickmurphy","email":"patrick@patrickmurphyphoto.com"}]}},"homepage":"https://github.com/PatrickMurphy/absorb#readme","keywords":["merge","object","utility","recursive","clone","extend","copy"],"repository":{"type":"git","url":"git+https://github.com/PatrickMurphy/absorb.git"},"author":{"name":"Patrick Murphy","email":"patrick@patrickmurphyphoto.com","url":"http://resume.patrickmurphywebdesign.com"},"bugs":{"url":"https://github.com/PatrickMurphy/absorb/issues"},"license":"ISC","readmeFilename":"README.md","users":{"vwal":true}}