Urara-Blog/node_modules/.pnpm-store/v3/files/ef/6b85895073bbc4aa3dd0b46f9fa12c1b145611455991aef8b697f81834de11a2cc94980d79bacf5e9858fe3f7b34728dc292d02997de0d31dc20fd229f243f
2022-08-14 01:14:53 +08:00

22 lines
489 B
Text

var getMapData = require('./_getMapData');
/**
* Sets the map `key` to `value`.
*
* @private
* @name set
* @memberOf MapCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the map cache instance.
*/
function mapCacheSet(key, value) {
var data = getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
module.exports = mapCacheSet;