stackGet.js 386 B

12345678910111213141516171819
  1. import assocGet from './assocGet';
  2. /**
  3. * Gets the stack value for `key`.
  4. *
  5. * @private
  6. * @name get
  7. * @memberOf Stack
  8. * @param {string} key The key of the value to get.
  9. * @returns {*} Returns the entry value.
  10. */
  11. function stackGet(key) {
  12. var data = this.__data__,
  13. array = data.array;
  14. return array ? assocGet(array, key) : data.map.get(key);
  15. }
  16. export default stackGet;