
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
A recursive deep object merge utility function. ObjectParam1 absorbs properties from ObjectParam2
npm install absorb
var absorb = require('absorb');
var obj1, obj2, obj3;
obj1 = { foo: 123, bar: 456 };
obj2 = { bar: 123, key: 'value' }
absorb(obj1, obj2);
console.log(obj1); // Output: { foo: 123, bar: 123, key: 'value' }
You can use the optional third parameter set to true
to make a clone.
obj1 = { foo: 123, bar: 456 };
obj3 = absorb(obj1, obj2, true);
console.log(obj1); // Output: { foo: 123, bar: 456 }
console.log(obj3); // Output: { foo: 123, bar: 123, key: 'value' }
You 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
obj1 = { person: {name: 'Patrick', lastname: 'Murphy'}, career: 'Software Engineer'};
obj2 = { person: {name: 'Jered', height: '6`1'}, career: 'Investment Banker', hobbies: 'photography'};
absorb(obj1, obj2, false, true);
console.log(obj1); // Output: { person: {name: 'Patrick', lastname: 'Murphy', height: '6`1'}, career: 'Software Engineer', hobbies: 'photography'};
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
FAQs
A recursive deep object merge utility function
The npm package absorb receives a total of 2 weekly downloads. As such, absorb popularity was classified as not popular.
We found that absorb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.