10 lines
290 B
TypeScript
10 lines
290 B
TypeScript
import type { PageProps } from '@/types/page';
|
|
|
|
export function makeCreateUrl(path: string, searchParams?: PageProps['searchParams']) {
|
|
return function (route: string) {
|
|
if (searchParams) return `${path}${route}?${new URLSearchParams(searchParams)}`;
|
|
|
|
return path + route;
|
|
};
|
|
}
|