Skip to content

Xotic750/is-plain-object-x

Repository files navigation

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

is-plain-object-x

Tests if a value is a plain object.

module.exportsboolean

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