Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/valibot/mod.ts>EnumSchema

The modular and type safe schema library for validating structural data 🤖
Latest
interface EnumSchema
implements BaseSchema<TEnum[keyof TEnum], TEnum[keyof TEnum], EnumIssue>
import { type EnumSchema } from "https://deno.land/x/valibot@v1.0.0-beta.5/mod.ts";

Enum schema type.

Type Parameters

TEnum extends Enum
TMessage extends ErrorMessage<EnumIssue> | undefined

Properties

readonly
type: "enum"

The schema type.

readonly
reference: enum_

The schema reference.

readonly
enum: TEnum

The enum object.

readonly
options: TEnum[keyof TEnum][]

The enum options.

readonly
message: TMessage

The error message.