All files / command command.interface.ts

100% Statements 3/3
100% Branches 3/3
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191x                             1x 7x    
export const commandKeywords = [
  'pause',
  'goto',
  'terminate',
  'resume',
  'debug'
];
 
export interface Command {
  keyword: (typeof commandKeywords)[number];
  id: string; // a unique id for each command, to make sure each one get only performed once (even in polling mode)
  arguments: string[];
  timestamp?: number;
}
 
export function isCommand(arg: any): arg is Command {
  return (arg.keyword !== undefined) && (arg.id !== undefined) && (arg.arguments !== undefined);
}