diff --git a/package-lock.json b/package-lock.json index 7f81d1bc..b384f9f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "jmespath": "^0.16.0", "json-source-map": "^0.6.1", "jsonpath-plus": "^9.0.0 || ^10.1.0", - "jsonrepair": "3.8.0", + "jsonrepair": "3.9.0", "lodash-es": "^4.17.21", "memoize-one": "^6.0.0", "natural-compare-lite": "^1.4.0", @@ -10136,9 +10136,9 @@ } }, "node_modules/jsonrepair": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/jsonrepair/-/jsonrepair-3.8.0.tgz", - "integrity": "sha512-89lrxpwp+IEcJ6kwglF0HH3Tl17J08JEpYfXnvvjdp4zV4rjSoGu2NdQHxBs7yTOk3ETjTn9du48pBy8iBqj1w==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/jsonrepair/-/jsonrepair-3.9.0.tgz", + "integrity": "sha512-gC8z8NP6gEh/9DwDFl8G8nr6KSxdUQBhjTyCq+aZy1mT8DxZf9/V1947MztjLDCdnsn8VjoXj0b2R4HGJdEo7A==", "license": "ISC", "bin": { "jsonrepair": "bin/cli.js" diff --git a/package.json b/package.json index 3fdaa65c..2e23b5bb 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "jmespath": "^0.16.0", "json-source-map": "^0.6.1", "jsonpath-plus": "^9.0.0 || ^10.1.0", - "jsonrepair": "3.8.0", + "jsonrepair": "^3.9.0", "lodash-es": "^4.17.21", "memoize-one": "^6.0.0", "natural-compare-lite": "^1.4.0", diff --git a/src/lib/utils/jsonUtils.ts b/src/lib/utils/jsonUtils.ts index 175037e3..e3fb39d5 100644 --- a/src/lib/utils/jsonUtils.ts +++ b/src/lib/utils/jsonUtils.ts @@ -58,13 +58,13 @@ export function parsePartialJson(partialJson: string, parse: (text: string) => u } try { - return parse('[' + partialJson + ']') + return parse('{' + partialJson + '}') } catch { // we ignore the error on purpose } try { - return parse('{' + partialJson + '}') + return parse('[' + partialJson + ']') } catch { // we ignore the error on purpose }