Skip to content

Commit 1916bf0

Browse files
authored
Merge pull request #244 from webpack/bugfix/hash-folder
revert #folder handling
2 parents 151150f + 53fddeb commit 1916bf0

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

lib/util/identifier.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ const EMPTY = "";
1212
* @returns {[string, string, string]|null} parsed identifier
1313
*/
1414
function parseIdentifier(identifier) {
15-
const match = /^(#?(?:[/\\]#[^/\\?]|[^?#])*)(\?[^#]*)?(#.*)?$/.exec(
16-
identifier
17-
);
15+
const match = /^(#?[^?#]*)(\?[^#]*)?(#.*)?$/.exec(identifier);
1816

1917
if (!match) return null;
2018

test/identifier.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ describe("parse identifier. edge cases", () => {
3737
},
3838
{
3939
input: "path/#repo#hash",
40-
expect: ["path/#repo", "", "#hash"]
40+
expect: ["path/", "", "#repo#hash"]
4141
},
4242
{
4343
input: "path/#r#hash",
44-
expect: ["path/#r", "", "#hash"]
44+
expect: ["path/", "", "#r#hash"]
4545
},
4646
{
4747
input: "path/#repo/#repo2#hash",
48-
expect: ["path/#repo/#repo2", "", "#hash"]
48+
expect: ["path/", "", "#repo/#repo2#hash"]
4949
},
5050
{
5151
input: "path/#r/#r#hash",
52-
expect: ["path/#r/#r", "", "#hash"]
52+
expect: ["path/", "", "#r/#r#hash"]
5353
},
5454
{
5555
input: "path/#/not/a/hash?not-a-query",
@@ -77,11 +77,11 @@ describe("parse identifier. Windows-like paths", () => {
7777
},
7878
{
7979
input: "path\\#repo#hash",
80-
expect: ["path\\#repo", "", "#hash"]
80+
expect: ["path\\", "", "#repo#hash"]
8181
},
8282
{
8383
input: "path\\#r#hash",
84-
expect: ["path\\#r", "", "#hash"]
84+
expect: ["path\\", "", "#r#hash"]
8585
},
8686
{
8787
input: "path\\#/not/a/hash?not-a-query",

0 commit comments

Comments
 (0)