MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / shimIsPlainObject

Function shimIsPlainObject

lib/web/jshint.js:5888–5909  ·  view source on GitHub ↗

* A fallback implementation of `_.isPlainObject` which checks if `value` * is an object created by the `Object` constructor or has a `[[Prototype]]` * of `null`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plai

(value)

Source from the content-addressed store, hash-verified

5886 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
5887 */
5888 function shimIsPlainObject(value) {
5889 var Ctor,
5890 support = lodash.support;
5891
5892 // Exit early for non `Object` objects.
5893 if (!(isObjectLike(value) && objToString.call(value) == objectTag) ||
5894 (!hasOwnProperty.call(value, 'constructor') &&
5895 (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
5896 return false;
5897 }
5898 // IE < 9 iterates inherited properties before own properties. If the first
5899 // iterated property is an object's own property then there are no inherited
5900 // enumerable properties.
5901 var result;
5902 // In most environments an object's own properties are iterated before
5903 // its inherited properties. If the last iterated property is an object's
5904 // own property then there are no inherited enumerable properties.
5905 baseForIn(value, function(subValue, key) {
5906 result = key;
5907 });
5908 return result === undefined || hasOwnProperty.call(value, result);
5909 }
5910
5911 /**
5912 * A fallback implementation of `Object.keys` which creates an array of the

Callers 1

runInContextFunction · 0.85

Calls 3

isObjectLikeFunction · 0.85
baseForInFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected