is-plain-object-x
v2.1.2
Published
Tests if a value is a plain object.
Downloads
38
Maintainers
Readme
is-plain-object-x
Tests if a value is a plain object.
module.exports
⇒ boolean ⏏
This method tests if value
is a plain object, that is, an object created by
the Object
constructor or one with a [[Prototype]]
of null
.
Kind: Exported member
Returns: boolean - True if a plain object, otherwise false.
| Param | Type | Description | | ----- | --------------- | ------------------ | | value | * | The value to test. |
Example
import isPlainObject from 'is-plain-object-x';
function Foo() {
this.a = 1;
}
isPlainObject(new Foo()); // => false
isPlainObject([1, 2, 3]); // => false
isPlainObject({x: 0, y: 0}); // => true
isPlainObject(Object.create(null)); // => true