Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.
/ is-it-object Public archive

Tiny package which helps to check that value is an object in JavaScript.

License

Notifications You must be signed in to change notification settings

cn007b/is-it-object

Repository files navigation

isObject

NPM

Build Status Coverage Status Maintainability PRs Welcome

Most powerful way to check that value is an object in javascript.
More info about motivation for this repo you can find here.

Installation

npm i is-it-object

Usage

const isObject = require('is-it-object');

isObject({});                              // true
isObject([]);                              // false
isObject(undefined);                       // false
isObject(null);                            // false
isObject(0);                               // false
isObject('');                              // false
isObject(/.*/);                            // true
isObject(new Date());                      // true
isObject(function () {});                  // false
isObject(Object.create({}));               // true
isObject(Object.create(null));             // true
isObject(Object.create(Object.prototype)); // true

More information available here.

Tests

npm test