All checks were successful
forgejo/Procyon/seedling/pipeline/head This commit looks good
Change-Id: I812c93e057039c0c6a8bea8079c8b9cda6357133
16 lines
364 B
TypeScript
16 lines
364 B
TypeScript
// @ts-nocheck
|
|
import { DotNestedKeys } from '@procyon/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;
|
|
};
|