All files / apps/developer-portal/layers/audits/app/utils format.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 2/2
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 16 17 18 19      2x           5x   2x           5x  
import type { AuditState, FindingStatus } from "#layers/snapshot/shared/audits.ts";
import type { Tone } from "~/types/Tone";
 
const FINDING_STATUS_TONES = {
    open: "warn",
    fixed: "good",
    "wont-fix": "neutral",
} as const satisfies Record<FindingStatus, Tone>;
 
export const findingStatusTone = (status: FindingStatus): Tone => FINDING_STATUS_TONES[status];
 
const AUDIT_STATE_TONES = {
    open: "warn",
    "in-progress": "warn",
    closed: "good",
} as const satisfies Record<AuditState, Tone>;
 
export const auditStateTone = (state: AuditState): Tone => AUDIT_STATE_TONES[state];