fix regexp

This commit is contained in:
Ivan Kopeykin 2022-02-04 18:12:20 +03:00
parent 93ad32423f
commit 5e1266362d
2 changed files with 2 additions and 1 deletions

View File

@ -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 */

View File

@ -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"],
[