New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

object-merge

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-merge - npm Package Compare versions

Comparing version 2.5.0 to 2.5.1

2

package.json
{
"name": "object-merge",
"version": "2.5.0",
"version": "2.5.1",
"description": "Merges JavaScript objects recursively without altering the objects merged.",

@@ -5,0 +5,0 @@ "main": "./src/object-merge.js",

@@ -16,3 +16,3 @@ # object-merge

In node:
In Node:

@@ -95,3 +95,39 @@ ```

merged recursively.
### Options
Options exist to do things like limit the depth of object traversal and disable
errors on detection of circular references. In order to specify the options you
must create an options object using the provided method `createOptions`, a
normal object just won't work.
```
var objectMerge = require('object-merge');
var a = {
'a1' : {
'a2' : {
'a3' : {}
}
}
};
var b = {
'b1' : {
'b2' : {
'b3' : {}
}
}
};
var opts = objectMerge.createOptions({depth : 2});
var res = objectMerge(opts, a, b);
// res will be
// {
// 'a1' : {
// 'a2' : {}
// },
// 'b1' : {
// 'b2' : {}
// }
// }
```
See the tests in `browser/tests` for more examples and expected outputs.

@@ -98,0 +134,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc