I am currently working with a standard router setup.
type Routes = '/' | '/achievements' | ... ;
This helps in identifying the routers present in the project. However, I am faced with a new challenge of creating an array that includes all the routers.
const allRoutes: Routes[] = ['/', '/achievements'];
If any router is missing from this array, it should trigger an error. The array must always encompass all available routers. Is there a way to achieve this?
I am stuck on how to enforce the array to contain every single router specified in the enumeration.
UPDATE
The types are defined in the d.ts file, which makes it impossible for me to use the construct
const ROUTES = ['/', '/achievements'] as const
and export it from there