blob: 1b730321c218f2e0a5b20638d231da07147410f9 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001/** Used for built-in method references. */
2var objectProto = Object.prototype;
3
4/** Used to check objects for own properties. */
5var hasOwnProperty = objectProto.hasOwnProperty;
6
7/**
8 * The base implementation of `_.has` without support for deep paths.
9 *
10 * @private
11 * @param {Object} [object] The object to query.
12 * @param {Array|string} key The key to check.
13 * @returns {boolean} Returns `true` if `key` exists, else `false`.
14 */
15function baseHas(object, key) {
16 return object != null && hasOwnProperty.call(object, key);
17}
18
19module.exports = baseHas;