@alexspirgel/is-plain-object

1.0.6 • Public • Published

Is Plain Object

A utility function that returns true if the argument is a plain object. Otherwise returns false.

For the purposes of this script, a plain object is an object that was created by explicitly specifying keys and values. An object created by a constructor is not a plain object.

Installation

Using NPM:

npm install @alexspirgel/is-plain-object
const isPlainObject = require('@alexspirgel/is-plain-object');

Usage

isPlainObject({}); // returns true
isPlainObject({'a':1, 'b':{'c':3}}); // returns true
isPlainObject(null); // returns false
isPlainObject(Error); // returns false

Package Sidebar

Install

npm i @alexspirgel/is-plain-object

Weekly Downloads

28

Version

1.0.6

License

MIT

Unpacked Size

3.02 kB

Total Files

4

Last publish

Collaborators

  • alexspirgel