File tree 4 files changed +20
-11
lines changed
fixtures/normalize-manifest/dangerous bin name
src/util/normalize-manifest
4 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,12 @@ Array [
62
62
63
63
exports [` dangerous bin name: dangerous bin name 1` ] = `
64
64
Array [
65
+ "foo: Invalid bin entry for \\ ".\\ " (in \\ "foo\\ ").",
66
+ "foo: Invalid bin entry for \\ "..\\ " (in \\ "foo\\ ").",
65
67
"foo: Invalid bin entry for \\ "/tmp/foo\\ " (in \\ "foo\\ ").",
66
68
"foo: Invalid bin entry for \\ "../tmp/foo\\ " (in \\ "foo\\ ").",
67
69
"foo: Invalid bin entry for \\ "tmp/../../foo\\ " (in \\ "foo\\ ").",
70
+ "foo: Invalid bin entry for \\ "build:cli\\ " (in \\ "foo\\ ").",
68
71
"foo: No license field",
69
72
]
70
73
` ;
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " foo" ,
3
- "version" : " " ,
4
- "bin" : {
5
- "/tmp/foo" : " main.js" ,
6
- "../tmp/foo" : " main.js" ,
7
- "tmp/../../foo" : " main.js"
8
- }
2
+ "name" : " foo" ,
3
+ "version" : " " ,
4
+ "bin" : {
5
+ "." : " main.js" ,
6
+ ".." : " main.js" ,
7
+ "/tmp/foo" : " main.js" ,
8
+ "../tmp/foo" : " main.js" ,
9
+ "tmp/../../foo" : " main.js" ,
10
+ "build:cli" : " main.js" ,
11
+ "build.cli" : " main.js"
12
+ }
9
13
}
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " foo" ,
3
- "version" : " " ,
4
- "bin" : {}
2
+ "name" : " foo" ,
3
+ "version" : " " ,
4
+ "bin" : {
5
+ "build.cli" : " main.js"
6
+ }
5
7
}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const semver = require('semver');
12
12
const path = require ( 'path' ) ;
13
13
const url = require ( 'url' ) ;
14
14
15
- const VALID_BIN_KEYS = / ^ [ a - z 0 - 9 _ - ] + $ / i;
15
+ const VALID_BIN_KEYS = / ^ (? ! \. { 0 , 2 } $ ) [ a - z 0 - 9 . _ - ] + $ / i;
16
16
17
17
const LICENSE_RENAMES : { [ key : string ] : ?string } = {
18
18
'MIT/X11' : 'MIT' ,
You can’t perform that action at this time.
0 commit comments