mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Bump to v4.0.0.
This commit is contained in:
@@ -1,14 +1,23 @@
|
||||
import Map from './Map';
|
||||
import assocGet from './assocGet';
|
||||
import hashGet from './hashGet';
|
||||
import isKeyable from './isKeyable';
|
||||
|
||||
/**
|
||||
* Gets the cached value for `key`.
|
||||
* Gets the map value for `key`.
|
||||
*
|
||||
* @private
|
||||
* @name get
|
||||
* @memberOf _.memoize.Cache
|
||||
* @memberOf MapCache
|
||||
* @param {string} key The key of the value to get.
|
||||
* @returns {*} Returns the cached value.
|
||||
* @returns {*} Returns the entry value.
|
||||
*/
|
||||
function mapGet(key) {
|
||||
return key == '__proto__' ? undefined : this.__data__[key];
|
||||
var data = this.__data__;
|
||||
if (isKeyable(key)) {
|
||||
return hashGet(typeof key == 'string' ? data.string : data.hash, key);
|
||||
}
|
||||
return Map ? data.map.get(key) : assocGet(data.map, key);
|
||||
}
|
||||
|
||||
export default mapGet;
|
||||
|
||||
Reference in New Issue
Block a user