MCPcopy Create free account
hub / github.com/Effect-TS/effect / encodeDatePayload

Function encodeDatePayload

packages/effect/src/Schema.ts:8368–8373  ·  view source on GitHub ↗
(date: globalThis.Date)

Source from the content-addressed store, hash-verified

8366}
8367
8368function encodeDatePayload(date: globalThis.Date): string {
8369 if (globalThis.Number.isNaN(date.getTime())) {
8370 throw new globalThis.RangeError(`Expected a valid Date, got ${format(date)}`)
8371 }
8372 return date.toISOString()
8373}
8374
8375function formatDateRuntime(date: globalThis.Date): string {
8376 return `new Date(${format(date.getTime())})`

Callers 1

Schema.tsFile · 0.85

Calls 1

formatFunction · 0.90

Tested by

no test coverage detected