The plural word for one card kind, so a cap note reads like a sentence.
(kind: CardKind, count: number)
| 665 | |
| 666 | /** The plural word for one card kind, so a cap note reads like a sentence. */ |
| 667 | function labelOf(kind: CardKind, count: number): string { |
| 668 | const singular: Record<CardKind, string> = { |
| 669 | subject: 'subject fact', |
| 670 | calls: 'call list', |
| 671 | raises: 'error fact', |
| 672 | caller: 'caller', |
| 673 | callee: 'callee', |
| 674 | route: 'route', |
| 675 | entry: 'entry point list', |
| 676 | overview: 'overview fact', |
| 677 | compare: 'comparison', |
| 678 | observed: 'observation', |
| 679 | absence: 'note', |
| 680 | }; |
| 681 | const word = singular[kind]; |
| 682 | return count === 1 ? word : `${word}s`; |
| 683 | } |