@domql/utils 2.3.12 → 2.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/object.js +7 -3
- package/package.json +2 -3
package/object.js
CHANGED
|
@@ -53,15 +53,19 @@ export const clone = obj => {
|
|
|
53
53
|
/**
|
|
54
54
|
* Deep cloning of object
|
|
55
55
|
*/
|
|
56
|
-
export const deepClone = (obj
|
|
56
|
+
export const deepClone = (obj) => {
|
|
57
|
+
if (isArray(obj)) {
|
|
58
|
+
return obj.map(deepClone)
|
|
59
|
+
}
|
|
57
60
|
const o = {}
|
|
58
61
|
for (const prop in obj) {
|
|
59
|
-
if (excluding.indexOf(prop) > -1) continue
|
|
60
62
|
let objProp = obj[prop]
|
|
61
63
|
if (prop === 'extend' && isArray(objProp)) {
|
|
62
64
|
objProp = mergeArray(objProp)
|
|
63
65
|
}
|
|
64
|
-
if (
|
|
66
|
+
if (isArray(objProp)) {
|
|
67
|
+
o[prop] = objProp.map(deepClone)
|
|
68
|
+
} else if (isObject(objProp)) {
|
|
65
69
|
o[prop] = deepClone(objProp)
|
|
66
70
|
} else o[prop] = objProp
|
|
67
71
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.14",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@domql/tags": "latest"
|
|
8
8
|
},
|
|
9
|
-
"gitHead": "
|
|
10
|
-
"source": "index.js"
|
|
9
|
+
"gitHead": "59dd9cc310918fa0a8957e18317bedb934583162"
|
|
11
10
|
}
|