aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/_getMapData.js
blob: 17f63032e1a52b5f3437af26e5ce56d8c3c85d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var isKeyable = require('./_isKeyable');

/**
 * Gets the data for `map`.
 *
 * @private
 * @param {Object} map The map to query.
 * @param {string} key The reference key.
 * @returns {*} Returns the map data.
 */
function getMapData(map, key) {
  var data = map.__data__;
  return isKeyable(key)
    ? data[typeof key == 'string' ? 'string' : 'hash']
    : data.map;
}

module.exports = getMapData;