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

Function validateNode

frontend/layout/lib/layoutNode.ts:145–156  ·  view source on GitHub ↗
(node: LayoutNode)

Source from the content-addressed store, hash-verified

143 * @returns True if the node is valid, false otherwise.
144 */
145export function validateNode(node: LayoutNode): boolean {
146 if (!node.children == !node.data) {
147 console.error("Either children or data must be defined for node, not both");
148 return false;
149 }
150
151 if (node.children?.length === 0) {
152 console.error("Node cannot define an empty array of children");
153 return false;
154 }
155 return true;
156}
157
158/**
159 * Recursively walk the layout tree starting at the specified node. Run the specified callbacks, if any.

Callers 2

newLayoutNodeFunction · 0.85
balanceNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected