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

x/valibot/src/methods/omit/index.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.5.0/src/methods/omit/index.ts";

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

Type Parameters

TObjectSchema extends ObjectSchema<any> | ObjectSchemaAsync<any>
TKeys extends ObjectKeys<TObjectSchema>

Parameters

The schema to omit from.

keys: TKeys

The selected keys

optional
pipe: PipeAsync<ObjectOutput<Omit<TObjectSchema["object"], TKeys[number]>>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Omit<TObjectSchema["object"], TKeys[number]>>

An async object schema.

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

Type Parameters

TObjectSchema extends ObjectSchema<any> | ObjectSchemaAsync<any>
TKeys extends ObjectKeys<TObjectSchema>

Parameters

The schema to omit from.

keys: TKeys

The selected keys

optional
error: string

The error message.

optional
pipe: PipeAsync<ObjectOutput<Omit<TObjectSchema["object"], TKeys[number]>>>

A validation and transformation pipe.

Returns

ObjectSchemaAsync<Omit<TObjectSchema["object"], TKeys[number]>>

An async object schema.