@domql/utils 2.3.113 → 2.3.115
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 +2 -2
- package/dist/cjs/array.js +2 -2
- package/dist/cjs/object.js +0 -8
- package/object.js +0 -12
- package/package.json +2 -2
package/array.js
CHANGED
|
@@ -33,8 +33,8 @@ export const joinArrays = (...arrays) => {
|
|
|
33
33
|
/**
|
|
34
34
|
* Merges array extendtypes
|
|
35
35
|
*/
|
|
36
|
-
export const mergeArray = (arr) => {
|
|
37
|
-
return arr.reduce((a, c) => deepMerge(a, deepClone(c)), {})
|
|
36
|
+
export const mergeArray = (arr, excludeFrom = []) => {
|
|
37
|
+
return arr.reduce((a, c) => deepMerge(a, deepClone(c, excludeFrom), excludeFrom), {})
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
package/dist/cjs/array.js
CHANGED
|
@@ -52,8 +52,8 @@ const swapItemsInArray = (arr, i, j) => {
|
|
|
52
52
|
const joinArrays = (...arrays) => {
|
|
53
53
|
return [].concat(...arrays);
|
|
54
54
|
};
|
|
55
|
-
const mergeArray = (arr) => {
|
|
56
|
-
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c)), {});
|
|
55
|
+
const mergeArray = (arr, excludeFrom = []) => {
|
|
56
|
+
return arr.reduce((a, c) => (0, import_object.deepMerge)(a, (0, import_object.deepClone)(c, excludeFrom), excludeFrom), {});
|
|
57
57
|
};
|
|
58
58
|
const mergeAndCloneIfArray = (obj) => {
|
|
59
59
|
return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
|
package/dist/cjs/object.js
CHANGED
|
@@ -33,8 +33,6 @@ __export(object_exports, {
|
|
|
33
33
|
isEqualDeep: () => isEqualDeep,
|
|
34
34
|
map: () => map,
|
|
35
35
|
merge: () => merge,
|
|
36
|
-
mergeAndCloneIfArray: () => mergeAndCloneIfArray,
|
|
37
|
-
mergeArrayExclude: () => mergeArrayExclude,
|
|
38
36
|
mergeIfExisted: () => mergeIfExisted,
|
|
39
37
|
overwrite: () => overwrite,
|
|
40
38
|
overwriteDeep: () => overwriteDeep,
|
|
@@ -114,9 +112,6 @@ const deepCloneExclude = (obj, excludeFrom = []) => {
|
|
|
114
112
|
}
|
|
115
113
|
return o;
|
|
116
114
|
};
|
|
117
|
-
const mergeArrayExclude = (arr, excl = []) => {
|
|
118
|
-
return arr.reduce((acc, curr) => deepMerge(acc, deepCloneExclude(curr, excl)), {});
|
|
119
|
-
};
|
|
120
115
|
const deepClone = (obj, excludeFrom = []) => {
|
|
121
116
|
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
122
117
|
for (const prop in obj) {
|
|
@@ -323,9 +318,6 @@ const mergeIfExisted = (a, b) => {
|
|
|
323
318
|
return deepMerge(a, b);
|
|
324
319
|
return a || b;
|
|
325
320
|
};
|
|
326
|
-
const mergeAndCloneIfArray = (obj) => {
|
|
327
|
-
return (0, import_types.isArray)(obj) ? mergeArray(obj) : deepClone(obj);
|
|
328
|
-
};
|
|
329
321
|
const flattenRecursive = (param, prop, stack = []) => {
|
|
330
322
|
const objectized = mergeAndCloneIfArray(param);
|
|
331
323
|
stack.push(objectized);
|
package/object.js
CHANGED
|
@@ -81,11 +81,6 @@ export const deepCloneExclude = (obj, excludeFrom = []) => {
|
|
|
81
81
|
return o
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// Merge array, but excludeFrom keys listed in 'excl'
|
|
85
|
-
export const mergeArrayExclude = (arr, excl = []) => {
|
|
86
|
-
return arr.reduce((acc, curr) => deepMerge(acc, deepCloneExclude(curr, excl)), {})
|
|
87
|
-
}
|
|
88
|
-
|
|
89
84
|
/**
|
|
90
85
|
* Deep cloning of object
|
|
91
86
|
*/
|
|
@@ -323,13 +318,6 @@ export const mergeIfExisted = (a, b) => {
|
|
|
323
318
|
return a || b
|
|
324
319
|
}
|
|
325
320
|
|
|
326
|
-
/**
|
|
327
|
-
* Merges array extendtypes
|
|
328
|
-
*/
|
|
329
|
-
export const mergeAndCloneIfArray = obj => {
|
|
330
|
-
return isArray(obj) ? mergeArray(obj) : deepClone(obj)
|
|
331
|
-
}
|
|
332
|
-
|
|
333
321
|
/**
|
|
334
322
|
* Overwrites object properties with another
|
|
335
323
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.115",
|
|
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": "46c7ced42f3e8ef84fa642c5415f556f0f0a16cd",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "^7.12.0"
|
|
29
29
|
}
|