All files / src/clarity/types booleanCV.ts

90% Statements 9/10
0% Branches 0/2
66.66% Functions 2/3
100% Lines 4/4

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 1621x                       63x 37x 21x  
import { ClarityType } from '../common/constants';
 
export type BooleanCV = TrueCV | FalseCV;
 
export interface TrueCV {
  type: ClarityType.BoolTrue;
}
 
export interface FalseCV {
  type: ClarityType.BoolFalse;
}
 
export const trueCV = (): BooleanCV => ({ type: ClarityType.BoolTrue });
export const falseCV = (): BooleanCV => ({ type: ClarityType.BoolFalse });
export const boolCV = (value: boolean): BooleanCV => (value ? trueCV() : falseCV());