@domql/utils 2.5.101 → 2.5.108

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.
@@ -159,7 +159,7 @@ const deepClone = (obj, excludeFrom = [], cleanUndefined = false) => {
159
159
  return o;
160
160
  };
161
161
  const deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
162
- const o = (0, import_types.isArray)(obj) ? [] : {};
162
+ const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
163
163
  for (const prop in obj) {
164
164
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
165
165
  continue;
@@ -535,6 +535,12 @@ const getChildrenComponentsByKey = (key, el) => {
535
535
  if (foundString || foundInArray)
536
536
  return el;
537
537
  }
538
+ if (el.parent && el.parent.childExtend) {
539
+ const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
540
+ const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
541
+ if (foundString || foundInArray)
542
+ return el;
543
+ }
538
544
  };
539
545
  const getExtendsInElement = (obj) => {
540
546
  let result = [];
package/object.js CHANGED
@@ -123,7 +123,9 @@ export const deepClone = (obj, excludeFrom = [], cleanUndefined = false) => {
123
123
  * Deep cloning of object
124
124
  */
125
125
  export const deepCloneWithExtend = (obj, excludeFrom = ['node'], options = {}) => {
126
- const o = isArray(obj) ? [] : {}
126
+ const o = options.window
127
+ ? isArray(obj) ? new options.window.Array([]) : new options.window.Object({})
128
+ : isArray(obj) ? [] : {}
127
129
  for (const prop in obj) {
128
130
  if (!Object.prototype.hasOwnProperty.call(obj, prop)) continue
129
131
  // if (prop === 'node' || prop === 'parent' || prop === 'root' || prop === '__element') {
@@ -613,6 +615,13 @@ export const getChildrenComponentsByKey = (key, el) => {
613
615
  const foundInArray = isArray(el.extend) && el.extend.filter(v => v === key).length
614
616
  if (foundString || foundInArray) return el
615
617
  }
618
+
619
+ if (el.parent && el.parent.childExtend) {
620
+ // Add the value of the extend key to the result array
621
+ const foundString = isString(el.parent.childExtend) && el.parent.childExtend === key
622
+ const foundInArray = isArray(el.parent.childExtend) && el.parent.childExtend.filter(v => v === key).length
623
+ if (foundString || foundInArray) return el
624
+ }
616
625
  }
617
626
 
618
627
  export const getExtendsInElement = (obj) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.5.101",
3
+ "version": "2.5.108",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -23,7 +23,7 @@
23
23
  "build": "yarn build:cjs",
24
24
  "prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
25
25
  },
26
- "gitHead": "5a5e8988f25e9a77e44596d9fd23e8a00b725685",
26
+ "gitHead": "ff2aaabca6543ef8e045b928e8bd222d62f4a409",
27
27
  "devDependencies": {
28
28
  "@babel/core": "^7.12.0"
29
29
  }