_mapCacheSet.js 403 B

123456789101112131415161718
  1. var getMapData = require('./_getMapData');
  2. /**
  3. * Sets the map `key` to `value`.
  4. *
  5. * @private
  6. * @name set
  7. * @memberOf MapCache
  8. * @param {string} key The key of the value to set.
  9. * @param {*} value The value to set.
  10. * @returns {Object} Returns the map cache instance.
  11. */
  12. function mapCacheSet(key, value) {
  13. getMapData(this, key).set(key, value);
  14. return this;
  15. }
  16. module.exports = mapCacheSet;