Skip to content

@xtandard/lib/effect/v4

Branded TimeZone schema for Effect 4 (peer effect ^4). For effect 3 use @xtandard/lib/effect.

import { … } from "@xtandard/lib/effect/v4";
Name Summary
parseTimeZone Parse an unknown value as a TimeZone, throwing when it isn’t a valid IANA id. Shorthand for Schema.decodeUnknownSync(TimeZoneSchema)(input).
Name Summary
TimeZoneSchema Effect 4 schema: validate an IANA id and brand it as TimeZone. Fails with the message "Invalid IANA time zone". The value is not canonicalized. It is a two-way transformation: the encoded side is a plain string, so Schema.encodeSync gives the string back. For effect 3 use @xtandard/lib/effect.