blob: 17f63032e1a52b5f3437af26e5ce56d8c3c85d83 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001var isKeyable = require('./_isKeyable');
2
3/**
4 * Gets the data for `map`.
5 *
6 * @private
7 * @param {Object} map The map to query.
8 * @param {string} key The reference key.
9 * @returns {*} Returns the map data.
10 */
11function getMapData(map, key) {
12 var data = map.__data__;
13 return isKeyable(key)
14 ? data[typeof key == 'string' ? 'string' : 'hash']
15 : data.map;
16}
17
18module.exports = getMapData;