UNPKG

typeguru

Version:

TypeGuru is a lightweight TypeScript utility library for type checking. It includes utility functions for checking object literals, plain objects, specific types, and more.

12 lines (10 loc) 326 B
import { IsPlainObject } from "../types"; const isPlainObject: IsPlainObject = (value) => { return ( typeof value === "object" && value !== null && value.constructor === Object && Object.prototype.toString.call(value) === "[object Object]" ); } export default isPlainObject