@prantlf/jsonlint 14.0.2 → 14.0.3

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/lib/jsonlint.js CHANGED
@@ -940,7 +940,11 @@ function parseNative (input, reviver) {
940
940
  try {
941
941
  return JSON.parse(input, reviver)
942
942
  } catch (error) {
943
- throw improveNativeError(input, error)
943
+ const newError = improveNativeError(input, error)
944
+ if (error.location) throw newError
945
+ // If the native error didn't contain location, parse once more
946
+ // by the custom parser, which always provides the error location.
947
+ return parseCustom (input, reviver)
944
948
  }
945
949
  }
946
950
  /* globals navigator, process, parseCustom, parseNative */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prantlf/jsonlint",
3
- "version": "14.0.2",
3
+ "version": "14.0.3",
4
4
  "description": "JSON/CJSON/JSON5 parser, syntax and schema validator and pretty-printer.",
5
5
  "author": "Ferdinand Prantl <prantlf@gmail.com> (http://prantl.tk)",
6
6
  "contributors": [
@@ -40,10 +40,10 @@
40
40
  },
41
41
  "scripts": {
42
42
  "build": "npm run compile:jsonlint && rollup -c && npm run minify && npm run compile:tests",
43
- "compile:jsonlint": "cat.js src/prefix.js.txt src/unicode.js src/custom-parser.js src/pointer.js src/native-parser.js src/configurable-parser.js src/suffix.js.txt > lib/jsonlint.js",
43
+ "compile:jsonlint": "cat-j src/prefix.js.txt src/unicode.js src/custom-parser.js src/pointer.js src/native-parser.js src/configurable-parser.js src/suffix.js.txt > lib/jsonlint.js",
44
44
  "minify": "esbuild --minify --sourcemap --outfile=web/jsonlint.min.js lib/jsonlint.js && esbuild --minify --sourcemap --outfile=web/validator.min.js lib/validator.js && esbuild --minify --sourcemap --outfile=web/formatter.min.js lib/formatter.js && esbuild --minify --sourcemap --outfile=web/sorter.min.js lib/sorter.js && esbuild --minify --sourcemap --outfile=web/printer.min.js lib/printer.js",
45
- "compile:tests": "tsc --moduleResolution node --module es2022 test/types.test.ts && mv.js test/types.test.js test/types.test.mjs",
46
- "test": "denolint && c8 node test/types.test.mjs && c8 --no-clean node test/parse1 && c8 --no-clean node test/parse1 --native-parser && c8 --no-clean node test/parse2 && c8 --no-clean node test/parse3 && c8 --no-clean node test/parse4 && c8 --no-clean node test/parse5 && c8 --no-clean node test/portable && c8 --no-clean node test/tokenize && c8 --no-clean node test/print && c8 --no-clean node lib/cli package.json test/recursive && c8 --no-clean node lib/cli -sq test/passes/hasOwnProperty.json && c8 --no-clean node lib/cli -s -e json-schema-draft-04 -V test/passes/schema-04.json test/passes/data-04.json && c8 --no-clean node lib/cli -s -e json-schema-draft-07 -V test/passes/schema-07.json test/passes/data-07.json && c8 --no-clean node lib/cli -C test/passes/comments.txt && c8 --no-clean node lib/cli -pS test/passes/strings.txt && c8 --no-clean node lib/cli -M json5 test/passes/json5.text && c8 --no-clean node lib/cli -v && c8 --no-clean node lib/cli -h && c8 --no-clean node lib/cli -Pc test/fails/10.json || c8 --no-clean node lib/cli -f test/.jsonrc.yml 'test/**/*.json' '!**/fails' && c8 report",
45
+ "compile:tests": "tsc --moduleResolution node --module es2022 test/types.test.ts && mv-j test/types.test.js test/types.test.mjs",
46
+ "test": "denolint && c8 node test/types.test.mjs && c8 --no-clean node test/parse1 && c8 --no-clean node test/parse1 --native-parser && c8 --no-clean node test/parse2 && c8 --no-clean node test/parse3 && c8 --no-clean node test/parse4 && c8 --no-clean node test/parse5 && c8 --no-clean node test/portable && c8 --no-clean node test/tokenize && c8 --no-clean node test/print && c8 --no-clean node lib/cli package.json test/recursive && c8 --no-clean node lib/cli -sq test/passes/hasOwnProperty.json && c8 --no-clean node lib/cli -s -e json-schema-draft-04 -V test/passes/schema-04.json test/passes/data-04.json && c8 --no-clean node lib/cli -s -e json-schema-draft-07 -V test/passes/schema-07.json test/passes/data-07.json && c8 --no-clean node lib/cli -C test/passes/comments.txt && c8 --no-clean node lib/cli -pS test/passes/strings.txt && c8 --no-clean node lib/cli -M json5 test/passes/json5.text && c8 --no-clean node lib/cli -v && c8 --no-clean node lib/cli -h && c8 --no-clean node lib/cli -Pc test/fails/10.json || c8 --no-clean node lib/cli -f test/.jsonrc.yml 'test/**/*.json' '!**/fails' && c8 report -r text -r lcov",
47
47
  "start": "http-server -c 5",
48
48
  "web": "npm run web:sync && npm run web:deploy",
49
49
  "web:clone": "test ! -d ../jsonlint-pages && git clone --single-branch --branch gh-pages `git remote get-url origin` ../jsonlint-pages",
@@ -52,10 +52,7 @@
52
52
  "web:deploy": "cd ../jsonlint-pages && git commit -a -m 'Deploy site updates' && git push origin gh-pages"
53
53
  },
54
54
  "c8": {
55
- "reporter": [
56
- "lcov",
57
- "text"
58
- ]
55
+ "reporter": []
59
56
  },
60
57
  "release": {
61
58
  "plugins": [
@@ -75,30 +72,30 @@
75
72
  "dependencies": {
76
73
  "ajv": "8.12.0",
77
74
  "ajv-draft-04": "1.0.0",
78
- "cosmiconfig": "8.1.0",
75
+ "cosmiconfig": "8.1.3",
79
76
  "diff": "5.1.0",
80
77
  "fast-glob": "3.2.12"
81
78
  },
82
79
  "devDependencies": {
83
- "@rollup/plugin-commonjs": "24.0.1",
80
+ "@rollup/plugin-commonjs": "24.1.0",
84
81
  "@rollup/plugin-json": "6.0.0",
85
- "@rollup/plugin-node-resolve": "15.0.1",
86
- "@semantic-release/changelog": "6.0.2",
82
+ "@rollup/plugin-node-resolve": "15.0.2",
83
+ "@semantic-release/changelog": "6.0.3",
87
84
  "@semantic-release/git": "10.0.1",
88
- "@types/node": "18.14.6",
89
- "@unixcompat/cat.js": "1.0.2",
90
- "@unixcompat/mv.js": "1.0.1",
85
+ "@types/node": "18.16.1",
86
+ "@unixcompat/cat.js": "2.0.0",
87
+ "@unixcompat/mv.js": "2.0.0",
91
88
  "c8": "7.13.0",
92
- "denolint": "2.0.7",
93
- "esbuild": "0.17.11",
89
+ "denolint": "2.0.9",
90
+ "esbuild": "0.17.18",
94
91
  "http-server": "14.1.1",
95
92
  "js-yaml": "4.1.0",
96
- "rollup": "3.18.0",
97
- "rollup-plugin-swc-minify": "1.0.5",
93
+ "rollup": "3.21.0",
94
+ "rollup-plugin-swc-minify": "1.0.6",
98
95
  "tehanu": "1.0.1",
99
96
  "tehanu-repo-coco": "1.0.0",
100
97
  "tehanu-teru": "1.0.0",
101
- "typescript": "4.9.5"
98
+ "typescript": "5.0.4"
102
99
  },
103
100
  "keywords": [
104
101
  "json",