(day: string)
| 43 | |
| 44 | /** Rejects both the wrong shape and impossible dates (`2026-02-31` round-trips as `2026-03-03`). */ |
| 45 | export function isValidDay(day: string): boolean { |
| 46 | if (!/^\d{4}-\d{2}-\d{2}$/.test(day)) return false; |
| 47 | const t = Date.parse(`${day}T00:00:00Z`); |
| 48 | return Number.isFinite(t) && utcDay(t) === day; |
| 49 | } |
| 50 | |
| 51 | /** Configured retention, clamped to something sane; falls back to the default. */ |
| 52 | export function retentionDays(env: Env): number { |
no test coverage detected