@domql/utils 2.5.107 → 2.5.108
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 +1 -1
- package/object.js +3 -1
- package/package.json +2 -2
package/dist/cjs/object.js
CHANGED
|
@@ -159,7 +159,7 @@ const deepClone = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
|
159
159
|
return o;
|
|
160
160
|
};
|
|
161
161
|
const deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
|
|
162
|
-
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
162
|
+
const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
|
|
163
163
|
for (const prop in obj) {
|
|
164
164
|
if (!Object.prototype.hasOwnProperty.call(obj, prop))
|
|
165
165
|
continue;
|
package/object.js
CHANGED
|
@@ -123,7 +123,9 @@ export const deepClone = (obj, excludeFrom = [], cleanUndefined = false) => {
|
|
|
123
123
|
* Deep cloning of object
|
|
124
124
|
*/
|
|
125
125
|
export const deepCloneWithExtend = (obj, excludeFrom = ['node'], options = {}) => {
|
|
126
|
-
const o =
|
|
126
|
+
const o = options.window
|
|
127
|
+
? isArray(obj) ? new options.window.Array([]) : new options.window.Object({})
|
|
128
|
+
: isArray(obj) ? [] : {}
|
|
127
129
|
for (const prop in obj) {
|
|
128
130
|
if (!Object.prototype.hasOwnProperty.call(obj, prop)) continue
|
|
129
131
|
// if (prop === 'node' || prop === 'parent' || prop === 'root' || prop === '__element') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.108",
|
|
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": "
|
|
26
|
+
"gitHead": "ff2aaabca6543ef8e045b928e8bd222d62f4a409",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "^7.12.0"
|
|
29
29
|
}
|