MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / isValidDay

Function isValidDay

telemetry-worker/src/rollup.ts:45–49  ·  view source on GitHub ↗
(day: string)

Source from the content-addressed store, hash-verified

43
44/** Rejects both the wrong shape and impossible dates (`2026-02-31` round-trips as `2026-03-03`). */
45export 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. */
52export function retentionDays(env: Env): number {

Callers 1

handleAdminRollupFunction · 0.70

Calls 1

utcDayFunction · 0.70

Tested by

no test coverage detected