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

x/typebox/src/value/guard/guard.ts>HasPropertyKey

Json Schema Type Builder with Static Type Resolution for TypeScript
Latest
function HasPropertyKey
import { HasPropertyKey } from "https://deno.land/x/typebox@0.34.0/src/value/guard/guard.ts";

Returns true if this value has this property key

Type Parameters

K extends PropertyKey

Parameters

value: Record<any, unknown>
key: K

Returns

value is Record<PropertyKey, unknown> & [_ in K]: unknown