EroticDungeonGame/node_modules/lodash/_stackSet.js
3944Realms 8c4ce2709c fix(兼容emotescraft和rideeverything): 修改骑乘逻辑和tick取消EmtoesCraft表情
使用Mixin中检测绕过骑乘取消和开始骑乘逻辑,避免原版的unRide方法导致非预期的退出设备;在每tick检测,如果在设备上则停止表情动画
2026-02-20 14:45:57 +08:00

35 lines
853 B
JavaScript

var ListCache = require('./_ListCache'),
Map = require('./_Map'),
MapCache = require('./_MapCache');
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of the value to set.
* @param {*} value The value to set.
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__;
if (data instanceof ListCache) {
var pairs = data.__data__;
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
module.exports = stackSet;