Files
Multi-Hoster-Upload/lib/serialized-runner.js
T
Sucukdeluxe 76a228fb7c release: v2.0.6
Redesign the desktop workspace with task sidebars, live filters, clearer settings, and an accessible update dialog.

Harden encrypted backup imports, configuration persistence, history retention, queue snapshots, shutdown recovery, and update installation ordering.

Publish verified Windows artifacts and refreshed English documentation.
2026-08-10 09:28:28 +02:00

23 lines
641 B
JavaScript

(function (root) {
'use strict';
function createSerializedRunner(task) {
if (typeof task !== 'function') throw new TypeError('task must be a function');
let pending = Promise.resolve();
return {
run(...args) {
const result = pending.catch(() => {}).then(() => task(...args));
pending = result;
return result;
},
flush() {
return pending;
}
};
}
const api = { createSerializedRunner };
if (typeof module !== 'undefined' && module.exports) module.exports = api;
else if (root) root.SerializedRunner = api;
})(typeof window !== 'undefined' ? window : this);