Skip to content

@xtandard/lib/arktype

Branded TimeZone schema for ArkType (peer arktype).

import { … } from "@xtandard/lib/arktype";
Name Summary
asTimeZone Brand a string as a TimeZone. The one tolerated cast: a brand constructor — the caller guarantees the string was validated first (every TimeZoneSchema runs isValidTimeZone before calling this).
isValidTimeZone Whether timeZone is a valid IANA id (constructing Intl.DateTimeFormat throws for unknown zones). Dependency-free; every TimeZoneSchema runs it.
parseTimeZone Parse an unknown value as a TimeZone, throwing when it isn’t a valid IANA id. Shorthand for TimeZoneSchema.assert(input).
Name Summary
TimeZone An IANA time-zone id, validated via Intl — a nominal brand over string shared by every validator’s TimeZoneSchema.
Name Summary
TimeZoneSchema ArkType schema: validate an IANA id and brand it as TimeZone. The value is not canonicalized. It has no custom message, so failures read “must be valid according to an anonymous predicate”.