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

x/valibot/mod.ts>isOfKind

The modular and type safe schema library for validating structural data 🤖
Extremely Popular
Latest
function isOfKind
import { isOfKind } from "https://deno.land/x/valibot@v1.0.0-beta.2-to-json-schema/mod.ts";

A generic type guard to check the kind of an object.

Type Parameters

TKind extends TObject["kind"]
TObject extends { kind: string; }

Parameters

kind: TKind

The kind to check for.

object: TObject

The object to check.

Returns

object is Extract<TObject, { kind: TKind; }>

Whether it matches.