MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / findNode

Function findNode

frontend/layout/lib/layoutNode.ts:113–122  ·  view source on GitHub ↗
(node: LayoutNode, id: string)

Source from the content-addressed store, hash-verified

111 * @returns The node with the given id or undefined if no node with the given id was found.
112 */
113export function findNode(node: LayoutNode, id: string): LayoutNode | undefined {
114 if (!node) return;
115 if (node.id === id) return node;
116 if (!node.children) return;
117 for (const child of node.children) {
118 const result = findNode(child, id);
119 if (result) return result;
120 }
121 return;
122}
123
124/**
125 * Finds the node whose children contains the node with the given id.

Callers 10

constructorMethod · 0.90
focusNodeMethod · 0.90
closeNodeMethod · 0.90
onResizeMoveMethod · 0.90
computeMoveNodeFunction · 0.90
moveNodeFunction · 0.90
resizeNodeFunction · 0.90
splitHorizontalFunction · 0.90
splitVerticalFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected