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

x/valibot/src/index.ts>isOfKind

The modular and type safe schema library for validating structural data 🤖
Latest
function isOfKind
import { isOfKind } from "https://deno.land/x/valibot@v1.0.0-beta.5/src/index.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.