@domql/utils 2.3.119 → 2.3.125

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.
@@ -60,8 +60,10 @@ const map = (obj, extention, element) => {
60
60
  obj[e] = exec(extention[e], element);
61
61
  }
62
62
  };
63
- const merge = (element, obj) => {
63
+ const merge = (element, obj, excludeFrom = []) => {
64
64
  for (const e in obj) {
65
+ if (excludeFrom.includes(e) || e.includes("__"))
66
+ continue;
65
67
  const elementProp = element[e];
66
68
  const objProp = obj[e];
67
69
  if (elementProp === void 0) {
@@ -304,14 +306,14 @@ const overwriteShallow = (obj, params, excludeFrom = []) => {
304
306
  }
305
307
  return obj;
306
308
  };
307
- const overwriteDeep = (params, obj, excludeFrom = []) => {
309
+ const overwriteDeep = (obj, params, excludeFrom = []) => {
308
310
  for (const e in params) {
309
311
  if (excludeFrom.includes(e) || e.includes("__"))
310
312
  continue;
311
313
  const objProp = obj[e];
312
314
  const paramsProp = params[e];
313
315
  if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
314
- overwriteDeep(paramsProp, objProp);
316
+ overwriteDeep(objProp, paramsProp);
315
317
  } else if (paramsProp !== void 0) {
316
318
  obj[e] = paramsProp;
317
319
  }
@@ -324,7 +326,7 @@ const mergeIfExisted = (a, b) => {
324
326
  return a || b;
325
327
  };
326
328
  const flattenRecursive = (param, prop, stack = []) => {
327
- const objectized = mergeAndCloneIfArray(param);
329
+ const objectized = (0, import_array.mergeAndCloneIfArray)(param);
328
330
  stack.push(objectized);
329
331
  const extendOfExtend = objectized[prop];
330
332
  if (extendOfExtend)
package/object.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { window } from '@domql/globals'
4
4
  import { isFunction, isObjectLike, isObject, isArray, isString, is } from './types.js'
5
- import { mergeArray } from './array.js'
5
+ import { mergeAndCloneIfArray, mergeArray } from './array.js'
6
6
 
7
7
  export const exec = (param, element, state, context) => {
8
8
  if (isFunction(param)) {
@@ -21,8 +21,9 @@ export const map = (obj, extention, element) => {
21
21
  }
22
22
  }
23
23
 
24
- export const merge = (element, obj) => {
24
+ export const merge = (element, obj, excludeFrom = []) => {
25
25
  for (const e in obj) {
26
+ if (excludeFrom.includes(e) || e.includes('__')) continue
26
27
  const elementProp = element[e]
27
28
  const objProp = obj[e]
28
29
  if (elementProp === undefined) {
@@ -301,13 +302,13 @@ export const overwriteShallow = (obj, params, excludeFrom = []) => {
301
302
  /**
302
303
  * Overwrites DEEPLY object properties with another
303
304
  */
304
- export const overwriteDeep = (params, obj, excludeFrom = []) => {
305
+ export const overwriteDeep = (obj, params, excludeFrom = []) => {
305
306
  for (const e in params) {
306
307
  if (excludeFrom.includes(e) || e.includes('__')) continue
307
308
  const objProp = obj[e]
308
309
  const paramsProp = params[e]
309
310
  if (isObjectLike(objProp) && isObjectLike(paramsProp)) {
310
- overwriteDeep(paramsProp, objProp)
311
+ overwriteDeep(objProp, paramsProp)
311
312
  } else if (paramsProp !== undefined) {
312
313
  obj[e] = paramsProp
313
314
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.3.119",
3
+ "version": "2.3.125",
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": "b5b409c827c8b21896d84918f4fe9d133b057916",
26
+ "gitHead": "c62e01157f488334d07a8bbd67f892d617d48f06",
27
27
  "devDependencies": {
28
28
  "@babel/core": "^7.12.0"
29
29
  }