seedling/source/ui/src/app/routes.ts
Roman Jaroš 5246efb027 Add API monorepo
Change-Id: I39aa1707744bb86c4bc9113157bbf815bb3fe33a
2023-09-10 22:25:09 +02:00

16 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;
};