mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
14 lines
287 B
JavaScript
14 lines
287 B
JavaScript
|
var Promise = require('bluebird');
|
||
|
|
||
|
function sequence(tasks) {
|
||
|
return Promise.reduce(tasks, function (results, task) {
|
||
|
return task().then(function (result) {
|
||
|
results.push(result);
|
||
|
|
||
|
return results;
|
||
|
});
|
||
|
}, []);
|
||
|
}
|
||
|
|
||
|
module.exports = sequence;
|