Skip to content

API reference > @kontsedal/olas-devtools > insertNode

insertNode() function ​

Insert (or update) a node at path inside the tree. Auto-creates any missing intermediate ancestors as 'active' placeholders.

Returns a NEW tree object (immutable update).

Signature:

typescript
export declare function insertNode(root: ControllerNode, path: readonly string[], props: unknown, debug?: Record<string, unknown>): ControllerNode;

Parameters ​

Parameter

Type

Description

root

ControllerNode

path

readonly string[]

props

unknown

debug

Record<string, unknown>

(Optional)

Returns:

ControllerNode

Released under the MIT License.