(label: string, window: RateLimitWindowSummary | undefined, now: number)
| 134 | } |
| 135 | |
| 136 | function limitLine(label: string, window: RateLimitWindowSummary | undefined, now: number): string | undefined { |
| 137 | if (!window) return undefined |
| 138 | const remaining = formatRemaining(window) |
| 139 | const reset = formatReset(window.resetsAt || undefined, now) ?? "reset unknown" |
| 140 | return `${label.padEnd(9)} ${remaining} · ${reset} ` |
| 141 | } |
| 142 | |
| 143 | function formatRemaining(window: RateLimitWindowSummary): string { |
| 144 | if (typeof window.usedPercent !== "number") { |
no test coverage detected