Urara-Blog/node_modules/.pnpm-store/v3/files/4a/35f343184bfcd02e49c5f2ab2efe657ca00fa4fff5db576c4933e6743558e9157609b2d74562f20f6ce9736c01a585e8789b2f612e17e0056bf38a781e0ac4
2022-08-14 01:14:53 +08:00

26 lines
553 B
Text

var assocIndexOf = require('./_assocIndexOf');
/**
* Sets the list cache `key` to `value`.
*
* @private
* @name set
* @memberOf ListCache
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the list cache instance.
*/
function listCacheSet(key, value) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
module.exports = listCacheSet;