import { pickAsync } from "https://deno.land/x/valibot@v0.8.0/src/methods/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 (keyof TObjectSchema["object"])[]
Parameters
schema: TObjectSchema
The schema to pick from.
keys: TKeys
The selected keys
optional
pipe: PipeAsync<ObjectOutput<Pick<TObjectSchema["object"], TKeys[number]>>>A validation and transformation pipe.
Returns
ObjectSchemaAsync<Pick<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 (keyof TObjectSchema["object"])[]
Parameters
schema: TObjectSchema
The schema to pick from.
keys: TKeys
The selected keys
optional
pipe: PipeAsync<ObjectOutput<Pick<TObjectSchema["object"], TKeys[number]>>>A validation and transformation pipe.
Returns
ObjectSchemaAsync<Pick<TObjectSchema["object"], TKeys[number]>>
An async object schema.