Function: immediateDominator()
ts
function immediateDominator(
view: RawPlanView | PlanGraphView,
entryId: string,
nodeId: string,
): string | undefined;Defined in: src/batteries/orchestration/plan.ts:326
The immediate dominator of a node, relative to an entry.
Parameters
| Parameter | Type | Description |
|---|---|---|
view | | RawPlanView | PlanGraphView | The graph to search. |
entryId | string | The entry node id. |
nodeId | string | The node whose immediate dominator to find. |
Returns
string | undefined
The immediate dominator's id, or undefined when none exists.
Remarks
The standard iterative dominator algorithm (Cooper–Harvey–Kennedy). A node d dominates n when every path from entryId to n passes through d; the immediate dominator is the unique strict dominator closest to n. A join's FORK is its immediate dominator — which is what makes diamond joins decidable: the fork is known statically, so correlation and required are computable at freeze.
Returns undefined when nodeId is the entry itself (a node does not dominate itself in the immediate sense) or when nodeId is unreachable from entryId (no dominator exists).