We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5db51d8 commit fb49854Copy full SHA for fb49854
lib/util/url.ts
@@ -28,14 +28,13 @@ export const parse = (u: string | URL) => new URL(u);
28
export function resolve(from: string, to: string) {
29
const fromUrl = new URL(convertPathToPosix(from), "resolve://");
30
const resolvedUrl = new URL(convertPathToPosix(to), fromUrl);
31
+ const endSpaces = to.match(/(\s*)$/)?.[1] || "";
32
if (resolvedUrl.protocol === "resolve:") {
33
// `from` is a relative URL.
34
const { pathname, search, hash } = resolvedUrl;
- const endSpaces = to.match(/(\s*)$/)?.[1] || "";
35
-
36
return pathname + search + hash + endSpaces;
37
}
38
- return resolvedUrl.toString();
+ return resolvedUrl.toString() + endSpaces;
39
40
41
/**
0 commit comments