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

x/valibot/mod.ts>instance

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

Creates an instance schema.

Type Parameters

TClass extends Class

Parameters

class_: TClass

The class of the instance.

optional
pipe: Pipe<InstanceType<TClass>>

A validation and transformation pipe.

Returns

InstanceSchema<TClass>

An instance schema.

Creates an instance schema.

Type Parameters

TClass extends Class

Parameters

class_: TClass

The class of the instance.

optional
message: ErrorMessage

The error message.

optional
pipe: Pipe<InstanceType<TClass>>

A validation and transformation pipe.

Returns

InstanceSchema<TClass>

An instance schema.