is-plain-object

Return true if the given value is an object created by the Object constructor.

Install

npm i is-plain-object --save

Run tests

npm test

Usage

var isPlainObject = require('is-plain-object');

isPlainObject(1);
//=> false

isPlainObject(['foo', 'bar']);
//=> false

isPlainObject([]);
//=> false

isPlainObject(new Foo);
//=> false

isPlainObject(null);
//=> false

isPlainObject(Object.create(null));
//=> false

isPlainObject(Object.create({}));
//=> true

isPlainObject({foo: 'bar'});
//=> true

isPlainObject({});
//=> true

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license

This file was generated by verb-cli on September 21, 2014.

Last updated