_listCacheGet.js 420 B

1234567891011121314151617181920
  1. var assocIndexOf = require('./_assocIndexOf');
  2. /**
  3. * Gets the list cache value for `key`.
  4. *
  5. * @private
  6. * @name get
  7. * @memberOf ListCache
  8. * @param {string} key The key of the value to get.
  9. * @returns {*} Returns the entry value.
  10. */
  11. function listCacheGet(key) {
  12. var data = this.__data__,
  13. index = assocIndexOf(data, key);
  14. return index < 0 ? undefined : data[index][1];
  15. }
  16. module.exports = listCacheGet;