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.

22 lines
487 B

1 month ago
  1. import getMapData from './_getMapData.js';
  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. var data = getMapData(this, key),
  14. size = data.size;
  15. data.set(key, value);
  16. this.size += data.size == size ? 0 : 1;
  17. return this;
  18. }
  19. export default mapCacheSet;