mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-04-25 17:14:46 +00:00
1 line
No EOL
594 B
JavaScript
1 line
No EOL
594 B
JavaScript
var schedulerFactory=function(a){function b(){}return b.prototype.parallel=function(a,b,c){var d=0,e=0,f=[],g=function(a,b){f[b]=a,--d===0&&c(f)},h,i;(!a||(d=a.length)===0)&&c([]);while(h=a.shift())b(h,function(a){g(a,e)}),e++},b.prototype.mapped=function(a,b){var c=0,d={},e=function(a,e){d[a]=e,--c===0&&f&&b(d)},f,g;for(g in a)a.hasOwnProperty(g)&&(c++,function(b){a[b](function(a){e(b,a)})}(g));f=!0,c===0&&b(d)},b.prototype.pipeline=function(a,b,c){var d=a,e=function(){b.shift()(d,f)},f=function(f){d=f,b.length===0?c(d):e()};!b||b.length===0?c(a):e(f)},b};module.exports=schedulerFactory |