putil-merge
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -43,14 +43,16 @@ /* putil-merge | ||
const src = source[key]; | ||
if (isObject(src)) { | ||
if (!isObject(target[key])) | ||
target[key] = {}; | ||
if (cfg.deep) | ||
target[key] = _merge(cfg, target[key], src); | ||
else if (cfg.clone) | ||
if (!cfg.filter || cfg.filter(key, src)) { | ||
if (isObject(src)) { | ||
if (!isObject(target[key])) | ||
target[key] = {}; | ||
if (cfg.deep) | ||
target[key] = _merge(cfg, target[key], src); | ||
else if (cfg.clone) | ||
target[key] = JSON.parse(JSON.stringify(src)); | ||
else target[key] = src; | ||
} else if (Array.isArray() && cfg.clone) | ||
target[key] = JSON.parse(JSON.stringify(src)); | ||
else target[key] = src; | ||
} else if (Array.isArray() && cfg.clone) | ||
target[key] = JSON.parse(JSON.stringify(src)); | ||
else | ||
target[key] = src; | ||
else | ||
target[key] = src; | ||
} | ||
} | ||
@@ -57,0 +59,0 @@ } |
{ | ||
"name": "putil-merge", | ||
"description": "Lightweight solution for merging multiple objects into one. Also it supports deep merge and deep clone", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Panates Ltd.", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6329
56