Update app and tooling

This commit is contained in:
Lawrence Chen 2026-01-29 17:36:26 -08:00
parent 3046531bdd
commit e620ec7349
4950 changed files with 2975120 additions and 10 deletions

30
node_modules/throttleit/index.js generated vendored Normal file
View file

@ -0,0 +1,30 @@
function throttle(function_, wait) {
if (typeof function_ !== 'function') {
throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof function_}\`.`);
}
// TODO: Add `wait` validation too in the next major version.
let timeoutId;
let lastCallTime = 0;
return function throttled(...arguments_) { // eslint-disable-line func-names
clearTimeout(timeoutId);
const now = Date.now();
const timeSinceLastCall = now - lastCallTime;
const delayForNextCall = wait - timeSinceLastCall;
if (delayForNextCall <= 0) {
lastCallTime = now;
function_.apply(this, arguments_);
} else {
timeoutId = setTimeout(() => {
lastCallTime = Date.now();
function_.apply(this, arguments_);
}, delayForNextCall);
}
};
}
module.exports = throttle;