11 lines
267 B
TypeScript
11 lines
267 B
TypeScript
export function makeCreateUrl(
|
|
path: string,
|
|
searchParams?: string | string[][] | Record<string, string>
|
|
) {
|
|
return function (route: string) {
|
|
if (searchParams) return `${path}${route}?${new URLSearchParams(searchParams)}`;
|
|
|
|
return path + route;
|
|
};
|
|
}
|