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.6.0/mod.ts";

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

Type Parameters

TObjectSchema extends ObjectSchema<any>

Parameters

The affected schema.

optional
pipe: Pipe<ObjectOutput<Partial<TObjectSchema["object"]>>>

A validation and transformation pipe.

Returns

ObjectSchema<Partial<TObjectSchema["object"]>>

An object schema.

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

Type Parameters

TObjectSchema extends ObjectSchema<any>

Parameters

The affected schema.

optional
error: string

The error message.

optional
pipe: Pipe<ObjectOutput<Partial<TObjectSchema["object"]>>>

A validation and transformation pipe.

Returns

ObjectSchema<Partial<TObjectSchema["object"]>>

An object schema.