All files / utils leave.ts

100% Statements 3/3
50% Branches 1/2
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        9x   25x 25x    
import type { LeaveType } from "@/lib/db/schema";
import {
  LEAVE_TYPE_FALLBACK_LABEL,
  LEAVE_TYPE_LABEL_BY_TYPE,
} from "@/constants/leave";
 
export function leaveTypeLabel(value: LeaveType | string): string {
  return LEAVE_TYPE_LABEL_BY_TYPE[value as keyof typeof LEAVE_TYPE_LABEL_BY_TYPE] ?? LEAVE_TYPE_FALLBACK_LABEL;
}