Skip to content

Commit

Permalink
fix regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
vankop committed Feb 4, 2022
1 parent 93ad324 commit 5e12663
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/identifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ exports.absolutify = absolutify;

const PATH_QUERY_FRAGMENT_REGEXP =
/^((?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/;
const PATH_QUERY_REGEXP = /^((?:\0.|[^?#\0])*)(\?.*)?$/;
const PATH_QUERY_REGEXP = /^((?:\0.|[^?\0])*)(\?.*)?$/;

/** @typedef {{ resource: string, path: string, query: string, fragment: string }} ParsedResource */
/** @typedef {{ resource: string, path: string, query: string }} ParsedResourceWithoutFragment */
Expand Down
1 change: 1 addition & 0 deletions test/identifier.unittest.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ describe("util/identifier", () => {
// [input, expectedPath, expectedQuery]
/** @type {[string, string, string][]} */
const cases = [
["path#hash?query", "path#hash", "?query"],
["path?query#hash", "path", "?query#hash"],
["\0#path\0??\0#query#hash", "#path?", "?#query#hash"],
[
Expand Down

0 comments on commit 5e12663

Please sign in to comment.