Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/libpkgx/src/deps.ts>is_what.isType

`import`… but with pkging powers
Very Popular
Latest
function is_what.isType
import { is_what } from "https://deno.land/x/libpkgx@v0.18.1/src/deps.ts";
const { isType } = is_what;

Does a generic check to check that the given payload is of a given type. In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!); It will, however, differentiate between object and null

Parameters

payload: any
type: T

Returns

payload is T