MCPcopy Create free account
hub / github.com/arktypeio/arktype / parseDate

Function parseDate

ark/type/keywords/functions.ts:87–91  ·  view source on GitHub ↗
(
	s: string,
	ctx: Traversal,
	says?: Says
)

Source from the content-addressed store, hash-verified

85)
86
87export const parseDate = (
88 s: string,
89 ctx: Traversal,
90 says?: Says
91): Date | ArkError => readDate(s) ?? ctx.error({ ...dateParseError, ...says })
92
93// a date that doesn't exist, like 2025-02-29, isn't an ISO 8601 date either
94const isoDateParseError = /* @__PURE__ */ keywordError(

Callers 2

date.test.tsFile · 0.85
parse.test.tsFile · 0.85

Calls 2

readDateFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected