Version 1
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _mapGet.js
1 var Map = require('./_Map'),
2     assocGet = require('./_assocGet'),
3     hashGet = require('./_hashGet'),
4     isKeyable = require('./_isKeyable');
5
6 /**
7  * Gets the map value for `key`.
8  *
9  * @private
10  * @name get
11  * @memberOf MapCache
12  * @param {string} key The key of the value to get.
13  * @returns {*} Returns the entry value.
14  */
15 function mapGet(key) {
16   var data = this.__data__;
17   if (isKeyable(key)) {
18     return hashGet(typeof key == 'string' ? data.string : data.hash, key);
19   }
20   return Map ? data.map.get(key) : assocGet(data.map, key);
21 }
22
23 module.exports = mapGet;