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

Function findNode

packages/router/src/utils/tree.ts:65–74  ·  view source on GitHub ↗
(value: T, node: TreeNode<T>)

Source from the content-addressed store, hash-verified

63
64// DFS for the node matching the value
65function findNode<T>(value: T, node: TreeNode<T>): TreeNode<T> | null {
66 if (value === node.value) return node;
67
68 for (const child of node.children) {
69 const node = findNode(value, child);
70 if (node) return node;
71 }
72
73 return null;
74}
75
76// Return the path to the node with the given value using DFS
77function findPath<T>(value: T, node: TreeNode<T>): TreeNode<T>[] {

Callers 2

childrenMethod · 0.85
firstChildMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…