1 /** Used for built-in method references. */
2 var objectProto = Object.prototype;
4 /** Used to check objects for own properties. */
5 var hasOwnProperty = objectProto.hasOwnProperty;
7 /** Built-in value references. */
8 var getPrototypeOf = Object.getPrototypeOf;
11 * The base implementation of `_.has` without support for deep paths.
14 * @param {Object} object The object to query.
15 * @param {Array|string} key The key to check.
16 * @returns {boolean} Returns `true` if `key` exists, else `false`.
18 function baseHas(object, key) {
19 // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
20 // that are composed entirely of index properties, return `false` for
21 // `hasOwnProperty` checks of them.
22 return hasOwnProperty.call(object, key) ||
23 (typeof object == 'object' && key in object && getPrototypeOf(object) === null);
26 module.exports = baseHas;