@domql/utils 2.5.177 → 2.5.178

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.
@@ -231,6 +231,9 @@ const deepStringifyWithMaxDepth = (obj, stringified = {}, depth = 0, path = "")
231
231
  return stringified;
232
232
  };
233
233
  const objectToString = (obj = {}, indent = 0) => {
234
+ if (obj === null || typeof obj !== "object") {
235
+ return String(obj);
236
+ }
234
237
  if (Object.keys(obj).length === 0) {
235
238
  return "{}";
236
239
  }
@@ -202,6 +202,9 @@ const deepStringifyWithMaxDepth = (obj, stringified = {}, depth = 0, path = "")
202
202
  return stringified;
203
203
  };
204
204
  const objectToString = (obj = {}, indent = 0) => {
205
+ if (obj === null || typeof obj !== "object") {
206
+ return String(obj);
207
+ }
205
208
  if (Object.keys(obj).length === 0) {
206
209
  return "{}";
207
210
  }
package/object.js CHANGED
@@ -238,6 +238,11 @@ export const deepStringifyWithMaxDepth = (obj, stringified = {}, depth = 0, path
238
238
  }
239
239
 
240
240
  export const objectToString = (obj = {}, indent = 0) => {
241
+ // Handle empty object case
242
+ if (obj === null || typeof obj !== 'object') {
243
+ return String(obj)
244
+ }
245
+
241
246
  // Handle empty object case
242
247
  if (Object.keys(obj).length === 0) {
243
248
  return '{}'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.5.177",
3
+ "version": "2.5.178",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -25,7 +25,7 @@
25
25
  "build": "npm run build:cjs; npm run build:esm",
26
26
  "prepublish": "rimraf -I dist; npm run build; npm run copy:package:cjs"
27
27
  },
28
- "gitHead": "faa8ed6c9ba30a49c81962cd3e16c0ffac833f4e",
28
+ "gitHead": "b274eb76e068d125b38f9e617fcfb98d657eafbd",
29
29
  "devDependencies": {
30
30
  "@babel/core": "^7.12.0"
31
31
  }