mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-11-25 17:06:52 +01:00
19 lines
400 B
JavaScript
19 lines
400 B
JavaScript
|
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;
|