MCPcopy
hub / github.com/lodash/lodash / isPlainObject

Function isPlainObject

lodash.js:12135–12146  ·  view source on GitHub ↗

* 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} Retur

(value)

Source from the content-addressed store, hash-verified

12133 * // => true
12134 */
12135 function isPlainObject(value) {
12136 if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
12137 return false;
12138 }
12139 var proto = getPrototype(value);
12140 if (proto === null) {
12141 return true;
12142 }
12143 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
12144 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
12145 funcToString.call(Ctor) == objectCtorString;
12146 }
12147
12148 /**
12149 * Checks if `value` is classified as a `RegExp` object.

Callers 4

baseMergeDeepFunction · 0.85
customOmitCloneFunction · 0.85
isElementFunction · 0.85
isErrorFunction · 0.85

Calls 2

isObjectLikeFunction · 0.85
baseGetTagFunction · 0.85

Tested by

no test coverage detected