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

x/valibot/src/index.ts>enum_

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Go to Latest
function enum_
import { enum_ } from "https://deno.land/x/valibot@v0.35.0/src/index.ts";

Creates an enum schema.

Type Parameters

TEnum extends Enum

Parameters

enum__: TEnum

The enum object.

Returns

EnumSchema<TEnum, undefined>

An enum schema.

Creates an enum schema.

Type Parameters

TEnum extends Enum
TMessage extends ErrorMessage<EnumIssue> | undefined

Parameters

enum__: TEnum

The enum object.

message: TMessage

The error message.

Returns

An enum schema.