We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f26d9b commit 72bb5adCopy full SHA for 72bb5ad
lib/util/url.ts
@@ -37,9 +37,9 @@ export function resolve(from: string, to: string) {
37
}
38
const resolved = resolvedUrl.toString() + endSpaces;
39
// if there is a #, we want to split on the first one only, and decode the part after
40
- if (resolved.indexOf("#") >= 0) {
41
- const [base, hash] = resolved.split(/#(.+)/);
42
- return base + "#" + decodeURIComponent(hash);
+ if (resolved.includes("#")) {
+ const [base, hash] = resolved.split("#", 2);
+ return base + "#" + decodeURIComponent(hash || "");
43
44
return resolved;
45
0 commit comments