seedling/source/ui/src/app/routes.ts

17 lines
364 B
TypeScript
Raw Normal View History

// @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;
};