Change URLs to use the JS URL constructor consistently across codebase.

Fixes #281
This commit is contained in:
zkldi
2021-08-13 03:20:14 +01:00
parent 89b45703d5
commit 02ee2ef002
4 changed files with 37 additions and 16 deletions
+9
View File
@@ -0,0 +1,9 @@
export function CreateURLWithParams(url: string, params: Record<string, string>) {
const u = new URL(url);
for (const key in params) {
u.searchParams.set(key, params[key]);
}
return u;
}