Files
Testing/html5-chat1/nodeMulti/node_modules/mediasoup/test/utils/promiseSeries.js
sean 343b4a3f3f
Some checks are pending
deploy-testing / deploy (push) Waiting to run
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();
});
};