@domql/utils 2.29.49 → 2.29.50

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.
@@ -358,11 +358,12 @@ const hasFunction = (str) => {
358
358
  /^\(\s*function/,
359
359
  /^[a-zA-Z_$][a-zA-Z0-9_$]*\s*=>/
360
360
  ];
361
+ const isClass = str.startsWith("class");
361
362
  const isFunction2 = patterns.some((pattern) => pattern.test(trimmed));
362
363
  const isObjectLiteral = trimmed.startsWith("{") && !trimmed.includes("=>");
363
364
  const isArrayLiteral = trimmed.startsWith("[");
364
365
  const isJSONLike = /^["[{]/.test(trimmed) && !trimmed.includes("=>");
365
- return isFunction2 && !isObjectLiteral && !isArrayLiteral && !isJSONLike;
366
+ return (isFunction2 || isClass) && !isObjectLiteral && !isArrayLiteral && !isJSONLike;
366
367
  };
367
368
  const deepDestringify = (obj, destringified = {}) => {
368
369
  for (const prop in obj) {
@@ -326,11 +326,12 @@ const hasFunction = (str) => {
326
326
  /^\(\s*function/,
327
327
  /^[a-zA-Z_$][a-zA-Z0-9_$]*\s*=>/
328
328
  ];
329
+ const isClass = str.startsWith("class");
329
330
  const isFunction2 = patterns.some((pattern) => pattern.test(trimmed));
330
331
  const isObjectLiteral = trimmed.startsWith("{") && !trimmed.includes("=>");
331
332
  const isArrayLiteral = trimmed.startsWith("[");
332
333
  const isJSONLike = /^["[{]/.test(trimmed) && !trimmed.includes("=>");
333
- return isFunction2 && !isObjectLiteral && !isArrayLiteral && !isJSONLike;
334
+ return (isFunction2 || isClass) && !isObjectLiteral && !isArrayLiteral && !isJSONLike;
334
335
  };
335
336
  const deepDestringify = (obj, destringified = {}) => {
336
337
  for (const prop in obj) {
package/object.js CHANGED
@@ -407,12 +407,13 @@ export const hasFunction = str => {
407
407
  /^[a-zA-Z_$][a-zA-Z0-9_$]*\s*=>/
408
408
  ]
409
409
 
410
+ const isClass = str.startsWith('class')
410
411
  const isFunction = patterns.some(pattern => pattern.test(trimmed))
411
412
  const isObjectLiteral = trimmed.startsWith('{') && !trimmed.includes('=>')
412
413
  const isArrayLiteral = trimmed.startsWith('[')
413
414
  const isJSONLike = /^["[{]/.test(trimmed) && !trimmed.includes('=>')
414
415
 
415
- return isFunction && !isObjectLiteral && !isArrayLiteral && !isJSONLike
416
+ return (isFunction || isClass) && !isObjectLiteral && !isArrayLiteral && !isJSONLike
416
417
  }
417
418
 
418
419
  export const deepDestringify = (obj, destringified = {}) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.29.49",
3
+ "version": "2.29.50",
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": "ebfe2d43195e0283db9fd66131d860751c093711",
27
+ "gitHead": "0ac401042c1518bd435e8c61b2407d3f00b86264",
28
28
  "devDependencies": {
29
29
  "@babel/core": "^7.27.1"
30
30
  }