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

x/valibot/src/methods/required/required.ts>required

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

Creates an object schema consisting of all properties of an existing object schema set to none optional.

Type Parameters

TObjectSchema extends ObjectSchema<any>

Parameters

The affected scheme.

optional
pipe: Pipe<ObjectOutput<Required<TObjectSchema["object"]>>>

A validation and transformation pipe.

Returns

ObjectSchema<Required<TObjectSchema["object"]>>

An object schema.

Creates an object schema consisting of all properties of an existing object schema set to none optional.

Type Parameters

TObjectSchema extends ObjectSchema<any>

Parameters

The affected scheme.

optional
error: string

The error message.

optional
pipe: Pipe<ObjectOutput<Required<TObjectSchema["object"]>>>

A validation and transformation pipe.

Returns

ObjectSchema<Required<TObjectSchema["object"]>>

An object schema.