mapSet.js 382 B

123456789101112131415161718
  1. /**
  2. * Sets `value` to `key` of the cache.
  3. *
  4. * @private
  5. * @name set
  6. * @memberOf _.memoize.Cache
  7. * @param {string} key The key of the value to cache.
  8. * @param {*} value The value to cache.
  9. * @returns {Object} Returns the cache object.
  10. */
  11. function mapSet(key, value) {
  12. if (key != '__proto__') {
  13. this.__data__[key] = value;
  14. }
  15. return this;
  16. }
  17. module.exports = mapSet;