@domql/utils 2.29.49 → 2.29.51
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 +2 -1
- package/dist/esm/object.js +2 -1
- package/object.js +2 -1
- package/package.json +2 -2
package/dist/cjs/object.js
CHANGED
|
@@ -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) {
|
package/dist/esm/object.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "2.29.51",
|
|
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": "afbffe9a2317d2d0929447ab49251d83296bf546",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/core": "^7.27.1"
|
|
30
30
|
}
|