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

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

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