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

x/valibot/src/methods/keyof/index.ts>keyof

The modular and type safe schema library for validating structural data 🤖
Latest
function keyof
import { keyof } from "https://deno.land/x/valibot@v1.0.0-beta.1-i18n/src/methods/keyof/index.ts";

Creates a picklist schema of object keys.

Type Parameters

TSchema extends Schema

Parameters

schema: TSchema

The object schema.

Returns

PicklistSchema<ObjectKeys<TSchema>, undefined>

A picklist schema.

Creates a picklist schema of object keys.

Type Parameters

TSchema extends Schema
TMessage extends ErrorMessage<PicklistIssue> | undefined

Parameters

schema: TSchema

The object schema.

message: TMessage

The error message.

Returns

A picklist schema.