@hoge1e3/is-plain-object
v1.0.0
Published
Check if an object is a plain JavaScript object by comparing prototype depth.
Maintainers
Readme
is-plain-object
Check if an object is a plain JavaScript object by comparing its prototype depth.
Installation
npm install is-plain-objectUsage
import isPlainObject from 'is-plain-object';
console.log(isPlainObject({})); // true
console.log(isPlainObject([])); // false
console.log(isPlainObject(Object.create(null))); // falseAPI
isPlainObject(o)
Returns true if the input o is a plain object (i.e., {}), based on a depth probe of its prototype chain.
License
MIT
