MCPcopy Index your code
hub / github.com/angular/angular / nodeChildrenAsMap

Function nodeChildrenAsMap

packages/router/src/utils/tree.ts:103–115  ·  view source on GitHub ↗
(
  node: TreeNode<T> | null,
)

Source from the content-addressed store, hash-verified

101
102// Return the list of T indexed by outlet name
103export function nodeChildrenAsMap<T extends {outlet: string}>(
104 node: TreeNode<T> | null,
105): {
106 [outlet: string]: TreeNode<T>;
107} {
108 const map: {[outlet: string]: TreeNode<T>} = {};
109
110 if (node) {
111 node.children.forEach((child) => (map[child.value.outlet] = child));
112 }
113
114 return map;
115}

Callers 6

getChildRouteGuardsFunction · 0.90
deactivateChildRoutesMethod · 0.90
activateChildRoutesMethod · 0.90

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…