Add .gitignore to exclude all node packages and lock files

This commit is contained in:
Adolfo Reyna
2026-02-23 21:56:04 -05:00
parent faae96c9ed
commit dcc5c6c044
9747 changed files with 1555105 additions and 2 deletions
@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.throttledStateUpdate = void 0;
const throttledStateUpdate = ({ updateFn, everyMilliseconds, controller, }) => {
let currentState = {
bytes: 0,
percentage: null,
totalBytes: null,
};
if (!updateFn) {
return {
get: () => currentState,
update: null,
stopAndGetLastProgress: () => { },
};
}
let lastUpdated = null;
const callUpdateIfChanged = () => {
if (currentState === lastUpdated) {
return;
}
updateFn(currentState);
lastUpdated = currentState;
};
let cleanup = () => { };
if (everyMilliseconds > 0) {
const interval = setInterval(() => {
callUpdateIfChanged();
}, everyMilliseconds);
const onAbort = () => {
clearInterval(interval);
};
controller._internals.signal.addEventListener('abort', onAbort, {
once: true,
});
cleanup = () => {
clearInterval(interval);
controller._internals.signal.removeEventListener('abort', onAbort);
};
}
return {
get: () => currentState,
update: (fn) => {
currentState = fn(currentState);
if (everyMilliseconds === 0) {
callUpdateIfChanged();
}
},
stopAndGetLastProgress: () => {
cleanup();
return currentState;
},
};
};
exports.throttledStateUpdate = throttledStateUpdate;