1.0.0 • Published 5 years ago

@ngard/tiny-isplainobject v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

tiny-isplainobject

source bundle size build status license

A minimal-weight utility equivalent to lodash.isPlainObject. For when every byte counts!

lodash.isplainobject bundle size tiny-isplainobject bundle size

Syntax

isPlainObject(/* object */)

Parameters

object - An object (or any value) to check

Return

true if value is a plain object, that is, an object created by the Object constructor or one with a [[Prototype]] of null. false otherwise.

Example

import { isPlainObject } from '@ngard/tiny-isplainobject';

isPlainObject({ a: 1 }); // true
isPlainObject(Object.create(null)); // true

isPlainObject(null); // false
isPlainObject([1,2,3]); // false
isPlainObject(new Set()); // false