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

x/valibot/src/utils/isOfKind/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.1-i18n/src/utils/isOfKind/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.