mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Bump to v4.1.0.
This commit is contained in:
21
_mapHas.js
Normal file
21
_mapHas.js
Normal file
@@ -0,0 +1,21 @@
|
||||
define(['./_Map', './_assocHas', './_hashHas', './_isKeyable'], function(Map, assocHas, hashHas, isKeyable) {
|
||||
|
||||
/**
|
||||
* Checks if a map value for `key` exists.
|
||||
*
|
||||
* @private
|
||||
* @name has
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the entry to check.
|
||||
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
||||
*/
|
||||
function mapHas(key) {
|
||||
var data = this.__data__;
|
||||
if (isKeyable(key)) {
|
||||
return hashHas(typeof key == 'string' ? data.string : data.hash, key);
|
||||
}
|
||||
return Map ? data.map.has(key) : assocHas(data.map, key);
|
||||
}
|
||||
|
||||
return mapHas;
|
||||
});
|
||||
Reference in New Issue
Block a user