summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegawac <megawac@gmail.com>2015-07-19 21:26:51 -0400
committerGraeme Yeates <yeatesgraeme@gmail.com>2015-07-19 21:35:49 -0400
commit33ed04c1bff1d91d5817b12ba8d8710cb7a0719b (patch)
treebe93d654a98bfd91b39af67e80e8c563f864d656
parent5645eeec033816c616de8ec25946ea7734743e22 (diff)
downloadasync-building.tar.gz
Source map outputbuilding
Add lint step to make test Fix map file directory
-rw-r--r--Makefile4
-rw-r--r--dist/async.min.js3
2 files changed, 4 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index a40e6da..6da77d5 100644
--- a/Makefile
+++ b/Makefile
@@ -9,12 +9,12 @@ XYZ = node_modules/.bin/xyz --repo git@github.com:caolan/async.git
BUILDDIR = dist
SRC = lib/async.js
-all: clean test build
+all: lint test clean build
build: $(wildcard lib/*.js)
mkdir -p $(BUILDDIR)
- $(UGLIFY) $(SRC) -mc > $(BUILDDIR)/async.min.js
cp $(SRC) $(BUILDDIR)/async.js
+ cd $(BUILDDIR) && $(UGLIFY) async.js -mc --source-map async.min.map -o async.min.js
test:
$(NODEUNIT) test
diff --git a/dist/async.min.js b/dist/async.min.js
index 42db398..cfd9161 100644
--- a/dist/async.min.js
+++ b/dist/async.min.js
@@ -1 +1,2 @@
-!function(){function n(){}function t(n){var t=!1;return function(){if(t)throw new Error("Callback was already called.");t=!0,n.apply(this,arguments)}}function e(n){var t=!1;return function(){t||(t=!0,n.apply(this,arguments))}}function r(n){return P(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function u(n,t){return r(n)?i(n,t):f(n,t)}function i(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function o(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function c(n){return o(Array(n),function(n,t){return t})}function a(n,t,e){return i(n,function(n,r,u){e=t(e,n,r,u)}),e}function f(n,t){i(U(n),function(e){t(n[e],e)})}function l(n){var t,e,u=-1;return r(n)?(t=n.length,function(){return u++,t>u?u:null}):(e=U(n),t=e.length,function(){return u++,t>u?e[u]:null})}function s(n,t){t=t||0;var e=-1,r=n.length;t&&(r-=t,r=0>r?0:r);for(var u=Array(r);++e<r;)u[e]=n[e+t];return u}function p(n){return function(t,e,r){return n(t,r)}}function m(r){return function(u,i,o){o=e(o||n),u=u||[];var c=l(u);if(0>=r)return o(null);var a=!1,f=0,s=!1;!function p(){if(a&&0>=f)return o(null);for(;r>f&&!s;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,i(u[n],n,t(function(n){f-=1,n?(o(n),s=!0):p()}))}}()}}function h(n){return function(t,e,r){return n(L.eachOf,t,e,r)}}function g(n,t){return function(e,r,u){return t(m(n),e,r,u)}}function d(n){return function(t,e,r){return n(L.eachOfSeries,t,e,r)}}function v(t,r,u,i){i=e(i||n);var o=[];t(r,function(n,t,e){u(n,function(n,r){o[t]=r,e(n)})},function(n){i(n,o)})}function y(n){return g(n,v)}function k(n,t,e,r){var u=[];t=o(t,function(n,t){return{index:t,value:n}}),n(t,function(n,t,r){e(n.value,function(t){t&&u.push(n),r()})},function(){r(o(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function b(n,t,e,r){k(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function w(t,e,r,u){t(e,function(t,e,i){r(t,function(e){e?(u(t),u=n):i()})},function(){u()})}function O(t,e,u){u=u||n;var i=r(e)?[]:{};t(e,function(n,t,e){n(function(n){var r=s(arguments,1);r.length<=1&&(r=r[0]),i[t]=r,e(n)})},function(n){u(n,i)})}function x(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function S(e,r,u){function c(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,P(e)||(e=[e]),0===e.length&&t.idle()?L.setImmediate(function(){t.drain()}):(i(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void L.setImmediate(t.process))}function a(n,t){return function(){f-=1;var e=arguments;i(t,function(n){n.callback.apply(n,e)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==r)r=1;else if(0===r)throw new Error("Concurrency must not be zero");var f=0,l={tasks:[],concurrency:r,payload:u,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){c(l,n,!1,t)},kill:function(){l.drain=n,l.tasks=[]},unshift:function(n,t){c(l,n,!0,t)},process:function(){if(!l.paused&&f<l.concurrency&&l.tasks.length)for(;f<l.concurrency&&l.tasks.length;){var n=l.payload?l.tasks.splice(0,l.payload):l.tasks.splice(0,l.tasks.length),r=o(n,function(n){return n.data});0===l.tasks.length&&l.empty(),f+=1;var u=t(a(l,n));e(r,u)}},length:function(){return l.tasks.length},running:function(){return f},idle:function(){return l.tasks.length+f===0},pause:function(){l.paused=!0},resume:function(){if(l.paused!==!1){l.paused=!1;for(var n=Math.min(l.concurrency,l.tasks.length),t=1;n>=t;t++)L.setImmediate(l.process)}}};return l}function E(n){return function(t){var e=s(arguments,1);t.apply(null,e.concat([function(t){var e=s(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[n]&&i(e,function(t){console[n](t)}))}]))}}function I(n){return function(t,e,r){n(c(t),e,r)}}function T(n,t){function e(){var e=this,r=s(arguments),u=r.pop();return n(t,function(n,t,u){n.apply(e,r.concat([u]))},u)}if(arguments.length>2){var r=s(arguments,2);return e.apply(this,r)}return e}function j(n){return function(){var t=s(arguments),e=t.pop();t.push(function(){var n=arguments;r?L.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1}}var A,L={},z="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=z&&(A=z.async),L.noConflict=function(){return z.async=A,L};var q,C=Object.prototype.toString,P=Array.isArray||function(n){return"[object Array]"===C.call(n)},U=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t};"function"==typeof setImmediate&&(q=setImmediate),"undefined"!=typeof process&&process.nextTick?(L.nextTick=process.nextTick,q?L.setImmediate=function(n){q(n)}:L.setImmediate=L.nextTick):q?(L.nextTick=function(n){q(n)},L.setImmediate=L.nextTick):(L.nextTick=function(n){setTimeout(n,0)},L.setImmediate=L.nextTick),L.forEach=L.each=function(n,t,e){return L.eachOf(n,p(t),e)},L.forEachSeries=L.eachSeries=function(n,t,e){return L.eachOfSeries(n,p(t),e)},L.forEachLimit=L.eachLimit=function(n,t,e,r){return m(t)(n,p(e),r)},L.forEachOf=L.eachOf=function(i,o,c){function a(n){n?c(n):(l+=1,l>=f&&c(null))}c=e(c||n),i=i||[];var f=r(i)?i.length:U(i).length,l=0;return f?void u(i,function(n,e){o(i[e],e,t(a))}):c(null)},L.forEachOfSeries=L.eachOfSeries=function(r,u,i){function o(){var n=!0;return null===a?i(null):(u(r[a],a,t(function(t){if(t)i(t);else{if(a=c(),null===a)return i(null);n?L.nextTick(o):o()}})),void(n=!1))}i=e(i||n),r=r||[];var c=l(r),a=c();o()},L.forEachOfLimit=L.eachOfLimit=function(n,t,e,r){m(t)(n,e,r)},L.map=h(v),L.mapSeries=d(v),L.mapLimit=function(n,t,e,r){return y(t)(n,e,r)},L.inject=L.foldl=L.reduce=function(n,t,e,r){L.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n||null,t)})},L.foldr=L.reduceRight=function(n,t,e,r){var u=o(n,function(n){return n}).reverse();L.reduce(u,t,e,r)},L.select=L.filter=h(k),L.selectSeries=L.filterSeries=d(k),L.reject=h(b),L.rejectSeries=d(b),L.detect=h(w),L.detectSeries=d(w),L.any=L.some=function(t,e,r){L.eachOf(t,function(t,u,i){e(t,function(t){t&&(r(!0),r=n),i()})},function(){r(!1)})},L.all=L.every=function(t,e,r){L.eachOf(t,function(t,u,i){e(t,function(t){t||(r(!1),r=n),i()})},function(){r(!0)})},L.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}L.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,o(t.sort(r),function(n){return n.value}))})},L.auto=function(t,r){function u(n){m.unshift(n)}function o(n){for(var t=0;t<m.length;t+=1)if(m[t]===n)return void m.splice(t,1)}function c(){l--,i(m.slice(0),function(n){n()})}r=e(r||n);var f=U(t),l=f.length;if(!l)return r(null);var p={},m=[];u(function(){l||r(null,p)}),i(f,function(n){function e(t){var e=s(arguments,1);if(e.length<=1&&(e=e[0]),t){var u={};i(U(p),function(n){u[n]=p[n]}),u[n]=e,r(t,u)}else p[n]=e,L.setImmediate(c)}function f(){return a(g,function(n,t){return n&&p.hasOwnProperty(t)},!0)&&!p.hasOwnProperty(n)}function l(){f()&&(o(l),h[h.length-1](e,p))}for(var m,h=P(t[n])?t[n]:[t[n]],g=h.slice(0,Math.abs(h.length-1))||[],d=g.length;d--;){if(!(m=t[g[d]]))throw new Error("Has inexistant dependency");if(P(m)&&~m.indexOf(n))throw new Error("Has cyclic dependencies")}f()?h[h.length-1](e,p):u(l)})},L.retry=function(){function n(n,t){if("number"==typeof t)n.times=parseInt(t,10)||e;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||e,n.interval=parseInt(t.interval,10)||r}}function t(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;i.times;){var o=!(i.times-=1);u.push(e(i.task,o)),!o&&i.interval>0&&u.push(r(i.interval))}L.series(u,function(t,e){e=e[e.length-1],(n||i.callback)(e.err,e.result)})}var e=5,r=0,u=[],i={times:e,interval:r};switch(arguments.length){case 1:i.task=arguments[0];break;case 2:"number"==typeof arguments[0]||"object"==typeof arguments[0]?(n(i,arguments[0]),i.task=arguments[1]):(i.task=arguments[0],i.callback=arguments[1]);break;case 3:n(i,arguments[0]),i.task=arguments[1],i.callback=arguments[2];break;default:throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)")}return i.callback?t():t},L.waterfall=function(t,r){function u(n){return function(t){if(t)r.apply(null,arguments);else{var e=s(arguments,1),i=n.next();i?e.push(u(i)):e.push(r),j(n).apply(null,e)}}}if(r=e(r||n),!P(t)){var i=new Error("First argument to waterfall must be an array of functions");return r(i)}return t.length?void u(L.iterator(t))():r()},L.parallel=function(n,t){O(L.eachOf,n,t)},L.parallelLimit=function(n,t,e){O(m(t),n,e)},L.series=function(t,e){e=e||n;var u=r(t)?[]:{};L.eachOfSeries(t,function(n,t,e){n(function(n){var r=s(arguments,1);r.length<=1&&(r=r[0]),u[t]=r,e(n)})},function(n){e(n,u)})},L.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},L.apply=function(n){var t=s(arguments,1);return function(){return n.apply(null,t.concat(s(arguments)))}},L.concat=h(x),L.concatSeries=d(x),L.whilst=function(t,e,r){r=r||n,t()?e(function(n){return n?r(n):void L.whilst(t,e,r)}):r(null)},L.doWhilst=function(t,e,r){r=r||n,t(function(n){if(n)return r(n);var u=s(arguments,1);e.apply(null,u)?L.doWhilst(t,e,r):r(null)})},L.until=function(t,e,r){r=r||n,t()?r(null):e(function(n){return n?r(n):void L.until(t,e,r)})},L.doUntil=function(t,e,r){r=r||n,t(function(n){if(n)return r(n);var u=s(arguments,1);e.apply(null,u)?r(null):L.doUntil(t,e,r)})},L.during=function(t,e,r){r=r||n,t(function(n,u){return n?r(n):void(u?e(function(n){return n?r(n):void L.during(t,e,r)}):r(null))})},L.doDuring=function(t,e,r){r=r||n,t(function(n){if(n)return r(n);var u=s(arguments,1);u.push(function(n,u){return n?r(n):void(u?L.doDuring(t,e,r):r(null))}),e.apply(null,u)})},L.queue=function(n,t){var e=S(function(t,e){n(t[0],e)},t,1);return e},L.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function o(t,e,o,c){if(null!=c&&"function"!=typeof c)throw new Error("task callback must be a function");return t.started=!0,P(e)||(e=[e]),0===e.length?L.setImmediate(function(){t.drain()}):void i(e,function(e){var i={data:e,priority:o,callback:"function"==typeof c?c:n};t.tasks.splice(u(t.tasks,i,r)+1,0,i),t.tasks.length===t.concurrency&&t.saturated(),L.setImmediate(t.process)})}var c=L.queue(t,e);return c.push=function(n,t,e){o(c,n,t,e)},delete c.unshift,c},L.cargo=function(n,t){return S(n,1,t)},L.log=E("log"),L.dir=E("dir"),L.memoize=function(n,t){function e(){var e=s(arguments),i=e.pop(),o=t.apply(null,e);o in r?L.nextTick(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,e.concat([function(){r[o]=s(arguments);var n=u[o];delete u[o];for(var t=0,e=n.length;e>t;t++)n[t].apply(null,arguments)}])))}var r={},u={};return t=t||function(n){return n},e.memo=r,e.unmemoized=n,e},L.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},L.times=I(L.map),L.timesSeries=I(L.mapSeries),L.timesLimit=function(n,t,e,r){return L.mapLimit(c(n),t,e,r)},L.seq=function(){var t=arguments;return function(){var e=this,r=s(arguments),u=r.slice(-1)[0];"function"==typeof u?r.pop():u=n,L.reduce(t,r,function(n,t,r){t.apply(e,n.concat([function(){var n=arguments[0],t=s(arguments,1);r(n,t)}]))},function(n,t){u.apply(e,[n].concat(t))})}},L.compose=function(){return L.seq.apply(null,Array.prototype.reverse.call(arguments))},L.applyEach=function(){var n=s(arguments);return T.apply(null,[L.eachOf].concat(n))},L.applyEachSeries=function(){var n=s(arguments);return T.apply(null,[L.eachOfSeries].concat(n))},L.forever=function(e,r){function u(n){return n?i(n):void o(u)}var i=t(r||n),o=j(e);u()},L.ensureAsync=j,L.constant=function(){var n=[null].concat(s(arguments));return function(t){return t.apply(this,n)}},L.wrapSync=L.asyncify=function(n){return function(){var t,e=s(arguments),r=e.pop();try{t=n.apply(this,e)}catch(u){return r(u)}r(null,t)}},"undefined"!=typeof module&&module.exports?module.exports=L:"undefined"!=typeof define&&define.amd?define([],function(){return L}):z.async=L}();
+!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return U(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){return o(n)?a(n,t):p(n,t)}function a(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function f(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function l(n){return f(Array(n),function(n,t){return t})}function s(n,t,e){return a(n,function(n,r,u){e=t(e,n,r,u)}),e}function p(n,t){a(W(n),function(e){t(n[e],e)})}function h(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function m(n){var t,e,r=-1;return o(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function y(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r);case 2:return n.call(this,arguments[0],arguments[1],r)}}}function d(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=m(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function g(n){return function(t,e,r){return n(P.eachOf,t,e,r)}}function k(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function b(n){return function(t,e,r){return n(P.eachOfSeries,t,e,r)}}function w(t,e,r,u){u=i(u||n);var o=[];t(e,function(n,t,e){r(n,function(n,r){o[t]=r,e(n)})},function(n){u(n,o)})}function O(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(f(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function S(n,t,e,r){O(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function E(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function x(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(y(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function I(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function j(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length&&t.idle()?P.setImmediate(function(){t.drain()}):(a(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void P.setImmediate(t.process))}function o(n,t){return function(){c-=1;var e=arguments;a(t,function(n){n.callback.apply(n,e)}),n.tasks.length+c===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var c=0,l={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(l,n,!1,t)},kill:function(){l.drain=n,l.tasks=[]},unshift:function(n,t){i(l,n,!0,t)},process:function(){if(!l.paused&&c<l.concurrency&&l.tasks.length)for(;c<l.concurrency&&l.tasks.length;){var n=l.payload?l.tasks.splice(0,l.payload):l.tasks.splice(0,l.tasks.length),e=f(n,function(n){return n.data});0===l.tasks.length&&l.empty(),c+=1;var r=u(o(l,n));t(e,r)}},length:function(){return l.tasks.length},running:function(){return c},idle:function(){return l.tasks.length+c===0},pause:function(){l.paused=!0},resume:function(){if(l.paused!==!1){l.paused=!1;for(var n=Math.min(l.concurrency,l.tasks.length),t=1;n>=t;t++)P.setImmediate(l.process)}}};return l}function T(n){return y(function(t,e){t.apply(null,e.concat([y(function(t,e){"undefined"!=typeof console&&(t?console.error&&console.error(t):console[n]&&a(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(l(t),e,r)}}function z(n){return y(function(t,e){var r=y(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function q(n){return y(function(t){var e=t.pop();t.push(function(){var n=arguments;r?P.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var C,P={},H="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=H&&(C=H.async),P.noConflict=function(){return H.async=C,P};var M=Object.prototype.toString,U=Array.isArray||function(n){return"[object Array]"===M.call(n)},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?P.nextTick=process.nextTick:P.nextTick=D,P.setImmediate=B?D:P.nextTick,P.forEach=P.each=function(n,t,e){return P.eachOf(n,d(t),e)},P.forEachSeries=P.eachSeries=function(n,t,e){return P.eachOfSeries(n,d(t),e)},P.forEachLimit=P.eachLimit=function(n,t,e,r){return v(t)(n,d(e),r)},P.forEachOf=P.eachOf=function(t,e,r){function a(n){n?r(n):(l+=1,l>=f&&r(null))}r=i(r||n),t=t||[];var f=o(t)?t.length:W(t).length,l=0;return f?void c(t,function(n,r){e(t[r],r,u(a))}):r(null)},P.forEachOfSeries=P.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?P.nextTick(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=m(t),a=c();o()},P.forEachOfLimit=P.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},P.map=g(w),P.mapSeries=b(w),P.mapLimit=k(w),P.inject=P.foldl=P.reduce=function(n,t,e,r){P.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n||null,t)})},P.foldr=P.reduceRight=function(n,e,r,u){var i=f(n,t).reverse();P.reduce(i,e,r,u)},P.select=P.filter=g(O),P.selectLimit=P.filterLimit=k(O),P.selectSeries=P.filterSeries=b(O),P.reject=g(S),P.rejectLimit=k(S),P.rejectSeries=b(S),P.any=P.some=E(P.eachOf,e,t),P.someLimit=E(P.eachOfLimit,e,t),P.all=P.every=E(P.eachOf,r,r),P.everyLimit=E(P.eachOfLimit,r,r),P.detect=E(P.eachOf,t,x),P.detectSeries=E(P.eachOfSeries,t,x),P.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}P.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,f(t.sort(r),function(n){return n.value}))})},P.auto=function(t,e){function r(n){m.unshift(n)}function u(n){var t=h(m,n);t>=0&&m.splice(t,1)}function o(){f--,a(m.slice(0),function(n){n()})}e=i(e||n);var c=W(t),f=c.length;if(!f)return e(null);var l={},m=[];r(function(){f||e(null,l)}),a(c,function(n){function i(){return s(d,function(n,t){return n&&l.hasOwnProperty(t)},!0)&&!l.hasOwnProperty(n)}function c(){i()&&(u(c),f[f.length-1](m,l))}for(var a,f=U(t[n])?t[n]:[t[n]],m=y(function(t,r){if(r.length<=1&&(r=r[0]),t){var u={};p(l,function(n,t){u[t]=n}),u[n]=r,e(t,u)}else l[n]=r,P.setImmediate(o)}),d=f.slice(0,f.length-1),v=d.length;v--;){if(!(a=t[d[v]]))throw new Error("Has inexistant dependency");if(U(a)&&h(a,n)>=0)throw new Error("Has cyclic dependencies")}i()?f[f.length-1](m,l):r(c)})},P.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}P.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},P.waterfall=function(t,e){function r(n){return y(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),q(n).apply(null,u)}})}if(e=i(e||n),!U(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(P.iterator(t))():e()},P.parallel=function(n,t){L(P.eachOf,n,t)},P.parallelLimit=function(n,t,e){L(v(t),n,e)},P.series=function(n,t){L(P.eachOfSeries,n,t)},P.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},P.apply=y(function(n,t){return y(function(e){return n.apply(null,t.concat(e))})}),P.concat=g(I),P.concatSeries=b(I),P.whilst=function(t,e,r){if(r=r||n,t()){var u=y(function(n,i){n?r(n):t.apply(this,i)?e(u):r(null)});e(u)}else r(null)},P.doWhilst=function(n,t,e){var r=0;return P.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},P.until=function(n,t,e){return P.whilst(function(){return!n.apply(this,arguments)},t,e)},P.doUntil=function(n,t,e){return P.doWhilst(n,function(){return!t.apply(this,arguments)},e)},P.during=function(t,e,r){r=r||n;var u=y(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},P.doDuring=function(n,t,e){var r=0;P.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},P.queue=function(n,t){var e=j(function(t,e){n(t[0],e)},t,1);return e},P.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length?P.setImmediate(function(){t.drain()}):void a(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)})}var o=P.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},P.cargo=function(n,t){return j(n,1,t)},P.log=T("log"),P.dir=T("dir"),P.memoize=function(n,e){var r={},u={};e=e||t;var i=y(function(t){var i=t.pop(),o=e.apply(null,t);o in r?P.nextTick(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,t.concat([y(function(n){r[o]=n;var t=u[o];delete u[o];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return i.memo=r,i.unmemoized=n,i},P.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},P.times=A(P.map),P.timesSeries=A(P.mapSeries),P.timesLimit=function(n,t,e,r){return P.mapLimit(l(n),t,e,r)},P.seq=function(){var t=arguments;return y(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,P.reduce(t,e,function(n,t,e){t.apply(r,n.concat([y(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},P.compose=function(){return P.seq.apply(null,Array.prototype.reverse.call(arguments))},P.applyEach=z(P.eachOf),P.applyEachSeries=z(P.eachOfSeries),P.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=q(t);r()},P.ensureAsync=q,P.constant=y(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),P.wrapSync=P.asyncify=function(n){return y(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}"undefined"!=typeof e&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"undefined"!=typeof module&&module.exports?module.exports=P:"undefined"!=typeof define&&define.amd?define([],function(){return P}):H.async=P}();
+//# sourceMappingURL=async.min.map \ No newline at end of file