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

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

The modular and type safe schema library for validating structural data 🤖
Latest
function literal
import { literal } from "https://deno.land/x/valibot@v1.0.0-beta.7/src/schemas/literal/index.ts";

Creates a literal schema.

Type Parameters

TLiteral extends Literal

Parameters

literal_: TLiteral

The literal value.

Returns

A literal schema.

Creates a literal schema.

Type Parameters

TLiteral extends Literal
TMessage extends ErrorMessage<LiteralIssue> | undefined

Parameters

literal_: TLiteral

The literal value.

message: TMessage

The error message.