Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/valibot/src/methods/pick/pick.ts>pick

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Latest
function pick
import { pick } from "https://deno.land/x/valibot@1.0.0-beta.0-to-json-schema/src/methods/pick/pick.ts";

Creates a modified copy of an object schema that contains only the selected entries.

Type Parameters

TSchema extends Schema
TKeys extends ObjectKeys<TSchema>

Parameters

schema: TSchema

The schema to pick from.

keys: TKeys

The selected entries.

Returns

An object schema.