Skip to content

Commit 2893c1a

Browse files
committed
Don't allow @ in package names
1 parent a08d795 commit 2893c1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/utils/read-json.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ function processObject (opts, cb) { return function (er, json) {
7272
if (cb) return cb(e)
7373
throw e
7474
}
75-
if (json.name.charAt(0) === "." || json.name.match(/\//)) {
75+
if (json.name.charAt(0) === "." || json.name.match(/[\/@]/)) {
7676
var msg = "Invalid name: "
7777
+ JSON.stringify(json.name)
78-
+ " may not start with '.' or contain '/'"
78+
+ " may not start with '.' or contain '/' or '@'"
7979
, e = new Error(msg)
8080
if (cb) return cb(e)
8181
throw e

0 commit comments

Comments
 (0)