Skip to main content

Function: matchesChild()

matchesChild(child, runtimeNodeId): boolean

Defined in: packages/core/src/types.ts:399

Does this runtime NodeContext.nodeId belong to this structural child?

The one rule that joins structure to liveness, kept here next to the member it reads so no consumer has to re-derive it. It is driven entirely by the edge tag — no primitive is named — which is what keeps a dev panel, a persistence layer, or anything else joining the two from growing a switch over primitives that a new one would silently fall through.

A repeat child is one node in the structure and many executions at runtime, so its nodeId is a stem and the runtime appends the ordinal. Every other edge addresses its child exactly once.

The bare stem matches too, and has to: it is the child's structural address — what getChildren() reports and what a consumer holds before any run has happened. Matching only iteration-1, iteration-2, … meant a loop body could be watched but never addressed, so an override aimed at it had nowhere to land until the loop had already run.

Parameters

child

ProcessableChild

runtimeNodeId

string

Returns

boolean