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

x/valibot/src/schemas/index.ts>enum_

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Latest
function enum_
import { enum_ } from "https://deno.land/x/valibot@v1.0.0-beta.1-i18n/src/schemas/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.