2 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
4 * Copyright (c) 2014-2017, Jon Schlinkert.
5 * Released under the MIT License.
10 var isObject = require('isobject');
12 function isObjectObject(o) {
13 return isObject(o) === true
14 && Object.prototype.toString.call(o) === '[object Object]';
17 module.exports = function isPlainObject(o) {
20 if (isObjectObject(o) === false) return false;
22 // If has modified constructor
24 if (typeof ctor !== 'function') return false;
26 // If has modified prototype
27 prot = ctor.prototype;
28 if (isObjectObject(prot) === false) return false;
30 // If constructor does not have an Object-specific method
31 if (prot.hasOwnProperty('isPrototypeOf') === false) {
35 // Most likely a plain Object