Skip to content

Function: getJobsInstructionName()

ts
function getJobsInstructionName(
  instruction
):
  | 'open'
  | 'list'
  | 'assign'
  | 'work'
  | 'complete'
  | 'finish'
  | 'quit'
  | 'stop'
  | 'extend'
  | 'delist'
  | 'close'
  | 'end'
  | undefined;

Identify a jobs instruction by matching its 8-byte Anchor discriminator.

Works on any raw Instruction regardless of how it was built, so it can identify instructions in a mixed batch. Returns undefined for instructions that are not recognised jobs instructions.

Parameters

ParameterTypeDescription
instructionInstructionThe instruction to identify.

Returns

| "open" | "list" | "assign" | "work" | "complete" | "finish" | "quit" | "stop" | "extend" | "delist" | "close" | "end" | undefined

The jobs instruction name, or undefined if unrecognised.