fix import

This commit is contained in:
Niels Lyngsø
2023-04-12 09:35:05 +02:00
parent 114c2e5d57
commit 2a98c8576f

View File

@@ -0,0 +1,12 @@
import { stripSlash } from 'router-slot/util';
const PARAM_IDENTIFIER = /:([^\\/]+)/g;
export function generateRoutePathBuilder(path: string) {
return (params: { [key: string]: string | number }) =>
stripSlash(
path.replace(PARAM_IDENTIFIER, (substring: string, ...args: string[]) => {
return params[args[0]].toString();
})
);
}