Skip to main content
Module

x/valibot/mod.ts>partial

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

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

Type Parameters

TSchema extends ObjectSchema<any, any>

Parameters

schema: TSchema

The affected schema.

optional
pipe: Pipe<ObjectOutput<PartialObjectEntries<TSchema["entries"]>, undefined>>

A validation and transformation pipe.

Returns

An object schema.

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

Type Parameters

TSchema extends ObjectSchema<any, any>

Parameters

schema: TSchema

The affected schema.

optional
message: ErrorMessage

The error message.

optional
pipe: Pipe<ObjectOutput<PartialObjectEntries<TSchema["entries"]>, undefined>>

A validation and transformation pipe.

Returns

An object schema.

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

Type Parameters

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

Parameters

schema: TSchema

The affected schema.

rest: TRest

The object rest.

optional
pipe: Pipe<ObjectOutput<PartialObjectEntries<TSchema["entries"]>, TRest>>

A validation and transformation pipe.

Returns

An object schema.

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

Type Parameters

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

Parameters

schema: TSchema

The affected schema.

rest: TRest

The object rest.

optional
message: ErrorMessage

The error message.

optional
pipe: Pipe<ObjectOutput<PartialObjectEntries<TSchema["entries"]>, TRest>>

A validation and transformation pipe.

Returns

An object schema.