(parent: LayoutNode, childToRemove: LayoutNode, startingIndex: number = 0)
| 98 | * @returns The updated parent node, or undefined if the node was not found. |
| 99 | */ |
| 100 | export 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. |
no outgoing calls
no test coverage detected