@domql/utils 2.5.108 → 2.5.112

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/array.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { deepClone, deepMerge } from './object'
3
+ import { deepCloneWithExtend, deepMerge } from './object'
4
4
  import { isArray, isNumber, isString } from './types'
5
5
 
6
6
  export const arrayContainsOtherArray = (arr1, arr2) => {
@@ -40,14 +40,14 @@ export const joinArrays = (...arrays) => {
40
40
  * Merges array extendtypes
41
41
  */
42
42
  export const mergeArray = (arr, excludeFrom = []) => {
43
- return arr.reduce((a, c) => deepMerge(a, deepClone(c, excludeFrom), excludeFrom), {})
43
+ return arr.reduce((a, c) => deepMerge(a, deepCloneWithExtend(c, excludeFrom), excludeFrom), {})
44
44
  }
45
45
 
46
46
  /**
47
47
  * Merges array extends
48
48
  */
49
49
  export const mergeAndCloneIfArray = obj => {
50
- return isArray(obj) ? mergeArray(obj) : deepClone(obj)
50
+ return isArray(obj) ? mergeArray(obj) : deepCloneWithExtend(obj)
51
51
  }
52
52
 
53
53
  export const cutArrayBeforeValue = (arr, value) => {
package/dist/cjs/array.js CHANGED
@@ -67,10 +67,10 @@ const joinArrays = (...arrays) => {
67
67
  return [].concat(...arrays);
68
68
  };
69
69
  const mergeArray = (arr, excludeFrom = []) => {
70
- return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
70
+ return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepCloneWithExtend)(c, excludeFrom), excludeFrom), {});
71
71
  };
72
72
  const mergeAndCloneIfArray = (obj) => {
73
- return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
73
+ return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepCloneWithExtend)(obj);
74
74
  };
75
75
  const cutArrayBeforeValue = (arr, value) => {
76
76
  const index = arr.indexOf(value);
@@ -413,7 +413,7 @@ const overwriteShallow = (obj, params, excludeFrom = []) => {
413
413
  };
414
414
  const overwriteDeep = (obj, params, excludeFrom = []) => {
415
415
  for (const e in params) {
416
- if (e === "__proto__")
416
+ if (e === "__ref")
417
417
  continue;
418
418
  if (excludeFrom.includes(e) || e.startsWith("__"))
419
419
  continue;
package/object.js CHANGED
@@ -428,7 +428,7 @@ export const overwriteShallow = (obj, params, excludeFrom = []) => {
428
428
  */
429
429
  export const overwriteDeep = (obj, params, excludeFrom = []) => {
430
430
  for (const e in params) {
431
- if (e === '__proto__') continue
431
+ if (e === '__ref') continue
432
432
  if (excludeFrom.includes(e) || e.startsWith('__')) continue
433
433
  const objProp = obj[e]
434
434
  const paramsProp = params[e]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.5.108",
3
+ "version": "2.5.112",
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": "ff2aaabca6543ef8e045b928e8bd222d62f4a409",
26
+ "gitHead": "8a59640e77bcd22114bdf64dfa4945604b5bfd1f",
27
27
  "devDependencies": {
28
28
  "@babel/core": "^7.12.0"
29
29
  }