isSequentialInstructionPlan

function isSequentialInstructionPlan(
    plan,
): plan is Readonly<{
    divisible: boolean;
    kind: 'sequential';
    plans: InstructionPlan[];
    planType: 'instructionPlan';
}>;

Checks if the given instruction plan is a SequentialInstructionPlan.

Parameters

ParameterTypeDescription
planInstructionPlanThe instruction plan to check.

Returns

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

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

Example

const plan: InstructionPlan = sequentialInstructionPlan([instructionA, instructionB]);
 
if (isSequentialInstructionPlan(plan)) {
  console.log(plan.divisible); // TypeScript knows this is a SequentialInstructionPlan.
}

See

On this page