@domql/utils 2.33.9 → 2.33.11
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 +7 -1
- package/dist/esm/object.js +7 -1
- package/object.js +12 -3
- package/package.json +2 -2
package/dist/cjs/object.js
CHANGED
|
@@ -162,7 +162,7 @@ const deepClone = (obj, options = {}) => {
|
|
|
162
162
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
163
163
|
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
164
164
|
continue;
|
|
165
|
-
|
|
165
|
+
let value = obj[key];
|
|
166
166
|
if (cleanUndefined && (0, import_types.isUndefined)(value) || cleanNull && (0, import_types.isNull)(value))
|
|
167
167
|
continue;
|
|
168
168
|
if ((0, import_node.isDOMNode)(value)) {
|
|
@@ -177,6 +177,12 @@ const deepClone = (obj, options = {}) => {
|
|
|
177
177
|
clone2[key] = contentWindow.eval("(" + value.toString() + ")");
|
|
178
178
|
continue;
|
|
179
179
|
}
|
|
180
|
+
if ((value == null ? void 0 : value.__ref) && (value == null ? void 0 : value.node)) {
|
|
181
|
+
value = value.parseDeep();
|
|
182
|
+
}
|
|
183
|
+
if (value == null ? void 0 : value.__element) {
|
|
184
|
+
value = value.parse();
|
|
185
|
+
}
|
|
180
186
|
if ((0, import_types.isObjectLike)(value)) {
|
|
181
187
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
182
188
|
clone2[key] = deepClone(value, {
|
package/dist/esm/object.js
CHANGED
|
@@ -132,7 +132,7 @@ const deepClone = (obj, options = {}) => {
|
|
|
132
132
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
133
133
|
if (exclude.includes(key) || key.startsWith("__") || key === "__proto__")
|
|
134
134
|
continue;
|
|
135
|
-
|
|
135
|
+
let value = obj[key];
|
|
136
136
|
if (cleanUndefined && isUndefined(value) || cleanNull && isNull(value))
|
|
137
137
|
continue;
|
|
138
138
|
if (isDOMNode(value)) {
|
|
@@ -147,6 +147,12 @@ const deepClone = (obj, options = {}) => {
|
|
|
147
147
|
clone2[key] = contentWindow.eval("(" + value.toString() + ")");
|
|
148
148
|
continue;
|
|
149
149
|
}
|
|
150
|
+
if ((value == null ? void 0 : value.__ref) && (value == null ? void 0 : value.node)) {
|
|
151
|
+
value = value.parseDeep();
|
|
152
|
+
}
|
|
153
|
+
if (value == null ? void 0 : value.__element) {
|
|
154
|
+
value = value.parse();
|
|
155
|
+
}
|
|
150
156
|
if (isObjectLike(value)) {
|
|
151
157
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
152
158
|
clone2[key] = deepClone(value, __spreadProps(__spreadValues({}, options), {
|
package/object.js
CHANGED
|
@@ -164,8 +164,8 @@ export const deepClone = (obj, options = {}) => {
|
|
|
164
164
|
? new contentWindow.Array()
|
|
165
165
|
: new contentWindow.Object()
|
|
166
166
|
: isArray(obj)
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
? []
|
|
168
|
+
: {}
|
|
169
169
|
|
|
170
170
|
// Store the clone to handle circular references
|
|
171
171
|
visited.set(obj, clone)
|
|
@@ -178,7 +178,7 @@ export const deepClone = (obj, options = {}) => {
|
|
|
178
178
|
if (exclude.includes(key) || key.startsWith('__') || key === '__proto__')
|
|
179
179
|
continue
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
let value = obj[key]
|
|
182
182
|
|
|
183
183
|
// Skip based on cleanup options
|
|
184
184
|
if ((cleanUndefined && isUndefined(value)) || (cleanNull && isNull(value)))
|
|
@@ -202,6 +202,15 @@ export const deepClone = (obj, options = {}) => {
|
|
|
202
202
|
continue
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
// Handle special cases
|
|
206
|
+
if (value?.__ref && value?.node) {
|
|
207
|
+
value = value.parseDeep()
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (value?.__element) {
|
|
211
|
+
value = value.parse()
|
|
212
|
+
}
|
|
213
|
+
|
|
205
214
|
// Recursively clone objects
|
|
206
215
|
if (isObjectLike(value)) {
|
|
207
216
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.33.
|
|
3
|
+
"version": "2.33.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"build": "npx rimraf -I dist; npm run build:cjs; npm run build:esm",
|
|
25
25
|
"prepublish": "npm run build; npm run copy:package:cjs"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "bd35281698ecf0b85f212fa22e3ee66a5053c2bb",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/core": "^7.27.1"
|
|
30
30
|
}
|