You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
626 B

4 years ago
  1. var nativeCreate = require('./_nativeCreate');
  2. /** Used for built-in method references. */
  3. var objectProto = Object.prototype;
  4. /** Used to check objects for own properties. */
  5. var hasOwnProperty = objectProto.hasOwnProperty;
  6. /**
  7. * Checks if a hash value for `key` exists.
  8. *
  9. * @private
  10. * @name has
  11. * @memberOf Hash
  12. * @param {string} key The key of the entry to check.
  13. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14. */
  15. function hashHas(key) {
  16. var data = this.__data__;
  17. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  18. }
  19. module.exports = hashHas;