mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-30 19:07:58 +03:00
12 lines
242 B
TypeScript
12 lines
242 B
TypeScript
import { URL } from "url";
|
|
|
|
export function CreateURLWithParams(url: string, params: Record<string, string>) {
|
|
const u = new URL(url);
|
|
|
|
for (const [key, value] of Object.entries(params)) {
|
|
u.searchParams.set(key, value);
|
|
}
|
|
|
|
return u;
|
|
}
|