Files
lodash/_hashHas.js
John-David Dalton c7a7540e16 Bump to v4.17.3.
2016-12-21 15:46:13 -06:00

28 lines
755 B
JavaScript

define(['./_nativeCreate'], function(nativeCreate) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Checks if a hash value for `key` exists.
*
* @private
* @name has
* @memberOf Hash
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function hashHas(key) {
var data = this.__data__;
return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
}
return hashHas;
});