Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deep-extend

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-extend - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

39

index.js
/*!
* Node.JS module "Deep Extend"
* @description Recursive object extending.
* @version 0.2.6
* @author Viacheslav Lotsmanov (unclechu) <lotsmanov89@gmail.com>

@@ -54,27 +53,27 @@ * @license MIT

for (key in obj) {
if (obj[key] !== void 0) {
src = target[key];
val = obj[key];
if ( ! (key in obj)) continue;
if (val === target) continue;
src = target[key];
val = obj[key];
if (typeof val !== 'object' || val === null) {
target[key] = val;
continue;
}
if (val === target) continue;
if (typeof src !== 'object') {
clone = (Array.isArray(val)) ? [] : {};
target[key] = deepExtend(clone, val);
continue;
}
if (typeof val !== 'object' || val === null) {
target[key] = val;
continue;
}
if (Array.isArray(val)) {
clone = (Array.isArray(src)) ? src : [];
} else {
clone = (!Array.isArray(src)) ? src : {};
}
if (typeof src !== 'object') {
clone = (Array.isArray(val)) ? [] : {};
target[key] = deepExtend(clone, val);
continue;
}
if (Array.isArray(val)) {
clone = (Array.isArray(src)) ? src : [];
} else {
clone = (!Array.isArray(src)) ? src : {};
}
target[key] = deepExtend(clone, val);
}

@@ -81,0 +80,0 @@ });

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "0.2.6",
"version": "0.2.7",
"homepage": "https://github.com/unclechu/node-deep-extend",

@@ -8,0 +8,0 @@ "repository": {

@@ -23,3 +23,4 @@ Node.JS module “Deep Extend”

},
f: 5
f: 5,
g: 123
};

@@ -34,3 +35,4 @@ var obj2 = {

e: { one: 1, two: 2 },
f: []
f: [],
g: (void 0)
};

@@ -50,3 +52,4 @@

c: 5,
e: { one: 1, two: 2 } }
e: { one: 1, two: 2 },
g: undefined }
*/
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