* Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain
(value)
| 900 | * // => true |
| 901 | */ |
| 902 | function isPlainObject(value) { |
| 903 | if (!isObjectLike(value) || baseGetTag(value) != objectTag) { |
| 904 | return false; |
| 905 | } |
| 906 | var proto = getPrototype(value); |
| 907 | if (proto === null) { |
| 908 | return true; |
| 909 | } |
| 910 | var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; |
| 911 | return typeof Ctor == 'function' && Ctor instanceof Ctor && |
| 912 | funcToString.call(Ctor) == objectCtorString; |
| 913 | } |
| 914 | |
| 915 | module.exports = isPlainObject; |
| 916 |
no test coverage detected