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

x/valibot/mod.ts>omitAsync

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

Creates an async object schema that contains only the selected keys of an existing schema.

Type Parameters

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

Parameters

schema: TSchema

The schema to omit from.

keys: TKeys

The selected keys

optional
pipe: PipeAsync<ObjectOutput<Omit<TSchema["entries"], TKeys[number]>, undefined>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Omit<TSchema["entries"], TKeys[number]>>

An async object schema.

Creates an async object schema that contains only the selected keys of an existing schema.

Type Parameters

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

Parameters

schema: TSchema

The schema to omit from.

keys: TKeys

The selected keys

optional
message: ErrorMessage

The error message.

optional
pipe: PipeAsync<ObjectOutput<Omit<TSchema["entries"], TKeys[number]>, undefined>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Omit<TSchema["entries"], TKeys[number]>>

An async object schema.

Creates an async object schema that contains only the selected keys of an existing schema.

Type Parameters

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

Parameters

schema: TSchema

The schema to omit from.

keys: TKeys

The selected keys

rest: TRest

The object rest.

optional
pipe: PipeAsync<ObjectOutput<Omit<TSchema["entries"], TKeys[number]>, TRest>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Omit<TSchema["entries"], TKeys[number]>, TRest>

An async object schema.

Creates an async object schema that contains only the selected keys of an existing schema.

Type Parameters

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

Parameters

schema: TSchema

The schema to omit from.

keys: TKeys

The selected keys

rest: TRest

The object rest.

optional
message: ErrorMessage

The error message.

optional
pipe: PipeAsync<ObjectOutput<Omit<TSchema["entries"], TKeys[number]>, TRest>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Omit<TSchema["entries"], TKeys[number]>, TRest>

An async object schema.