mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-12 01:54:42 +00:00
23 lines
267 B
JavaScript
23 lines
267 B
JavaScript
|
'use strict';
|
||
|
|
||
|
module.exports.asyncSeries = function(fns, done) {
|
||
|
|
||
|
var idx = 0;
|
||
|
|
||
|
function next(err) {
|
||
|
|
||
|
if (err) {
|
||
|
return done(err);
|
||
|
}
|
||
|
|
||
|
var fn = fns[idx++];
|
||
|
|
||
|
if (!fn) {
|
||
|
return done();
|
||
|
} else {
|
||
|
fn(next);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
next();
|
||
|
};
|