Skip to main content
Module

x/is_what/src/index.ts>isObjectLike

JS type check (TypeScript supported) functions like `isPlainObject() isArray()` etc. A simple & small integration.
Go to Latest
function isObjectLike
import { isObjectLike } from "https://deno.land/x/is_what@v4.1.15/src/index.ts";

Returns whether the payload is an object like a type passed in < >

Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an id prop.

Type Parameters

T extends PlainObject

this must be passed in < >

Parameters

payload: any

Returns

payload is T