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

x/valibot/mod.ts>keyof

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

Creates a picklist schema of object keys.

Type Parameters

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

Parameters

schema: TSchema

The object schema.

Returns

PicklistSchema<TupleOrNever<UnionToTuple<keyof TSchema["entries"]>>>

A picklist schema.