1 | import Map from './_Map';
|
2 | import assocGet from './_assocGet';
|
3 | import hashGet from './_hashGet';
|
4 | import isKeyable from './_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 | export default mapGet;
|