forked from rollup/rollup
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Don't allow
:
in file names. (rollup#3972)"
This reverts commit 85304f2.
- Loading branch information
1 parent
a4a3b8a
commit 14c76de
Showing
16 changed files
with
34 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
export function sanitizeFileName(name: string): string { | ||
const match = /^[a-z]:/i.exec(name); | ||
const driveLetter = match ? match[0] : ""; | ||
|
||
// A `:` is only allowed as part of a windows drive letter (ex: C:\foo) | ||
// Otherwise, avoid them because they can refer to NTFS alternate data streams. | ||
return driveLetter + name.substr(driveLetter.length).replace(/[\0?*:]/g, '_'); | ||
return name.replace(/[\0?*]/g, '_'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/sanitize-chunk-names/_expected/amd/_virtual-entry-1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
define(function () { 'use strict'; | ||
|
||
var _virtualEntry1 = "\u0000virtual-entry-1"; | ||
|
||
return _virtualEntry1; | ||
|
||
}); |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/sanitize-chunk-names/_expected/amd/_virtual-entry-2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
define(function () { 'use strict'; | ||
|
||
var _virtualEntry2 = "\u0000virtual-entry-2"; | ||
|
||
return _virtualEntry2; | ||
|
||
}); |
7 changes: 0 additions & 7 deletions
7
test/chunking-form/samples/sanitize-chunk-names/_expected/amd/_virtual_entry-1.js
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
test/chunking-form/samples/sanitize-chunk-names/_expected/amd/_virtual_entry-2.js
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/_virtual-entry-1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
var _virtualEntry1 = "\u0000virtual-entry-1"; | ||
|
||
module.exports = _virtualEntry1; |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/_virtual-entry-2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
var _virtualEntry2 = "\u0000virtual-entry-2"; | ||
|
||
module.exports = _virtualEntry2; |
5 changes: 0 additions & 5 deletions
5
test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/_virtual_entry-1.js
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/_virtual_entry-2.js
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/sanitize-chunk-names/_expected/es/_virtual-entry-1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var _virtualEntry1 = "\u0000virtual-entry-1"; | ||
|
||
export default _virtualEntry1; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/sanitize-chunk-names/_expected/es/_virtual-entry-2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var _virtualEntry2 = "\u0000virtual-entry-2"; | ||
|
||
export default _virtualEntry2; |
3 changes: 0 additions & 3 deletions
3
test/chunking-form/samples/sanitize-chunk-names/_expected/es/_virtual_entry-1.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
test/chunking-form/samples/sanitize-chunk-names/_expected/es/_virtual_entry-2.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters