Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
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@v0.35.0/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.