@domql/utils 2.3.141 → 2.3.142

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.
@@ -64,7 +64,7 @@ const map = (obj, extention, element) => {
64
64
  };
65
65
  const merge = (element, obj, excludeFrom = []) => {
66
66
  for (const e in obj) {
67
- if (excludeFrom.includes(e) || e.includes("__"))
67
+ if (excludeFrom.includes(e) || e.startsWith("__"))
68
68
  continue;
69
69
  const elementProp = element[e];
70
70
  const objProp = obj[e];
@@ -76,7 +76,7 @@ const merge = (element, obj, excludeFrom = []) => {
76
76
  };
77
77
  const deepMerge = (element, extend, excludeFrom = []) => {
78
78
  for (const e in extend) {
79
- if (excludeFrom.includes(e) || e.includes("__"))
79
+ if (excludeFrom.includes(e) || e.startsWith("__"))
80
80
  continue;
81
81
  const elementProp = element[e];
82
82
  const extendProp = extend[e];
@@ -91,7 +91,7 @@ const deepMerge = (element, extend, excludeFrom = []) => {
91
91
  const clone = (obj, excludeFrom = []) => {
92
92
  const o = {};
93
93
  for (const prop in obj) {
94
- if (excludeFrom.includes(prop) || prop.includes("__"))
94
+ if (excludeFrom.includes(prop) || prop.startsWith("__"))
95
95
  continue;
96
96
  o[prop] = obj[prop];
97
97
  }
@@ -103,7 +103,7 @@ const deepCloneExclude = (obj, excludeFrom = []) => {
103
103
  }
104
104
  const o = {};
105
105
  for (const k in obj) {
106
- if (excludeFrom.includes(k) || k.includes("__"))
106
+ if (excludeFrom.includes(k) || k.startsWith("__"))
107
107
  continue;
108
108
  let v = obj[k];
109
109
  if (k === "extend" && (0, import_types.isArray)(v)) {
@@ -124,7 +124,7 @@ const mergeArrayExclude = (arr, excl = []) => {
124
124
  const deepClone = (obj, excludeFrom = []) => {
125
125
  const o = (0, import_types.isArray)(obj) ? [] : {};
126
126
  for (const prop in obj) {
127
- if (excludeFrom.includes(prop) || prop.includes("__"))
127
+ if (excludeFrom.includes(prop) || prop.startsWith("__"))
128
128
  continue;
129
129
  let objProp = obj[prop];
130
130
  if (prop === "extend" && (0, import_types.isArray)(objProp)) {
@@ -322,7 +322,7 @@ const overwrite = (element, params, excludeFrom = []) => {
322
322
  const { ref } = element;
323
323
  const changes = {};
324
324
  for (const e in params) {
325
- if (excludeFrom.includes(e) || e.includes("__"))
325
+ if (excludeFrom.includes(e) || e.startsWith("__"))
326
326
  continue;
327
327
  const elementProp = element[e];
328
328
  const paramsProp = params[e];
@@ -335,7 +335,7 @@ const overwrite = (element, params, excludeFrom = []) => {
335
335
  };
336
336
  const overwriteShallow = (obj, params, excludeFrom = []) => {
337
337
  for (const e in params) {
338
- if (excludeFrom.includes(e) || e.includes("__"))
338
+ if (excludeFrom.includes(e) || e.startsWith("__"))
339
339
  continue;
340
340
  obj[e] = params[e];
341
341
  }
@@ -343,10 +343,12 @@ const overwriteShallow = (obj, params, excludeFrom = []) => {
343
343
  };
344
344
  const overwriteDeep = (obj, params, excludeFrom = []) => {
345
345
  for (const e in params) {
346
- if (excludeFrom.includes(e) || e.includes("__"))
346
+ if (excludeFrom.includes(e) || e.startsWith("__"))
347
347
  continue;
348
348
  const objProp = obj[e];
349
349
  const paramsProp = params[e];
350
+ if (!obj.hasOwnProperty(e) || e === "__proto__" || e === "constructor")
351
+ continue;
350
352
  if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
351
353
  overwriteDeep(objProp, paramsProp);
352
354
  } else if (paramsProp !== void 0) {
package/object.js CHANGED
@@ -24,7 +24,7 @@ export const map = (obj, extention, element) => {
24
24
 
25
25
  export const merge = (element, obj, excludeFrom = []) => {
26
26
  for (const e in obj) {
27
- if (excludeFrom.includes(e) || e.includes('__')) continue
27
+ if (excludeFrom.includes(e) || e.startsWith('__')) continue
28
28
  const elementProp = element[e]
29
29
  const objProp = obj[e]
30
30
  if (elementProp === undefined) {
@@ -36,7 +36,7 @@ export const merge = (element, obj, excludeFrom = []) => {
36
36
 
37
37
  export const deepMerge = (element, extend, excludeFrom = []) => {
38
38
  for (const e in extend) {
39
- if (excludeFrom.includes(e) || e.includes('__')) continue
39
+ if (excludeFrom.includes(e) || e.startsWith('__')) continue
40
40
  const elementProp = element[e]
41
41
  const extendProp = extend[e]
42
42
  if (isObjectLike(elementProp) && isObjectLike(extendProp)) {
@@ -51,7 +51,7 @@ export const deepMerge = (element, extend, excludeFrom = []) => {
51
51
  export const clone = (obj, excludeFrom = []) => {
52
52
  const o = {}
53
53
  for (const prop in obj) {
54
- if (excludeFrom.includes(prop) || prop.includes('__')) continue
54
+ if (excludeFrom.includes(prop) || prop.startsWith('__')) continue
55
55
  o[prop] = obj[prop]
56
56
  }
57
57
  return o
@@ -65,7 +65,7 @@ export const deepCloneExclude = (obj, excludeFrom = []) => {
65
65
 
66
66
  const o = {}
67
67
  for (const k in obj) {
68
- if (excludeFrom.includes(k) || k.includes('__')) continue
68
+ if (excludeFrom.includes(k) || k.startsWith('__')) continue
69
69
 
70
70
  let v = obj[k]
71
71
 
@@ -94,7 +94,7 @@ export const mergeArrayExclude = (arr, excl = []) => {
94
94
  export const deepClone = (obj, excludeFrom = []) => {
95
95
  const o = isArray(obj) ? [] : {}
96
96
  for (const prop in obj) {
97
- if (excludeFrom.includes(prop) || prop.includes('__')) continue
97
+ if (excludeFrom.includes(prop) || prop.startsWith('__')) continue
98
98
  let objProp = obj[prop]
99
99
  if (prop === 'extend' && isArray(objProp)) {
100
100
  objProp = mergeArray(objProp)
@@ -305,7 +305,7 @@ export const overwrite = (element, params, excludeFrom = []) => {
305
305
  const changes = {}
306
306
 
307
307
  for (const e in params) {
308
- if (excludeFrom.includes(e) || e.includes('__')) continue
308
+ if (excludeFrom.includes(e) || e.startsWith('__')) continue
309
309
 
310
310
  const elementProp = element[e]
311
311
  const paramsProp = params[e]
@@ -321,7 +321,7 @@ export const overwrite = (element, params, excludeFrom = []) => {
321
321
 
322
322
  export const overwriteShallow = (obj, params, excludeFrom = []) => {
323
323
  for (const e in params) {
324
- if (excludeFrom.includes(e) || e.includes('__')) continue
324
+ if (excludeFrom.includes(e) || e.startsWith('__')) continue
325
325
  obj[e] = params[e]
326
326
  }
327
327
  return obj
@@ -332,9 +332,10 @@ export const overwriteShallow = (obj, params, excludeFrom = []) => {
332
332
  */
333
333
  export const overwriteDeep = (obj, params, excludeFrom = []) => {
334
334
  for (const e in params) {
335
- if (excludeFrom.includes(e) || e.includes('__')) continue
335
+ if (excludeFrom.includes(e) || e.startsWith('__')) continue
336
336
  const objProp = obj[e]
337
337
  const paramsProp = params[e]
338
+ if (!obj.hasOwnProperty(e) || e === '__proto__' || e === 'constructor') continue
338
339
  if (isObjectLike(objProp) && isObjectLike(paramsProp)) {
339
340
  overwriteDeep(objProp, paramsProp)
340
341
  } else if (paramsProp !== undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.3.141",
3
+ "version": "2.3.142",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -23,7 +23,7 @@
23
23
  "@domql/key": "latest",
24
24
  "@domql/tags": "latest"
25
25
  },
26
- "gitHead": "ba9451d23df608f67ee1fd24de442cd558387202",
26
+ "gitHead": "5d134dec55390026220f6370a71c82feb6f26aad",
27
27
  "devDependencies": {
28
28
  "@babel/core": "^7.12.0"
29
29
  }