Module

x/zod/mod.ts>ZodEnum

TypeScript-first schema validation with static type inference
Extremely Popular
Go to Latest
class ZodEnum
extends ZodType<T[number], ZodEnumDef<T>>
import { ZodEnum } from "https://dotland.deno.dev/x/zod@v3.22.2/mod.ts";

Type Parameters

T extends [string, ...string[]]

Properties

readonly
enum: Values<T>
readonly
Enum: Values<T>
readonly
options
readonly
Values: Values<T>

Methods

_parse(input: ParseInput): ParseReturnType<this["_output"]>
exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>
extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract): ZodEnum<Writeable<ToExtract>>