Files
sean 343b4a3f3f
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-19 18:32:17 -05:00

30 lines
358 B
JavaScript

module.exports = function(funcs)
{
return new Promise((resolve, reject) =>
{
let i = 0;
const len = funcs.length;
function next()
{
if (i >= len)
return resolve();
const func = funcs[i];
func()
.then(() =>
{
i++;
next();
})
.catch((error) =>
{
return reject(error);
});
}
next();
});
};