All files / utils leave.ts

0% Statements 0/3
0% Branches 0/2
0% Functions 0/1
0% Lines 0/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                   
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;
}