Version 1
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _mapHas.js
1 var Map = require('./_Map'),
2     assocHas = require('./_assocHas'),
3     hashHas = require('./_hashHas'),
4     isKeyable = require('./_isKeyable');
5
6 /**
7  * Checks if a map value for `key` exists.
8  *
9  * @private
10  * @name has
11  * @memberOf MapCache
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 mapHas(key) {
16   var data = this.__data__;
17   if (isKeyable(key)) {
18     return hashHas(typeof key == 'string' ? data.string : data.hash, key);
19   }
20   return Map ? data.map.has(key) : assocHas(data.map, key);
21 }
22
23 module.exports = mapHas;