MCPcopy Index your code
hub / github.com/angular/angular-cli / traverse

Method traverse

packages/angular/ssr/src/routes/route-tree.ts:191–201  ·  view source on GitHub ↗

* A generator function that recursively traverses the route tree and yields the metadata of each node. * This allows for easy and efficient iteration over all nodes in the tree. * * @param node - The current node to start the traversal from. Defaults to the root node of the tree.

(
    node: RouteTreeNode<AdditionalMetadata> = this.root,
  )

Source from the content-addressed store, hash-verified

189 * @param node - The current node to start the traversal from. Defaults to the root node of the tree.
190 */
191 *traverse(
192 node: RouteTreeNode<AdditionalMetadata> = this.root,
193 ): Generator<RouteTreeNodeMetadata & AdditionalMetadata> {
194 if (node.metadata) {
195 yield node.metadata;
196 }
197
198 for (const childNode of node.children.values()) {
199 yield* this.traverse(childNode);
200 }
201 }
202
203 /**
204 * Extracts the path segments from a given route string.

Callers 3

toObjectMethod · 0.95
traverseRoutesConfigFunction · 0.80

Calls 1

valuesMethod · 0.45

Tested by

no test coverage detected