(n: number)
| 26 | } |
| 27 | |
| 28 | export function formatCount(n: number): string { |
| 29 | if (n >= 1_000_000) |
| 30 | return `${(n / 1_000_000).toFixed(1).replace(/\.0$/, "")}M`; |
| 31 | if (n >= 1_000) return `${(n / 1_000).toFixed(1).replace(/\.0$/, "")}k`; |
| 32 | return String(n); |
| 33 | } |
| 34 | |
| 35 | export function generateNameAbbr(name: string): string { |
| 36 | const firstCharRegex = /[\p{L}]/u; |
no outgoing calls
no test coverage detected