2023-09-09 16:55:38 +02:00
|
|
|
// @ts-nocheck
|
2023-11-16 11:43:48 +01:00
|
|
|
import { DotNestedKeys } from '@procyon/localization/types';
|
2023-09-09 16:55:38 +02:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|