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

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

The modular and type safe schema library for validating structural data 🤖
Go to Latest
function enum_
import { enum_ } from "https://deno.land/x/valibot@v0.1.0-to-json-schema/src/schemas/enum/enum.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.