(day: string)
| 57 | |
| 58 | /** Rejects both the wrong shape and impossible dates (`2026-02-31` round-trips as `2026-03-03`). */ |
| 59 | export function isValidDay(day: string): boolean { |
| 60 | if (!/^\d{4}-\d{2}-\d{2}$/.test(day)) return false; |
| 61 | const t = Date.parse(`${day}T00:00:00Z`); |
| 62 | return Number.isFinite(t) && utcDay(t) === day; |
| 63 | } |
| 64 | |
| 65 | /** Configured retention, clamped to something sane; falls back to the default. */ |
| 66 | export function retentionDays(env: Env): number { |
no test coverage detected