diff --git a/package-lock.json b/package-lock.json index 8f0197a2..20fb6428 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "ajv": "^8.12.0", "codemirror-wrapped-line-indent": "^1.0.0", "diff-sequences": "^29.6.3", - "immutable-json-patch": "6.0.0", + "immutable-json-patch": "6.0.1", "jmespath": "^0.16.0", "json-source-map": "^0.6.1", "jsonrepair": "^3.5.1", @@ -81,7 +81,7 @@ "svelte-check": "3.6.3", "svelte-preprocess": "5.1.3", "typescript": "5.3.3", - "vite": "5.0.11", + "vite": "5.0.12", "vitest": "1.2.1" } }, @@ -9277,9 +9277,9 @@ "integrity": "sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==" }, "node_modules/immutable-json-patch": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/immutable-json-patch/-/immutable-json-patch-6.0.0.tgz", - "integrity": "sha512-kBI1s6OAoWI0yRfjPr+zTAMqBJRPZeyfkG3CAHhM/S5RYO+EXoaiVmEpYYMvdiAS8GoEJbuKvwcfy38TrRlcuQ==" + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/immutable-json-patch/-/immutable-json-patch-6.0.1.tgz", + "integrity": "sha512-BHL/cXMjwFZlTOffiWNdY8ZTvNyYLrutCnWxrcKPHr5FqpAb6vsO6WWSPnVSys3+DruFN6lhHJJPHi8uELQL5g==" }, "node_modules/import-fresh": { "version": "3.3.0", @@ -13837,9 +13837,9 @@ } }, "node_modules/vite": { - "version": "5.0.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.11.tgz", - "integrity": "sha512-XBMnDjZcNAw/G1gEiskiM1v6yzM4GE5aMGvhWTlHAYYhxb7S3/V1s3m2LDHa8Vh6yIWYYB0iJwsEaS523c4oYA==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.12.tgz", + "integrity": "sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w==", "dev": true, "dependencies": { "esbuild": "^0.19.3", diff --git a/package.json b/package.json index 21d5e827..3920c240 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "ajv": "^8.12.0", "codemirror-wrapped-line-indent": "^1.0.0", "diff-sequences": "^29.6.3", - "immutable-json-patch": "6.0.0", + "immutable-json-patch": "6.0.1", "jmespath": "^0.16.0", "json-source-map": "^0.6.1", "jsonrepair": "^3.5.1", @@ -147,7 +147,7 @@ "svelte-check": "3.6.3", "svelte-preprocess": "5.1.3", "typescript": "5.3.3", - "vite": "5.0.11", + "vite": "5.0.12", "vitest": "1.2.1" } } diff --git a/src/lib/utils/typeUtils.ts b/src/lib/utils/typeUtils.ts index 6ab74aa8..5de7d061 100644 --- a/src/lib/utils/typeUtils.ts +++ b/src/lib/utils/typeUtils.ts @@ -9,7 +9,11 @@ import type { JSONParser } from '../types.js' export function isObject(value: unknown): value is Record { // note that we check constructor.name, not constructor === Object, // so we can use objects created in a different JS realm like an iframe. - return typeof value === 'object' && value !== null && value.constructor.name === 'Object' + return ( + typeof value === 'object' && + value !== null && + (value.constructor === undefined || value.constructor.name === 'Object') + ) } /** @@ -22,7 +26,9 @@ export function isObjectOrArray(value: unknown): value is Object | Array