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

x/valibot/src/methods/index.ts>partialAsync

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

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

Type Parameters

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

Parameters

schema: TSchema

The affected schema.

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

A validation and transformation pipe.

Returns

An async object schema.

Creates an async object schema consisting of all properties of an existing object schema set to 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<PartialObjectEntriesAsync<TSchema["entries"]>, undefined>>

A validation and transformation pipe.

Returns

An async object schema.

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

Type Parameters

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

Parameters

schema: TSchema

The affected schema.

rest: TRest

The object rest.

A validation and transformation pipe.

Returns

An async object schema.

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

Type Parameters

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

Parameters

schema: TSchema

The affected schema.

rest: TRest

The object rest.

optional
message: ErrorMessage

The error message.

A validation and transformation pipe.

Returns

An async object schema.