@domql/utils 2.31.10 → 2.31.12

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.
@@ -184,6 +184,7 @@ const deepClone = (obj, options = {}) => {
184
184
  };
185
185
  const deepStringify = (obj, stringified = {}) => {
186
186
  var _a, _b;
187
+ if (!obj) return;
187
188
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
188
189
  ;
189
190
  (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn(
@@ -153,6 +153,7 @@ const deepClone = (obj, options = {}) => {
153
153
  };
154
154
  const deepStringify = (obj, stringified = {}) => {
155
155
  var _a, _b;
156
+ if (!obj) return;
156
157
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
157
158
  ;
158
159
  (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn(
package/object.js CHANGED
@@ -151,8 +151,8 @@ export const deepClone = (obj, options = {}) => {
151
151
  ? new contentWindow.Array()
152
152
  : new contentWindow.Object()
153
153
  : isArray(obj)
154
- ? []
155
- : {}
154
+ ? []
155
+ : {}
156
156
 
157
157
  // Store the clone to handle circular references
158
158
  visited.set(obj, clone)
@@ -209,6 +209,7 @@ export const deepClone = (obj, options = {}) => {
209
209
  * Stringify object
210
210
  */
211
211
  export const deepStringify = (obj, stringified = {}) => {
212
+ if (!obj) return
212
213
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
213
214
  ;(obj.__element || obj.parent?.__element).warn(
214
215
  'Trying to clone element or state at',
@@ -240,6 +241,7 @@ export const deepStringify = (obj, stringified = {}) => {
240
241
  stringified[prop] = objProp
241
242
  }
242
243
  }
244
+
243
245
  return stringified
244
246
  }
245
247
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.31.10",
3
+ "version": "2.31.12",
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": "d7d834585eb6e08b267f485355c90aaf798fe590",
27
+ "gitHead": "8478519aa7099cb4e38e05ee55bd4ad798947d70",
28
28
  "devDependencies": {
29
29
  "@babel/core": "^7.27.1"
30
30
  }