@domql/utils 2.3.12 → 2.3.13

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.
Files changed (2) hide show
  1. package/object.js +7 -3
  2. package/package.json +2 -2
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, excluding = ['parent', 'node', '__element', '__root']) => {
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 (isObjectLike(objProp)) {
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,11 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.3.12",
3
+ "version": "2.3.13",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
7
  "@domql/tags": "latest"
8
8
  },
9
- "gitHead": "3e4765dd6eed427b88443d8227de6574bff1c1bb",
9
+ "gitHead": "d00cd0afbcd26f61297f93cf18279dfaf41e4307",
10
10
  "source": "index.js"
11
11
  }