Function: findNodeById()
Call Signature
findNodeById<
T>(root,id):T|undefined
Defined in: src/Mnemonic/structural-migrations.ts:74
Finds the first node with the requested id using depth-first traversal.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends StructuralNode<T> | Tree node type (must extend { id: string; children?: readonly T[] } when helpers is omitted) |
Parameters
| Parameter | Type | Description |
|---|---|---|
root | T | Root node to search |
id | string | Target node id |
Returns
T | undefined
The matching node, or undefined
Call Signature
findNodeById<
T>(root,id,helpers):T|undefined
Defined in: src/Mnemonic/structural-migrations.ts:84
Finds the first node with the requested id using depth-first traversal.
Type Parameters
| Type Parameter | Description |
|---|---|
T | Tree node type |
Parameters
| Parameter | Type | Description |
|---|---|---|
root | T | Root node to search |
id | string | Target node id |
helpers | StructuralTreeHelpers<T> | Adapter for custom node shapes |
Returns
T | undefined
The matching node, or undefined