@xtandard/lib/arktype
Branded TimeZone schema for ArkType (peer arktype).
import { … } from "@xtandard/lib/arktype";Functions
Section titled “Functions”| 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). |
Type aliases
Section titled “Type aliases”| Name | Summary |
|---|---|
TimeZone |
An IANA time-zone id, validated via Intl — a nominal brand over string shared by every validator’s TimeZoneSchema. |
Variables
Section titled “Variables”| 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”. |