(names: readonly string[])
| 525 | |
| 526 | /** A short English list that never hides its last member. */ |
| 527 | export function joinNames(names: readonly string[]): string { |
| 528 | if (names.length <= 1) { |
| 529 | return names[0] ?? ''; |
| 530 | } |
| 531 | if (names.length === 2) { |
| 532 | return `${names[0]} and ${names[1]}`; |
| 533 | } |
| 534 | return `${names.slice(0, -1).join(', ')}, and ${names[names.length - 1]}`; |
| 535 | } |
| 536 | |
| 537 | /** Lead-in to the clickable names. The only identifiers the narrative depth shows. */ |
| 538 | export const PROSE_CHIPS_LEAD = 'The parts it leans on, in the order they come up:'; |
no outgoing calls
no test coverage detected