@domql/utils 2.3.119 → 2.3.120
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/dist/cjs/object.js +3 -3
- package/object.js +3 -3
- package/package.json +2 -2
package/dist/cjs/object.js
CHANGED
|
@@ -304,14 +304,14 @@ const overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
|
304
304
|
}
|
|
305
305
|
return obj;
|
|
306
306
|
};
|
|
307
|
-
const overwriteDeep = (
|
|
307
|
+
const overwriteDeep = (obj, params, excludeFrom = []) => {
|
|
308
308
|
for (const e in params) {
|
|
309
309
|
if (excludeFrom.includes(e) || e.includes("__"))
|
|
310
310
|
continue;
|
|
311
311
|
const objProp = obj[e];
|
|
312
312
|
const paramsProp = params[e];
|
|
313
313
|
if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
|
|
314
|
-
overwriteDeep(
|
|
314
|
+
overwriteDeep(objProp, paramsProp);
|
|
315
315
|
} else if (paramsProp !== void 0) {
|
|
316
316
|
obj[e] = paramsProp;
|
|
317
317
|
}
|
|
@@ -324,7 +324,7 @@ const mergeIfExisted = (a, b) => {
|
|
|
324
324
|
return a || b;
|
|
325
325
|
};
|
|
326
326
|
const flattenRecursive = (param, prop, stack = []) => {
|
|
327
|
-
const objectized = mergeAndCloneIfArray(param);
|
|
327
|
+
const objectized = (0, import_array.mergeAndCloneIfArray)(param);
|
|
328
328
|
stack.push(objectized);
|
|
329
329
|
const extendOfExtend = objectized[prop];
|
|
330
330
|
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)) {
|
|
@@ -301,13 +301,13 @@ export const overwriteShallow = (obj, params, excludeFrom = []) => {
|
|
|
301
301
|
/**
|
|
302
302
|
* Overwrites DEEPLY object properties with another
|
|
303
303
|
*/
|
|
304
|
-
export const overwriteDeep = (
|
|
304
|
+
export const overwriteDeep = (obj, params, excludeFrom = []) => {
|
|
305
305
|
for (const e in params) {
|
|
306
306
|
if (excludeFrom.includes(e) || e.includes('__')) continue
|
|
307
307
|
const objProp = obj[e]
|
|
308
308
|
const paramsProp = params[e]
|
|
309
309
|
if (isObjectLike(objProp) && isObjectLike(paramsProp)) {
|
|
310
|
-
overwriteDeep(
|
|
310
|
+
overwriteDeep(objProp, paramsProp)
|
|
311
311
|
} else if (paramsProp !== undefined) {
|
|
312
312
|
obj[e] = paramsProp
|
|
313
313
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.120",
|
|
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": "
|
|
26
|
+
"gitHead": "6e932a813b8e6ee0a57a40ebc6dc757cc44e6427",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "^7.12.0"
|
|
29
29
|
}
|