Files
lodash/.internal/getMapData.js
2017-01-10 00:45:05 -08:00

19 lines
414 B
JavaScript

import isKeyable from './.internal/isKeyable.js';
/**
* 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({ __data__ }, key) {
const data = __data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
export default getMapData;