isMessagePackerInstructionPlan

function isMessagePackerInstructionPlan(
    plan,
): plan is Readonly<{
    getMessagePacker: () => MessagePacker;
    kind: 'messagePacker';
    planType: 'instructionPlan';
}>;

Checks if the given instruction plan is a MessagePackerInstructionPlan.

Parameters

ParameterTypeDescription
planInstructionPlanThe instruction plan to check.

Returns

plan is Readonly<{ getMessagePacker: () => MessagePacker; kind: "messagePacker"; planType: "instructionPlan" }>

true if the plan is a message packer instruction plan, false otherwise.

Example

const plan: InstructionPlan = getLinearMessagePackerInstructionPlan({ /* ... */ });
 
if (isMessagePackerInstructionPlan(plan)) {
  const packer = plan.getMessagePacker(); // TypeScript knows this is a MessagePackerInstructionPlan.
}

See

On this page