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

x/valibot/src/index.ts>requiredAsync

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

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

Type Parameters

TObjectSchema extends ObjectSchema<any> | ObjectSchemaAsync<any>

Parameters

The affected schema.

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

A validation and transformation pipe.

Returns

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

An async object schema.

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

Type Parameters

TObjectSchema extends ObjectSchema<any> | ObjectSchemaAsync<any>

Parameters

The affected schema.

optional
error: ErrorMessage

The error message.

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

A validation and transformation pipe.

Returns

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

An async object schema.