Skip to content

Commit

Permalink
Merge pull request #244 from webpack/bugfix/hash-folder
Browse files Browse the repository at this point in the history
revert #folder handling
  • Loading branch information
sokra authored Sep 16, 2020
2 parents 151150f + 53fddeb commit 1916bf0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions lib/util/identifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const EMPTY = "";
* @returns {[string, string, string]|null} parsed identifier
*/
function parseIdentifier(identifier) {
const match = /^(#?(?:[/\\]#[^/\\?]|[^?#])*)(\?[^#]*)?(#.*)?$/.exec(
identifier
);
const match = /^(#?[^?#]*)(\?[^#]*)?(#.*)?$/.exec(identifier);

if (!match) return null;

Expand Down
12 changes: 6 additions & 6 deletions test/identifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ describe("parse identifier. edge cases", () => {
},
{
input: "path/#repo#hash",
expect: ["path/#repo", "", "#hash"]
expect: ["path/", "", "#repo#hash"]
},
{
input: "path/#r#hash",
expect: ["path/#r", "", "#hash"]
expect: ["path/", "", "#r#hash"]
},
{
input: "path/#repo/#repo2#hash",
expect: ["path/#repo/#repo2", "", "#hash"]
expect: ["path/", "", "#repo/#repo2#hash"]
},
{
input: "path/#r/#r#hash",
expect: ["path/#r/#r", "", "#hash"]
expect: ["path/", "", "#r/#r#hash"]
},
{
input: "path/#/not/a/hash?not-a-query",
Expand Down Expand Up @@ -77,11 +77,11 @@ describe("parse identifier. Windows-like paths", () => {
},
{
input: "path\\#repo#hash",
expect: ["path\\#repo", "", "#hash"]
expect: ["path\\", "", "#repo#hash"]
},
{
input: "path\\#r#hash",
expect: ["path\\#r", "", "#hash"]
expect: ["path\\", "", "#r#hash"]
},
{
input: "path\\#/not/a/hash?not-a-query",
Expand Down

0 comments on commit 1916bf0

Please sign in to comment.