Skip to content
1 min read · 126 words

Function: reachableFrom()

ts
function reachableFrom(
  view: RawPlanView | PlanGraphView,
  startId: string,
): Set<string>;

Defined in: src/batteries/orchestration/plan.ts:168

The forward closure from a start node over ALL edge handles.

Parameters

ParameterTypeDescription
view| RawPlanView | PlanGraphViewThe graph to search.
startIdstringThe node to start from.

Returns

Set<string>

The set of node ids reachable from startId, including startId itself.

Remarks

error and default edges are included: a node reachable only over an error edge is still reachable, because the executor can still execute it. The closure is the set of nodes reachable by following any outgoing edge transitively. The start node itself is included. A node with no outgoing edges contributes nothing further.