isParallelInstructionPlan

function isParallelInstructionPlan(
    plan,
): plan is Readonly<{
    kind: 'parallel';
    plans: InstructionPlan[];
    planType: 'instructionPlan';
}>;

Checks if the given instruction plan is a ParallelInstructionPlan.

Parameters

ParameterTypeDescription
planInstructionPlanThe instruction plan to check.

Returns

plan is Readonly<{ kind: "parallel"; plans: InstructionPlan[]; planType: "instructionPlan" }>

true if the plan is a parallel instruction plan, false otherwise.

Example

const plan: InstructionPlan = parallelInstructionPlan([instructionA, instructionB]);
 
if (isParallelInstructionPlan(plan)) {
  console.log(plan.plans.length); // TypeScript knows this is a ParallelInstructionPlan.
}

See

On this page