MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / removeChild

Function removeChild

frontend/layout/lib/layoutNode.ts:100–105  ·  view source on GitHub ↗
(parent: LayoutNode, childToRemove: LayoutNode, startingIndex: number = 0)

Source from the content-addressed store, hash-verified

98 * @returns The updated parent node, or undefined if the node was not found.
99 */
100export function removeChild(parent: LayoutNode, childToRemove: LayoutNode, startingIndex: number = 0) {
101 if (!parent.children) return;
102 const idx = parent.children.indexOf(childToRemove, startingIndex);
103 if (idx === -1) return;
104 parent.children?.splice(idx, 1);
105}
106
107/**
108 * Finds the node with the given id.

Callers 2

moveNodeFunction · 0.90
deleteNodeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected