All files / tracker/invocation stage-invocation.ts

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

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            5x     27x  
import type { Invocation, InvocationAtStage, InvocationStage } from './definition.ts';
 
type StageType = InvocationStage['type'];
 
export type AtStage<I extends Invocation, TStageType extends StageType> = I & InvocationAtStage<TStageType>;
 
export const isAtStage = <I extends Invocation, T extends StageType>(
  invocation: I | undefined,
  stage: T,
): invocation is AtStage<I, T> => invocation?.stage.type === stage;