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
Latest
function required
import { required } from "https://deno.land/x/valibot@v1.0.0-beta.1-i18n/src/methods/required/required.ts";

Creates a modified copy of an object schema that marks all entries as required.

Type Parameters

TSchema extends Schema

Parameters

schema: TSchema

The schema to modify.

Returns

SchemaWithRequired<TSchema, undefined, undefined>

An object schema.

Creates a modified copy of an object schema that marks all entries as required.

Type Parameters

TSchema extends Schema
TMessage extends ErrorMessage<NonOptionalIssue> | undefined

Parameters

schema: TSchema

The schema to modify.

message: TMessage

The error message.

Returns

An object schema.

Creates a modified copy of an object schema that marks the selected entries as required.

Type Parameters

TSchema extends Schema
TKeys extends ObjectKeys<TSchema>

Parameters

schema: TSchema

The schema to modify.

keys: TKeys

The selected entries.

Returns

An object schema.

Creates a modified copy of an object schema that marks the selected entries as required.

Type Parameters

TSchema extends Schema
TKeys extends ObjectKeys<TSchema>
TMessage extends ErrorMessage<NonOptionalIssue> | undefined

Parameters

schema: TSchema

The schema to modify.

keys: TKeys

The selected entries.

message: TMessage

The error message.