Skip to content

Commit

Permalink
package-lock: Added a warning for invalid pkglock JSON (npm#19629)
Browse files Browse the repository at this point in the history
* Used json-parse-better-errors in parse-json.js

* Added json-parse-better-errors to bundleDependencies

PR-URL: npm#19629
Credit: @JoshuaKGoldberg
Reviewed-By: @zkat
  • Loading branch information
Josh Goldberg authored and zkat committed Mar 8, 2018
1 parent 0465009 commit fc8761d
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/utils/parse-json.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'
var parseJsonWithErrors = require('json-parse-better-errors')
var parseJSON = module.exports = function (content) {
return JSON.parse(stripBOM(content))
return parseJsonWithErrors(stripBOM(content))
}

parseJSON.noExceptions = function (content) {
Expand Down
36 changes: 36 additions & 0 deletions node_modules/json-parse-better-errors/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/json-parse-better-errors/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions node_modules/json-parse-better-errors/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions node_modules/json-parse-better-errors/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions node_modules/json-parse-better-errors/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"ini": "^1.3.5",
"init-package-json": "^1.10.3",
"is-cidr": "~1.0.0",
"json-parse-better-errors": "^1.0.1",
"lazy-property": "~1.0.0",
"libcipm": "^1.6.0",
"libnpx": "^10.0.1",
Expand Down Expand Up @@ -168,6 +169,7 @@
"ini",
"init-package-json",
"is-cidr",
"json-parse-better-errors",
"JSONStream",
"lazy-property",
"libcipm",
Expand Down

0 comments on commit fc8761d

Please sign in to comment.