17 lines
364 B
TypeScript
17 lines
364 B
TypeScript
|
// @ts-nocheck
|
||
|
import { DotNestedKeys } from '@prokyon/localization/types';
|
||
|
|
||
|
export const Routes = {
|
||
|
root: '/'
|
||
|
};
|
||
|
|
||
|
export const buildRoute = (route: DotNestedKeys<typeof Routes>) => {
|
||
|
let path = '';
|
||
|
let obj: Record<string, any> = Routes;
|
||
|
route.split('.').forEach((key: any) => {
|
||
|
path += obj[key]?.base ?? obj[key];
|
||
|
obj = obj[key];
|
||
|
});
|
||
|
return path;
|
||
|
};
|