(n: number)
| 17 | |
| 18 | /** Compact star count, e.g. 1234 -> "1.2k". */ |
| 19 | export function formatStars(n: number): string { |
| 20 | return n >= 1000 ? `${(n / 1000).toFixed(1).replace(/\.0$/, "")}k` : String(n); |
| 21 | } |
| 22 | |
| 23 | const TTL_OK_MS = 30 * 60 * 1000; // cache a real count for ~30 min per isolate |
| 24 | const TTL_FAIL_MS = 60 * 1000; // but retry soon after a miss, never pin a null |