All files / apps/portfolio/app/utils emphasis.ts

100% Statements 4/4
100% Branches 0/0
100% Functions 3/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  3x 76x   96x 96x  
/** Splits copy on `**` markers, so a few hand-picked words can be set in bold. */
export const emphasis = (text: string): { text: string; strong: boolean }[] =>
    text
        .split("**")
        .map((part, index) => ({ text: part, strong: index % 2 === 1 }))
        .filter((part) => part.text);