MCPcopy Create free account
hub / github.com/angular/angular / collectPaths

Function collectPaths

adev/src/app/routing/redirections.spec.ts:37–46  ·  view source on GitHub ↗
(items: NavigationItem[])

Source from the content-addressed store, hash-verified

35 it('should only redirect to paths that exist', () => {
36 const knownPaths = new Set<string>();
37 const collectPaths = (items: NavigationItem[]) => {
38 for (const item of items) {
39 if (item.path) {
40 knownPaths.add(item.path);
41 }
42 if (item.children) {
43 collectPaths(item.children);
44 }
45 }
46 };
47 collectPaths(ALL_ITEMS);
48 // Landing pages such as the playground are routed directly, not through the navigation.
49 for (const page of Object.values(DEFAULT_PAGES)) {

Callers 1

Calls 1

addMethod · 0.65

Tested by

no test coverage detected