minter-js-sdk
Version:
JS SDK for Minter Blockchain
19 lines (15 loc) • 412 B
JavaScript
;
var _isKeyable = require('./_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(map, key) {
var data = map.__data__;
return _isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
}
module.exports = getMapData;