1 var isKeyable = require('./_isKeyable');
3 /** Used to stand-in for `undefined` hash values. */
4 var HASH_UNDEFINED = '__lodash_hash_undefined__';
7 * Checks if `value` is in `cache`.
10 * @param {Object} cache The set cache to search.
11 * @param {*} value The value to search for.
12 * @returns {number} Returns `true` if `value` is found, else `false`.
14 function cacheHas(cache, value) {
15 var map = cache.__data__;
16 if (isKeyable(value)) {
17 var data = map.__data__,
18 hash = typeof value == 'string' ? data.string : data.hash;
20 return hash[value] === HASH_UNDEFINED;
22 return map.has(value);
25 module.exports = cacheHas;