MCPcopy
hub / github.com/angular/angular / checkRoutes

Function checkRoutes

adev/src/app/routing/redirections.spec.ts:14–27  ·  view source on GitHub ↗
(routes: Route[])

Source from the content-addressed store, hash-verified

12describe('REDIRECT_ROUTES', () => {
13 it('should have all redirectTo values starting with a "/"', () => {
14 const checkRoutes = (routes: Route[]) => {
15 for (const route of routes) {
16 if (route.redirectTo) {
17 if (typeof route.redirectTo === 'string') {
18 expect(route.redirectTo.startsWith('/'))
19 .withContext(`Invalid redirectTo: ${route.redirectTo}`)
20 .toBe(true);
21 }
22 }
23 if (route.children) {
24 checkRoutes(route.children);
25 }
26 }
27 };
28
29 checkRoutes(REDIRECT_ROUTES);
30 });

Callers 1

Calls 1

withContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…