File tree Expand file tree Collapse file tree 4 files changed +20
-11
lines changed
fixtures/normalize-manifest/dangerous bin name
src/util/normalize-manifest Expand file tree Collapse file tree 4 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,12 @@ Array [
6262
6363exports [` dangerous bin name: dangerous bin name 1` ] = `
6464Array [
65+ "foo: Invalid bin entry for \\ ".\\ " (in \\ "foo\\ ").",
66+ "foo: Invalid bin entry for \\ "..\\ " (in \\ "foo\\ ").",
6567 "foo: Invalid bin entry for \\ "/tmp/foo\\ " (in \\ "foo\\ ").",
6668 "foo: Invalid bin entry for \\ "../tmp/foo\\ " (in \\ "foo\\ ").",
6769 "foo: Invalid bin entry for \\ "tmp/../../foo\\ " (in \\ "foo\\ ").",
70+ "foo: Invalid bin entry for \\ "build:cli\\ " (in \\ "foo\\ ").",
6871 "foo: No license field",
6972]
7073` ;
Original file line number Diff line number Diff line change 11{
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+ }
913}
Original file line number Diff line number Diff line change 11{
2- "name" : " foo" ,
3- "version" : " " ,
4- "bin" : {}
2+ "name" : " foo" ,
3+ "version" : " " ,
4+ "bin" : {
5+ "build.cli" : " main.js"
6+ }
57}
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const semver = require('semver');
1212const path = require ( 'path' ) ;
1313const url = require ( 'url' ) ;
1414
15- const VALID_BIN_KEYS = / ^ [ a - z 0 - 9 _ - ] + $ / i;
15+ const VALID_BIN_KEYS = / ^ (? ! \. { 0 , 2 } $ ) [ a - z 0 - 9 . _ - ] + $ / i;
1616
1717const LICENSE_RENAMES : { [ key : string ] : ?string } = {
1818 'MIT/X11' : 'MIT' ,
You can’t perform that action at this time.
0 commit comments