@domql/utils
Advanced tools
Comparing version 2.3.12 to 2.3.13
@@ -56,6 +56,8 @@ 'use strict' | ||
*/ | ||
export const deepClone = (obj, excluding = ['parent', 'node', '__element', '__root']) => { | ||
export const deepClone = (obj) => { | ||
if (isArray(obj)) { | ||
return obj.map(deepClone) | ||
} | ||
const o = {} | ||
for (const prop in obj) { | ||
if (excluding.indexOf(prop) > -1) continue | ||
let objProp = obj[prop] | ||
@@ -65,3 +67,5 @@ if (prop === 'extend' && isArray(objProp)) { | ||
} | ||
if (isObjectLike(objProp)) { | ||
if (isArray(objProp)) { | ||
o[prop] = objProp.map(deepClone) | ||
} else if (isObject(objProp)) { | ||
o[prop] = deepClone(objProp) | ||
@@ -68,0 +72,0 @@ } else o[prop] = objProp |
{ | ||
"name": "@domql/utils", | ||
"version": "2.3.12", | ||
"version": "2.3.13", | ||
"main": "index.js", | ||
@@ -9,4 +9,4 @@ "license": "MIT", | ||
}, | ||
"gitHead": "3e4765dd6eed427b88443d8227de6574bff1c1bb", | ||
"gitHead": "d00cd0afbcd26f61297f93cf18279dfaf41e4307", | ||
"source": "index.js" | ||
} |
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
8864
285