Skip to main content
Module

x/scaffold/src/deps/npm.ts>isType

scaffold your next project with style and 💗
Latest
function isType
import { isType } from "https://deno.land/x/scaffold@0.3.0/src/deps/npm.ts";

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