You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
400 B

4 years ago
  1. var isKeyable = require('./_isKeyable');
  2. /**
  3. * Gets the data for `map`.
  4. *
  5. * @private
  6. * @param {Object} map The map to query.
  7. * @param {string} key The reference key.
  8. * @returns {*} Returns the map data.
  9. */
  10. function getMapData(map, key) {
  11. var data = map.__data__;
  12. return isKeyable(key)
  13. ? data[typeof key == 'string' ? 'string' : 'hash']
  14. : data.map;
  15. }
  16. module.exports = getMapData;