Skip to main content
Module

x/valibot/mod.ts>requiredAsync

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

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

Type Parameters

TSchema extends ObjectSchema<any, any> | ObjectSchemaAsync<any, any>

Parameters

schema: TSchema

The affected schema.

optional
pipe: PipeAsync<ObjectOutput<Required<TSchema["entries"]>, undefined>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Required<TSchema["entries"]>>

An async object schema.

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

Type Parameters

TSchema extends ObjectSchema<any, any> | ObjectSchemaAsync<any, any>

Parameters

schema: TSchema

The affected schema.

optional
message: ErrorMessage

The error message.

optional
pipe: PipeAsync<ObjectOutput<Required<TSchema["entries"]>, undefined>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Required<TSchema["entries"]>>

An async object schema.

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

Type Parameters

TSchema extends ObjectSchema<any, any> | ObjectSchemaAsync<any, any>
TRest extends BaseSchema | BaseSchemaAsync | undefined

Parameters

schema: TSchema

The affected schema.

rest: TRest

The object rest.

optional
pipe: PipeAsync<ObjectOutput<Required<TSchema["entries"]>, TRest>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Required<TSchema["entries"]>, TRest>

An async object schema.

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

Type Parameters

TSchema extends ObjectSchema<any, any> | ObjectSchemaAsync<any, any>
TRest extends BaseSchema | BaseSchemaAsync | undefined

Parameters

schema: TSchema

The affected schema.

rest: TRest

The object rest.

optional
message: ErrorMessage

The error message.

optional
pipe: PipeAsync<ObjectOutput<Required<TSchema["entries"]>, TRest>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Required<TSchema["entries"]>, TRest>

An async object schema.