Comparing version 2.0.0-rc.1 to 2.0.0-rc.2
@@ -12,5 +12,5 @@ 'use strict'; | ||
var _rest = require('lodash/rest'); | ||
var _initialParams = require('./internal/initialParams'); | ||
var _rest2 = _interopRequireDefault(_rest); | ||
var _initialParams2 = _interopRequireDefault(_initialParams); | ||
@@ -20,4 +20,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function asyncify(func) { | ||
return (0, _rest2.default)(function (args) { | ||
var callback = args.pop(); | ||
return (0, _initialParams2.default)(function (args, callback) { | ||
var result; | ||
@@ -24,0 +23,0 @@ try { |
# v2.0.0 | ||
Lots of changes here! The biggest feature is modularization. You can now `require("async/series")` to only require the `series` function. Every Async library function is available this way. You still can `require("async")` to require the entire library, like you could do before. | ||
Lots of changes here! The biggest feature is modularization. You can now `require("async/series")` to only require the `series` function. Every Async library function is available this way. You still can `require("async")` to require the entire library, like you could do before. | ||
We also provide Async as a collection of ES2015 modules. You can now `import {each} from 'async-es'` or `import waterfall from 'async-es/waterfall'`. If you are using only a few Async functions, and are using a ES bundler such as Rollup, this can significantly lower your build size. | ||
We also provide Async as a collection of ES2015 modules. You can now `import {each} from 'async-es'` or `import waterfall from 'async-es/waterfall'`. If you are using only a few Async functions, and are using a ES bundler such as Rollup, this can significantly lower your build size. | ||
Major thanks to [**@Kikobeats**](github.com/Kikobeats), [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for doing the majority of the modularization work, as well as [**@jdalton**](github.com/jdalton) and [**@Rich-Harris**](github.com/Rich-Harris) for advisory work on the general modularization strategy. | ||
Another one of the general themes of the 2.0 release is standardization of what an "async" function is. We are now more strictly following the node-style continuation passing style. That is, an async function is a function that: | ||
Another one of the general themes of the 2.0 release is standardization of what an "async" function is. We are now more strictly following the node-style continuation passing style. That is, an async function is a function that: | ||
@@ -20,9 +20,10 @@ 1. Takes a variable number of arguments | ||
Another theme is performance. We have eliminated internal deferrals in all cases where they make sense. For example, in `waterfall` and `auto`, there was a `setImmediate` between each task -- these deferrals have been removed. A `setImmediate` call can add up to 1ms of delay. This might not seem like a lot, but it can add up if you are using many Async functions in the course of processing a HTTP request, for example. Nearly all asynchronous functions that do I/O already have some sort of deferral built in, so the extra deferral is unnecessary. The trade-off of this change is removing our built-in stack-overflow defense. Many synchronous callback calls in series can quickly overflow the JS call stack. If you do have a function that is sometimes synchronous (calling its callback on the same tick), and are running into stack overflows, wrap it with `async.ensureAsync()`. | ||
Another theme is performance. We have eliminated internal deferrals in all cases where they make sense. For example, in `waterfall` and `auto`, there was a `setImmediate` between each task -- these deferrals have been removed. A `setImmediate` call can add up to 1ms of delay. This might not seem like a lot, but it can add up if you are using many Async functions in the course of processing a HTTP request, for example. Nearly all asynchronous functions that do I/O already have some sort of deferral built in, so the extra deferral is unnecessary. The trade-off of this change is removing our built-in stack-overflow defense. Many synchronous callback calls in series can quickly overflow the JS call stack. If you do have a function that is sometimes synchronous (calling its callback on the same tick), and are running into stack overflows, wrap it with `async.ensureAsync()`. | ||
## New Features | ||
- Async is now modularized. Individual functions can be `require()`d from the main package. (`require('async/auto')`) (#696) | ||
- Async is also available as a collection of ES2015 modules in the new `async-es` package. (`import {forEachSeries} from 'async-es'`) (#696) | ||
- Async is now modularized. Individual functions can be `require()`d from the main package. (`require('async/auto')`) (#984, #996) | ||
- Async is also available as a collection of ES2015 modules in the new `async-es` package. (`import {forEachSeries} from 'async-es'`) (#984, #996) | ||
- Added `race`, analogous to `Promise.race()`. It will run an array of async tasks in parallel and will call its callback with the result of the first task to respond. (#568, #1038) | ||
- Array methods now accept ES2015 iterators. Maps, Sets, and anything that implements the iterator spec can now be passed directly to `each`, `map`, `parallel`, etc.. (#579, #839, #1074) | ||
- Added `timeout`, a wrapper for an async function that will make the task time-out after the specified time. (#1007, #1027) | ||
@@ -33,2 +34,3 @@ - `constant` supports dynamic arguments -- it will now always use its last argument as the callback. (#1016, #1052) | ||
- You can now limit the concurrency of `auto` tasks. (#635, #637) | ||
- Added `retryable`, a relative of `retry` that wraps an async function, making it retry when called. | ||
- Added `q.unsaturated` -- callback called when a `queue`'s number of running workers falls below a threshold. (#868, #1030, #1033, #1034) | ||
@@ -38,8 +40,9 @@ | ||
- Calling a callback more than once is considered an error, and an error will be thrown. This had an explicit breaking change in `waterfall`. If you were relying on this behavior, you should more accurately represent your control flow as an event emitter or stream. (#814, #815, #1048, #1050) | ||
- `auto` task functions now always take the callback as the last argument. If a task has dependencies, the `results` object will be passed as the first argument. To migrate old task functions, wrap them with [`_.flip`](https://lodash.com/docs#flip) (#1036, #1042) | ||
- Calling a callback more than once is considered an error, and an error will be thrown. This had an explicit breaking change in `waterfall`. If you were relying on this behavior, you should more accurately represent your control flow as an event emitter or stream. (#814, #815, #1048, #1050) | ||
- `auto` task functions now always take the callback as the last argument. If a task has dependencies, the `results` object will be passed as the first argument. To migrate old task functions, wrap them with [`_.flip`](https://lodash.com/docs#flip) (#1036, #1042) | ||
- Internal `setImmediate` calls have been refactored away. This may make existing flows vulnerable to stack overflows if you use many synchronous functions in series. Use `ensureAsync` to work around this. (#696, #704, #1049, #1050) | ||
- `filter`, `reject`, `some`, `every`, and related functions now expect an error as the first callback argument, rather than just a simple boolean. Pass `null` as the first argument, or use `fs.access` instead of `fs.exists`. (#118, #774, #1028, #1041) | ||
- `{METHOD}` and `{METHOD}Series` are now implemented in terms of `{METHOD}Limit`. This is a major internal simplification, and is not expected to cause many problems, but it does subtly affect how functions execute internally. (#778, #847) | ||
- `retry`'s callback is now optional. Previously, omitting the callback would partially apply the function, meaning it could be passed directly as a task to `series` or `auto`. | ||
- `{METHOD}` and `{METHOD}Series` are now implemented in terms of `{METHOD}Limit`. This is a major internal simplification, and is not expected to cause many problems, but it does subtly affect how functions execute internally. (#778, #847) | ||
- `retry`'s callback is now optional. Previously, omitting the callback would partially apply the function, meaning it could be passed directly as a task to `series` or `auto`. The partially applied "control-flow" behavior has been separated out into `retryable`. | ||
- The timing of the `q.saturated()` callback in a `queue` has been modified to better reflect when tasks pushed to the queue will start queueing. (#724, #1078) | ||
@@ -49,3 +52,3 @@ ## Other | ||
- Added `someSeries` and `everySeries` for symmetry, as well as a complete set of `any`/`anyLimit`/`anySeries` and `all`/`/allLmit`/`allSeries` aliases. | ||
- Added `find` as an alias for `detect` (as well as `findLimit` and `findSeries`). | ||
- Added `find` as an alias for `detect. (as well as `findLimit` and `findSeries`). | ||
- Various doc fixes (#1005, #1008, #1010, #1015, #1021, #1037) | ||
@@ -64,3 +67,3 @@ | ||
- `auto` will properly handle concurrency when there is no callback (#966) | ||
- `auto` will now properly stop execution when an error occurs (#988, #993) | ||
- `auto` will no. properly stop execution when an error occurs (#988, #993) | ||
- Various doc fixes (#971, #980) | ||
@@ -72,4 +75,4 @@ | ||
- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873) | ||
- `auto` now accepts an optional `concurrency` argument to limit the number of running tasks (#637) | ||
- Added `queue#workersList()`, to retrieve the list of currently running tasks. (#891) | ||
- `auto` now accepts an optional `concurrency` argument to limit the number o. running tasks (#637) | ||
- Added `queue#workersList()`, to retrieve the lis. of currently running tasks. (#891) | ||
- Various code simplifications (#896, #904) | ||
@@ -120,3 +123,3 @@ - Various doc fixes :scroll: (#890, #894, #903, #905, #912) | ||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) | ||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) | ||
@@ -129,3 +132,3 @@ | ||
- Added `timesLimit` (#743) | ||
- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772) | ||
- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772) | ||
@@ -141,3 +144,3 @@ Bug Fixes: | ||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) | ||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) | ||
@@ -144,0 +147,0 @@ |
{ | ||
"name": "async", | ||
"description": "Higher-order functions and common patterns for asynchronous code", | ||
"version": "2.0.0-rc.1", | ||
"version": "2.0.0-rc.2", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "async", |
@@ -11,2 +11,6 @@ 'use strict'; | ||
var _initialParams = require('./internal/initialParams'); | ||
var _initialParams2 = _interopRequireDefault(_initialParams); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -16,7 +20,6 @@ | ||
var args = [null].concat(values); | ||
return function () { | ||
var callback = [].slice.call(arguments).pop(); | ||
return (0, _initialParams2.default)(function (ignoredArgs, callback) { | ||
return callback.apply(this, args); | ||
}; | ||
}); | ||
}); | ||
module.exports = exports['default']; |
@@ -1,2 +0,2 @@ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.async=t.async||{})}(this,function(t){"use strict";function n(t,n,r){var e=r.length;switch(e){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function r(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function e(t){var n=r(t)?Xn.call(t):"";return n==Jn||n==Kn}function o(t){if(r(t)){var n=e(t.valueOf)?t.valueOf():t;t=r(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Zn,"");var o=nr.test(t);return o||rr.test(t)?er(t.slice(2),o?2:8):tr.test(t)?Yn:+t}function u(t){if(!t)return 0===t?t:0;if(t=o(t),t===or||t===-or){var n=0>t?-1:1;return n*ur}var r=t%1;return t===t?r?t-r:t:0}function i(t,r){if("function"!=typeof t)throw new TypeError(ir);return r=cr(void 0===r?t.length-1:u(r),0),function(){for(var e=arguments,o=-1,u=cr(e.length-r,0),i=Array(u);++o<u;)i[o]=e[r+o];switch(r){case 0:return t.call(this,i);case 1:return t.call(this,e[0],i);case 2:return t.call(this,e[0],e[1],i)}var c=Array(r+1);for(o=-1;++o<r;)c[o]=e[o];return c[r]=i,n(t,this,c)}}function c(t){return i(function(n,r){var e=i(function(r){var e=this,o=r.pop();return t(n,function(t,n,o){t.apply(e,r.concat([o]))},o)});return r.length?e.apply(this,r):e})}function a(){}function f(t,n){var r;if("function"!=typeof n)throw new TypeError(ar);return t=u(t),function(){return--t>0&&(r=n.apply(this,arguments)),1>=t&&(n=void 0),r}}function l(t){return f(2,t)}function s(t){return function(n){return null==n?void 0:n[t]}}function p(t){return"number"==typeof t&&t>-1&&t%1==0&&lr>=t}function y(t){return null!=t&&p(fr(t))&&!e(t)}function h(t,n){return pr.call(t,n)||"object"==typeof t&&n in t&&null===yr(t)}function v(t){return hr(Object(t))}function d(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function m(t){return!!t&&"object"==typeof t}function g(t){return m(t)&&y(t)}function b(t){return g(t)&&mr.call(t,"callee")&&(!br.call(t,"callee")||gr.call(t)==vr)}function j(t){return"string"==typeof t||!jr(t)&&m(t)&&Sr.call(t)==wr}function w(t){var n=t?t.length:void 0;return p(n)&&(jr(t)||j(t)||b(t))?d(n,String):null}function O(t,n){return t="number"==typeof t||kr.test(t)?+t:-1,n=null==n?_r:n,t>-1&&t%1==0&&n>t}function S(t){var n=t&&t.constructor,r="function"==typeof n&&n.prototype||Er;return t===r}function _(t){var n=S(t);if(!n&&!y(t))return v(t);var r=w(t),e=!!r,o=r||[],u=o.length;for(var i in t)!h(t,i)||e&&("length"==i||O(i,u))||n&&"constructor"==i||o.push(i);return o}function k(t){var n,r=-1;if(y(t))return n=t.length,function(){return r++,n>r?r:null};var e=_(t);return n=e.length,function(){return r++,n>r?e[r]:null}}function E(t){return function(){if(null===t)throw new Error("Callback was already called.");t.apply(this,arguments),t=null}}function A(t){return function(n,r,e){e=l(e||a),n=n||[];var o=k(n);if(0>=t)return e(null);var u=!1,i=0,c=!1;!function f(){if(u&&0>=i)return e(null);for(;t>i&&!c;){var a=o();if(null===a)return u=!0,void(0>=i&&e(null));i+=1,r(n[a],a,E(function(t){i-=1,t?(e(t),c=!0):f()}))}}()}}function L(t,n,r,e){A(n)(t,r,e)}function x(t,n){return function(r,e,o){return t(r,n,e,o)}}function I(t){return i(function(n){var e,o=n.pop();try{e=t.apply(this,n)}catch(u){return o(u)}r(e)&&"function"==typeof e.then?e.then(function(t){o(null,t)})["catch"](function(t){o(t.message?t:new Error(t))}):o(null,e)})}function T(t,n){for(var r=-1,e=t.length;++r<e&&n(t[r],r,t)!==!1;);return t}function F(t){return t}function M(t){return"function"==typeof t?t:F}function $(t){return function(n,r,e){for(var o=-1,u=Object(n),i=e(n),c=i.length;c--;){var a=i[t?c:++o];if(r(u[a],a,u)===!1)break}return n}}function U(t,n){return t&&Fr(t,n,_)}function P(t,n){return t&&U(t,M(n))}function z(t,n,r){for(var e=t.length,o=n+(r?0:-1);r?o--:++o<e;){var u=t[o];if(u!==u)return o}return-1}function B(t,n,r){if(n!==n)return z(t,r);for(var e=r-1,o=t.length;++e<o;)if(t[e]===n)return e;return-1}function C(t,n,r){var e=t?t.length:0;return e?(r=u(r),0>r&&(r=Mr(e+r,0)),B(t,n,r)):-1}function q(t,n,r){function e(t,n){m.push(function(){f(t,n)})}function o(){if(0===m.length&&0===h)return r(null,y);for(;m.length&&n>h;){var t=m.shift();t()}}function u(t,n){var r=d[t];r||(r=d[t]=[]),r.push(n)}function c(t){var n=d[t]||[];T(n,function(t){t()}),o()}function f(t,n){if(!v){var e=E(i(function(n,e){if(h--,e.length<=1&&(e=e[0]),n){var o={};P(y,function(t,n){o[n]=t}),o[t]=e,v=!0,d=[],r(n,o)}else y[t]=e,c(t)}));h++;var o=n[n.length-1];n.length>1?o(y,e):o(e)}}"function"==typeof n&&(r=n,n=null),r=l(r||a);var s=_(t),p=s.length;if(!p)return r(null);n||(n=p);var y={},h=0,v=!1,d={},m=[];P(t,function(n,r){function o(){for(var n,e=i.length;e--;){if(!(n=t[i[e]]))throw new Error("async.auto task `"+r+"` has non-existent dependency in "+i.join(", "));if(jr(n)&&C(n,r)>=0)throw new Error("async.auto task `"+r+"`Has cyclic dependencies")}}if(!jr(n))return void e(r,[n]);var i=n.slice(0,n.length-1),c=i.length;o(),T(i,function(t){u(t,function(){c--,0===c&&e(r,n)})})}),o()}function D(t,n){for(var r=-1,e=t.length,o=Array(e);++r<e;)o[r]=n(t[r],r,t);return o}function R(){this.__data__={array:[],map:null}}function W(t,n){return t===n||t!==t&&n!==n}function N(t,n){for(var r=t.length;r--;)if(W(t[r][0],n))return r;return-1}function G(t,n){var r=N(t,n);if(0>r)return!1;var e=t.length-1;return r==e?t.pop():Ur.call(t,r,1),!0}function Q(t){var n=this.__data__,r=n.array;return r?G(r,t):n.map["delete"](t)}function H(t,n){var r=N(t,n);return 0>r?void 0:t[r][1]}function J(t){var n=this.__data__,r=n.array;return r?H(r,t):n.map.get(t)}function K(t,n){return N(t,n)>-1}function V(t){var n=this.__data__,r=n.array;return r?K(r,t):n.map.has(t)}function X(t){var n=!1;if(null!=t&&"function"!=typeof t.toString)try{n=!!(t+"")}catch(r){}return n}function Y(t){return null==t?!1:e(t)?Dr.test(Cr.call(t)):m(t)&&(X(t)?Dr:zr).test(t)}function Z(t,n){var r=t[n];return Y(r)?r:void 0}function tt(){}function nt(t){return t&&t.Object===Object?t:null}function rt(){this.__data__={hash:new tt,map:Yr?new Yr:[],string:new tt}}function et(t,n){return Rr?void 0!==t[n]:te.call(t,n)}function ot(t,n){return et(t,n)&&delete t[n]}function ut(t){var n=typeof t;return"number"==n||"boolean"==n||"string"==n&&"__proto__"!=t||null==t}function it(t){var n=this.__data__;return ut(t)?ot("string"==typeof t?n.string:n.hash,t):Yr?n.map["delete"](t):G(n.map,t)}function ct(t,n){if(Rr){var r=t[n];return r===ne?void 0:r}return ee.call(t,n)?t[n]:void 0}function at(t){var n=this.__data__;return ut(t)?ct("string"==typeof t?n.string:n.hash,t):Yr?n.map.get(t):H(n.map,t)}function ft(t){var n=this.__data__;return ut(t)?et("string"==typeof t?n.string:n.hash,t):Yr?n.map.has(t):K(n.map,t)}function lt(t,n,r){var e=N(t,n);0>e?t.push([n,r]):t[e][1]=r}function st(t,n,r){t[n]=Rr&&void 0===r?oe:r}function pt(t,n){var r=this.__data__;return ut(t)?st("string"==typeof t?r.string:r.hash,t,n):Yr?r.map.set(t,n):lt(r.map,t,n),this}function yt(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function ht(t,n){var r=this.__data__,e=r.array;e&&(e.length<ue-1?lt(e,t,n):(r.array=null,r.map=new yt(e)));var o=r.map;return o&&o.set(t,n),this}function vt(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function dt(t,n,r){var e=t[n];ce.call(t,n)&&W(e,r)&&(void 0!==r||n in t)||(t[n]=r)}function mt(t,n,r,e){r||(r={});for(var o=-1,u=n.length;++o<u;){var i=n[o],c=e?e(r[i],t[i],i,r,t):t[i];dt(r,i,c)}return r}function gt(t,n,r){return mt(t,n,r)}function bt(t,n){return t&>(n,_(n),t)}function jt(t,n){if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function wt(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r<e;)n[r]=t[r];return n}function Ot(t,n){return gt(t,fe(t),n)}function St(t){return ge.call(t)}function _t(t){var n=t.length,r=t.constructor(n);return n&&"string"==typeof t[0]&&_e.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function kt(t){var n=new t.constructor(t.byteLength);return new ke(n).set(new ke(t)),n}function Et(t,n){return t.set(n[0],n[1]),t}function At(t,n,r,e){var o=-1,u=t.length;for(e&&u&&(r=t[++o]);++o<u;)r=n(r,t[o],o,t);return r}function Lt(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function xt(t){return At(Lt(t),Et,new t.constructor)}function It(t){var n=new t.constructor(t.source,Ee.exec(t));return n.lastIndex=t.lastIndex,n}function Tt(t,n){return t.add(n),t}function Ft(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=t}),r}function Mt(t){return At(Ft(t),Tt,new t.constructor)}function $t(t){return xe?Object(xe.call(t)):{}}function Ut(t,n){var r=n?kt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Pt(t,n,r){var e=t.constructor;switch(n){case Be:return kt(t);case Ie:case Te:return new e(+t);case Ce:case qe:case De:case Re:case We:case Ne:case Ge:case Qe:case He:return Ut(t,r);case Fe:return xt(t);case Me:case Pe:return new e(t);case $e:return It(t);case Ue:return Mt(t);case ze:return $t(t)}}function zt(t){return r(t)?Je(t):{}}function Bt(t){return"function"!=typeof t.constructor||S(t)?{}:zt(Ke(t))}function Ct(t){return function(){return t}}function qt(t,n,e,o,u,i,c){var a;if(o&&(a=i?o(t,u,i,c):o(t)),void 0!==a)return a;if(!r(t))return t;var f=jr(t);if(f){if(a=_t(t),!n)return wt(t,a)}else{var l=Oe(t),s=l==co||l==ao;if(no(t))return jt(t,n);if(l==so||l==ro||s&&!i){if(X(t))return i?t:{};if(a=Bt(s?{}:t),!n)return a=bt(a,t),e?Ot(t,a):a}else{if(!Lo[l])return i?t:{};a=Pt(t,l,n)}}c||(c=new vt);var p=c.get(t);return p?p:(c.set(t,a),(f?T:U)(t,function(r,u){dt(a,u,qt(r,n,e,o,u,t,c))}),e&&!f?Ot(t,a):a)}function Dt(t){return t.toString().match(Io)[1].split(/\s*\,\s*/)}function Rt(t,n){var r={};P(t,function(t,n){function e(n,r){var e=D(o,function(t){return n[t]});e.push(r),t.apply(null,e)}var o;if(jr(t))o=qt(t),t=o.pop(),r[n]=o.concat(e);else{if(0===t.length)throw new Error("autoInject task functions require explicit parameters.");1===t.length?r[n]=t:(o=Dt(t),o.pop(),r[n]=o.concat(e))}}),q(r,n)}function Wt(t,n,r){function e(t,n,r,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");return t.started=!0,jr(n)||(n=[n]),0===n.length&&t.idle()?Fo(function(){t.drain()}):(T(n,function(n){var o={data:n,callback:e||a};r?t.tasks.unshift(o):t.tasks.push(o),t.tasks.length===t.concurrency&&t.saturated(),t.tasks.length<=t.concurrency-t.buffer&&t.unsaturated()}),void Fo(t.process))}function o(t,n){return function(){u-=1;var r=!1,e=arguments;T(n,function(t){T(i,function(n,e){n!==t||r||(i.splice(e,1),r=!0)}),t.callback.apply(t,e)}),t.tasks.length+u===0&&t.drain(),t.process()}}if(null==n)n=1;else if(0===n)throw new Error("Concurrency must not be zero");var u=0,i=[],c={tasks:[],concurrency:n,payload:r,saturated:a,unsaturated:a,buffer:n/4,empty:a,drain:a,started:!1,paused:!1,push:function(t,n){e(c,t,!1,n)},kill:function(){c.drain=a,c.tasks=[]},unshift:function(t,n){e(c,t,!0,n)},process:function(){for(;!c.paused&&u<c.concurrency&&c.tasks.length;){var n=c.payload?c.tasks.splice(0,c.payload):c.tasks.splice(0,c.tasks.length),r=D(n,s("data"));0===c.tasks.length&&c.empty(),u+=1,i.push(n[0]);var e=E(o(c,n));t(r,e)}},length:function(){return c.tasks.length},running:function(){return u},workersList:function(){return i},idle:function(){return c.tasks.length+u===0},pause:function(){c.paused=!0},resume:function(){if(c.paused!==!1){c.paused=!1;for(var t=Math.min(c.concurrency,c.tasks.length),n=1;t>=n;n++)Fo(c.process)}}};return c}function Nt(t,n){return Wt(t,1,n)}function Gt(t,n,r,e){xr(t,function(t,e,o){r(n,t,function(t,r){n=r,o(t)})},function(t){e(t,n)})}function Qt(){var t=arguments;return i(function(n){var r=this,e=n[n.length-1];"function"==typeof e?n.pop():e=a,Gt(t,n,function(t,n,e){n.apply(r,t.concat([i(function(t,n){e(t,n)})]))},function(t,n){e.apply(r,[t].concat(n))})})}function Ht(){return Qt.apply(null,Mo.call(arguments))}function Jt(t,n,r,e){var o=[];t(n,function(t,n,e){r(t,function(t,n){o=o.concat(n||[]),e(t)})},function(t){e(t,o)})}function Kt(t){return function(n,r,e){return t(Ar,n,r,e)}}function Vt(t){return function(n,r,e){return t(xr,n,r,e)}}function Xt(t,n,r){return function(e,o,u,i){function c(t){i&&(t?i(t):i(null,r(!1)))}function a(t,e,o){return i?void u(t,function(e,c){i&&(e?(i(e),i=u=!1):n(c)&&(i(null,r(!0,t)),i=u=!1)),o()}):o()}arguments.length>3?t(e,o,a,c):(i=u,u=o,t(e,a,c))}}function Yt(t,n){return n}function Zt(t){return i(function(n,r){n.apply(null,r.concat([i(function(n,r){"object"==typeof console&&(n?console.error&&console.error(n):console[t]&&T(r,function(n){console[t](n)}))})]))})}function tn(t,n,r){r=r||a;var e=i(function(n,e){n?r(n):(e.push(o),t.apply(this,e))}),o=function(t,o){return t?r(t):o?void n(e):r(null)};t(o)}function nn(t,n,r){var e=0;tn(function(t){return e++<1?t(null,!0):void n.apply(this,arguments)},t,r)}function rn(t,n,r){if(r=r||a,!t())return r(null);var e=i(function(o,u){return o?r(o):t.apply(this,u)?n(e):void r.apply(null,[null].concat(u))});n(e)}function en(t,n,r){var e=0;return rn(function(){return++e<=1||n.apply(this,arguments)},t,r)}function on(t,n,r){return en(t,function(){return!n.apply(this,arguments)},r)}function un(t){return function(n,r,e){return t(n,e)}}function cn(t,n,r,e){return A(n)(t,un(r),e)}function an(t){return i(function(n){var r=n.pop(),e=!0;n.push(function(){var t=arguments;e?Fo(function(){r.apply(null,t)}):r.apply(null,t)}),t.apply(this,n),e=!1})}function fn(t){return!t}function ln(t,n,r,e){var o=[];t(n,function(t,n,e){r(t,function(r,u){r?e(r):(u&&o.push({index:n,value:t}),e())})},function(t){t?e(t):e(null,D(o.sort(function(t,n){return t.index-n.index}),s("value")))})}function sn(t){return function(n,r,e,o){return t(A(r),n,e,o)}}function pn(t,n){function r(t){return t?e(t):void o(r)}var e=E(n||a),o=an(t);r()}function yn(t){function n(r){function e(){return t.length&&t[r].apply(null,arguments),e.next()}return e.next=function(){return r<t.length-1?n(r+1):null},e}return n(0)}function hn(t,n,r,e){e=l(e||a),n=n||[];var o=y(n)?[]:{};t(n,function(t,n,e){r(t,function(t,r){o[n]=r,e(t)})},function(t){e(t,o)})}function vn(t){return"symbol"==typeof t||m(t)&&nu.call(t)==Zo}function dn(t){if("string"==typeof t)return t;if(null==t)return"";if(vn(t))return ou?ou.call(t):"";var n=t+"";return"0"==n&&1/t==-ru?"-0":n}function mn(t){var n=[];return dn(t).replace(uu,function(t,r,e,o){n.push(e?o.replace(iu,"$1"):r||t)}),n}function gn(t){return jr(t)?t:mn(t)}function bn(t,n){return"number"==typeof t?!0:!jr(t)&&(au.test(t)||!cu.test(t)||null!=n&&t in Object(n))}function jn(t){var n=t?t.length:0;return n?t[n-1]:void 0}function wn(t,n,r){var e=-1,o=t.length;0>n&&(n=-n>o?0:o+n),r=r>o?o:r,0>r&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var u=Array(o);++e<o;)u[e]=t[e+n];return u}function On(t,n){n=bn(n,t)?[n+""]:gn(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[n[r++]];return r&&r==e?t:void 0}function Sn(t,n,r){var e=null==t?void 0:On(t,n);return void 0===e?r:e}function _n(t,n){return 1==n.length?t:Sn(t,wn(n,0,-1))}function kn(t,n,r){if(null==t)return!1;var e=r(t,n);e||bn(n)||(n=gn(n),t=_n(t,n),null!=t&&(n=jn(n),e=r(t,n)));var o=t?t.length:void 0;return e||!!o&&p(o)&&O(n,o)&&(jr(t)||j(t)||b(t))}function En(t,n){return kn(t,n,h)}function An(t,n){var r=Object.create(null),e=Object.create(null);n=n||F;var o=i(function(o){var u=o.pop(),c=n.apply(null,o);En(r,c)?Fo(function(){u.apply(null,r[c])}):En(e,c)?e[c].push(u):(e[c]=[u],t.apply(null,o.concat([i(function(t){r[c]=t;var n=e[c];delete e[c];for(var o=0,u=n.length;u>o;o++)n[o].apply(null,t)})])))});return o.memo=r,o.unmemoized=t,o}function Ln(t,n,r){r=r||a;var e=y(n)?[]:{};t(n,function(t,n,r){t(i(function(t,o){o.length<=1&&(o=o[0]),e[n]=o,r(t)}))},function(t){r(t,e)})}function xn(t,n,r){return Ln(A(n),t,r)}function In(t,n){return Wt(function(n,r){t(n[0],r)},n,1)}function Tn(t,n){function r(t,n){return t.priority-n.priority}function e(t,n,r){for(var e=-1,o=t.length-1;o>e;){var u=e+(o-e+1>>>1);r(n,t[u])>=0?e=u:o=u-1}return e}function o(t,n,o,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,jr(n)||(n=[n]),0===n.length?Fo(function(){t.drain()}):void T(n,function(n){var i={data:n,priority:o,callback:"function"==typeof u?u:a};t.tasks.splice(e(t.tasks,i,r)+1,0,i),t.tasks.length===t.concurrency&&t.saturated(),t.tasks.length<=t.concurrency-t.buffer&&t.unsaturated(),Fo(t.process)})}var u=In(t,n);return u.push=function(t,n,r){o(u,t,n,r)},delete u.unshift,u}function Fn(t,n){return function(r,e){if(null==r)return r;if(!y(r))return t(r,e);for(var o=r.length,u=n?o:-1,i=Object(r);(n?u--:++u<o)&&e(i[u],u,i)!==!1;);return r}}function Mn(t,n){return"function"==typeof n&&jr(t)?T(t,n):lu(t,M(n))}function $n(t,n){return n=l(n||a),jr(t)?t.length?void Mn(t,function(t){t(n)}):n():n(new TypeError("First argument to race must be an array of functions"))}function Un(t,n,r,e){var o=su.call(t).reverse();Gt(o,n,r,e)}function Pn(t,n,r,e){ln(t,n,function(t,n){r(t,function(t,r){t?n(t):n(null,!r)})},e)}function zn(t,n){return Ln(xr,t,n)}function Bn(t,n,r){function e(t,n){if("object"==typeof n)t.times=+n.times||i,t.interval=+n.interval||c;else{if("number"!=typeof n&&"string"!=typeof n)throw new Error("Invalid arguments for async.retry");t.times=+n||i}}function o(t){return function(r){n(function(n,e){r(!n||t,{err:n,result:e})})}}function u(t){return function(n){setTimeout(function(){n(null)},t)}}var i=5,c=0,f={times:i,interval:c};if(arguments.length<3&&"function"==typeof t?(r=n||a,n=t):(e(f,t),r=r||a),"function"!=typeof n)throw new Error("Invalid arguments for async.retry");for(var l=[];f.times;){var s=!(f.times-=1);l.push(o(s)),!s&&f.interval>0&&l.push(u(f.interval))}zn(l,function(t,n){n=n[n.length-1],r(n.err,n.result)})}function Cn(t,n){return n||(n=t,t=null),i(function(r){function e(t){n.apply(null,r.concat([t]))}var o=r.pop();t?Bn(t,e,o):Bn(e,o)})}function qn(t,n,r){function e(t,n){var r=t.criteria,e=n.criteria;return e>r?-1:r>e?1:0}Xo(t,function(t,r){n(t,function(n,e){return n?r(n):void r(null,{value:t,criteria:e})})},function(t,n){return t?r(t):void r(null,D(n.sort(e),s("value")))})}function Dn(t,n){function r(){a||(i.apply(null,arguments),clearTimeout(c))}function e(){var t=new Error("Callback function timed out.");t.code="ETIMEDOUT",a=!0,i(t)}function o(t){var n=Array.prototype.slice.call(t,0);return i=n[n.length-1],n[n.length-1]=r,n}function u(){c=setTimeout(e,n),t.apply(null,o(arguments))}var i,c,a=!1;return u}function Rn(t,n,r,e){for(var o=-1,u=bu(gu((n-t)/(r||1)),0),i=Array(u);u--;)i[e?u:++o]=t,t+=r;return i}function Wn(t,n,r,e){return Vo(Rn(0,t,1),n,r,e)}function Nn(t,n,r,e){3===arguments.length&&(e=r,r=n,n=jr(t)?[]:{}),Ar(t,function(t,e,o){r(n,t,e,o)},function(t){e(t,n)})}function Gn(t){return function(){return(t.unmemoized||t).apply(null,arguments)}}function Qn(t,n,r){return rn(function(){return!t.apply(this,arguments)},n,r)}function Hn(t,n){function r(o){if(e===t.length)return n.apply(null,[null].concat(o));var u=E(i(function(t,e){return t?n.apply(null,[t].concat(e)):void r(e)}));o.push(u);var c=t[e++];c.apply(null,o)}if(n=l(n||a),!jr(t))return n(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return n();var e=0;r([])}var Jn="[object Function]",Kn="[object GeneratorFunction]",Vn=Object.prototype,Xn=Vn.toString,Yn=NaN,Zn=/^\s+|\s+$/g,tr=/^[-+]0x[0-9a-f]+$/i,nr=/^0b[01]+$/i,rr=/^0o[0-7]+$/i,er=parseInt,or=1/0,ur=1.7976931348623157e308,ir="Expected a function",cr=Math.max,ar="Expected a function",fr=s("length"),lr=9007199254740991,sr=Object.prototype,pr=sr.hasOwnProperty,yr=Object.getPrototypeOf,hr=Object.keys,vr="[object Arguments]",dr=Object.prototype,mr=dr.hasOwnProperty,gr=dr.toString,br=dr.propertyIsEnumerable,jr=Array.isArray,wr="[object String]",Or=Object.prototype,Sr=Or.toString,_r=9007199254740991,kr=/^(?:0|[1-9]\d*)$/,Er=Object.prototype,Ar=x(L,1/0),Lr=c(Ar),xr=x(L,1),Ir=c(xr),Tr=i(function(t,n){return i(function(r){return t.apply(null,n.concat(r))})}),Fr=$(),Mr=Math.max,$r=Array.prototype,Ur=$r.splice,Pr=/[\\^$.*+?()[\]{}|]/g,zr=/^\[object .+?Constructor\]$/,Br=Object.prototype,Cr=Function.prototype.toString,qr=Br.hasOwnProperty,Dr=RegExp("^"+Cr.call(qr).replace(Pr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rr=Z(Object,"create"),Wr=Object.prototype;tt.prototype=Rr?Rr(null):Wr;var Nr={"function":!0,object:!0},Gr=Nr[typeof t]&&t&&!t.nodeType?t:void 0,Qr=Nr[typeof module]&&module&&!module.nodeType?module:void 0,Hr=nt(Gr&&Qr&&"object"==typeof global&&global),Jr=nt(Nr[typeof self]&&self),Kr=nt(Nr[typeof window]&&window),Vr=nt(Nr[typeof this]&&this),Xr=Hr||Kr!==(Vr&&Vr.window)&&Kr||Jr||Vr||Function("return this")(),Yr=Z(Xr,"Map"),Zr=Object.prototype,te=Zr.hasOwnProperty,ne="__lodash_hash_undefined__",re=Object.prototype,ee=re.hasOwnProperty,oe="__lodash_hash_undefined__";yt.prototype.clear=rt,yt.prototype["delete"]=it,yt.prototype.get=at,yt.prototype.has=ft,yt.prototype.set=pt;var ue=200;vt.prototype.clear=R,vt.prototype["delete"]=Q,vt.prototype.get=J,vt.prototype.has=V,vt.prototype.set=ht;var ie=Object.prototype,ce=ie.hasOwnProperty,ae=Object.getOwnPropertySymbols,fe=ae||function(){return[]},le=Z(Xr,"Set"),se=Z(Xr,"WeakMap"),pe="[object Map]",ye="[object Object]",he="[object Set]",ve="[object WeakMap]",de=Object.prototype,me=Function.prototype.toString,ge=de.toString,be=Yr?me.call(Yr):"",je=le?me.call(le):"",we=se?me.call(se):"";(Yr&&St(new Yr)!=pe||le&&St(new le)!=he||se&&St(new se)!=ve)&&(St=function(t){var n=ge.call(t),r=n==ye?t.constructor:null,e="function"==typeof r?me.call(r):"";if(e)switch(e){case be:return pe;case je:return he;case we:return ve}return n});var Oe=St,Se=Object.prototype,_e=Se.hasOwnProperty,ke=Xr.Uint8Array,Ee=/\w*$/,Ae=Xr.Symbol,Le=Ae?Ae.prototype:void 0,xe=Le?Le.valueOf:void 0,Ie="[object Boolean]",Te="[object Date]",Fe="[object Map]",Me="[object Number]",$e="[object RegExp]",Ue="[object Set]",Pe="[object String]",ze="[object Symbol]",Be="[object ArrayBuffer]",Ce="[object Float32Array]",qe="[object Float64Array]",De="[object Int8Array]",Re="[object Int16Array]",We="[object Int32Array]",Ne="[object Uint8Array]",Ge="[object Uint8ClampedArray]",Qe="[object Uint16Array]",He="[object Uint32Array]",Je=Object.create,Ke=Object.getPrototypeOf,Ve={"function":!0,object:!0},Xe=Ve[typeof t]&&t&&!t.nodeType?t:void 0,Ye=Ve[typeof module]&&module&&!module.nodeType?module:void 0,Ze=Ye&&Ye.exports===Xe?Xe:void 0,to=Ze?Xr.Buffer:void 0,no=to?function(t){return t instanceof to}:Ct(!1),ro="[object Arguments]",eo="[object Array]",oo="[object Boolean]",uo="[object Date]",io="[object Error]",co="[object Function]",ao="[object GeneratorFunction]",fo="[object Map]",lo="[object Number]",so="[object Object]",po="[object RegExp]",yo="[object Set]",ho="[object String]",vo="[object Symbol]",mo="[object WeakMap]",go="[object ArrayBuffer]",bo="[object Float32Array]",jo="[object Float64Array]",wo="[object Int8Array]",Oo="[object Int16Array]",So="[object Int32Array]",_o="[object Uint8Array]",ko="[object Uint8ClampedArray]",Eo="[object Uint16Array]",Ao="[object Uint32Array]",Lo={};Lo[ro]=Lo[eo]=Lo[go]=Lo[oo]=Lo[uo]=Lo[bo]=Lo[jo]=Lo[wo]=Lo[Oo]=Lo[So]=Lo[fo]=Lo[lo]=Lo[so]=Lo[po]=Lo[yo]=Lo[ho]=Lo[vo]=Lo[_o]=Lo[ko]=Lo[Eo]=Lo[Ao]=!0,Lo[io]=Lo[co]=Lo[mo]=!1;var xo,Io=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,To="function"==typeof setImmediate&&setImmediate;xo=To?To:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:function(t){setTimeout(t,0)};var Fo=i(function(t,n){xo(function(){t.apply(null,n)})}),Mo=Array.prototype.reverse,$o=Kt(Jt),Uo=Vt(Jt),Po=i(function(t){var n=[null].concat(t);return function(){var t=[].slice.call(arguments).pop();return t.apply(this,n)}}),zo=Xt(Ar,F,Yt),Bo=Xt(L,F,Yt),Co=Xt(xr,F,Yt),qo=Zt("dir"),Do=x(cn,1/0),Ro=x(cn,1),Wo=Xt(L,fn,fn),No=x(Wo,1/0),Go=x(Wo,1),Qo=sn(ln),Ho=x(Qo,1/0),Jo=x(Qo,1),Ko=Zt("log"),Vo=sn(hn),Xo=x(Vo,1/0),Yo=x(Vo,1),Zo="[object Symbol]",tu=Object.prototype,nu=tu.toString,ru=1/0,eu=Ae?Ae.prototype:void 0,ou=eu?eu.toString:void 0,uu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,iu=/\\(\\)?/g,cu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,au=/^\w*$/,fu=x(xn,1/0),lu=Fn(U),su=Array.prototype.slice,pu=sn(Pn),yu=x(pu,1/0),hu=x(pu,1),vu=Xt(L,Boolean,F),du=x(vu,1/0),mu=x(vu,1),gu=Math.ceil,bu=Math.max,ju=x(Wn,1/0),wu=x(Wn,1),Ou={applyEach:Lr,applyEachSeries:Ir,apply:Tr,asyncify:I,auto:q,autoInject:Rt,cargo:Nt,compose:Ht,concat:$o,concatSeries:Uo,constant:Po,detect:zo,detectLimit:Bo,detectSeries:Co,dir:qo,doDuring:nn,doUntil:on,doWhilst:en,during:tn,each:Do,eachLimit:cn,eachOf:Ar,eachOfLimit:L,eachOfSeries:xr,eachSeries:Ro,ensureAsync:an,every:No,everyLimit:Wo,everySeries:Go,filter:Ho,filterLimit:Qo,filterSeries:Jo,forever:pn,iterator:yn,log:Ko,map:Xo,mapLimit:Vo,mapSeries:Yo,memoize:An,nextTick:Fo,parallel:fu,parallelLimit:xn,priorityQueue:Tn,queue:In,race:$n,reduce:Gt,reduceRight:Un,reject:yu,rejectLimit:pu,rejectSeries:hu,retry:Bn,retryable:Cn,seq:Qt,series:zn,setImmediate:Fo,some:du,someLimit:vu,someSeries:mu,sortBy:qn,timeout:Dn,times:ju,timesLimit:Wn,timesSeries:wu,transform:Nn,unmemoize:Gn,until:Qn,waterfall:Hn,whilst:rn,all:No,any:du,forEach:Do,forEachSeries:Ro,forEachLimit:cn,forEachOf:Ar,forEachOfSeries:xr,forEachOfLimit:L,inject:Gt,foldl:Gt,foldr:Un,select:Ho,selectLimit:Qo,selectSeries:Jo,wrapSync:I};t["default"]=Ou,t.applyEach=Lr,t.applyEachSeries=Ir,t.apply=Tr,t.asyncify=I,t.auto=q,t.autoInject=Rt,t.cargo=Nt,t.compose=Ht,t.concat=$o,t.concatSeries=Uo,t.constant=Po,t.detect=zo,t.detectLimit=Bo,t.detectSeries=Co,t.dir=qo,t.doDuring=nn,t.doUntil=on,t.doWhilst=en,t.during=tn,t.each=Do,t.eachLimit=cn,t.eachOf=Ar,t.eachOfLimit=L,t.eachOfSeries=xr,t.eachSeries=Ro,t.ensureAsync=an,t.every=No,t.everyLimit=Wo,t.everySeries=Go,t.filter=Ho,t.filterLimit=Qo,t.filterSeries=Jo,t.forever=pn,t.iterator=yn,t.log=Ko,t.map=Xo,t.mapLimit=Vo,t.mapSeries=Yo,t.memoize=An,t.nextTick=Fo,t.parallel=fu,t.parallelLimit=xn,t.priorityQueue=Tn,t.queue=In,t.race=$n,t.reduce=Gt,t.reduceRight=Un,t.reject=yu,t.rejectLimit=pu,t.rejectSeries=hu,t.retry=Bn,t.retryable=Cn,t.seq=Qt,t.series=zn,t.setImmediate=Fo,t.some=du,t.someLimit=vu,t.someSeries=mu,t.sortBy=qn,t.timeout=Dn,t.times=ju,t.timesLimit=Wn,t.timesSeries=wu,t.transform=Nn,t.unmemoize=Gn,t.until=Qn,t.waterfall=Hn,t.whilst=rn,t.all=No,t.allLimit=Wo,t.allSeries=Go,t.any=du,t.anyLimit=vu,t.anySeries=mu,t.find=zo,t.findLimit=Bo,t.findSeries=Co,t.forEach=Do,t.forEachSeries=Ro,t.forEachLimit=cn,t.forEachOf=Ar,t.forEachOfSeries=xr,t.forEachOfLimit=L,t.inject=Gt,t.foldl=Gt,t.foldr=Un,t.select=Ho,t.selectLimit=Qo,t.selectSeries=Jo,t.wrapSync=I}); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.async=t.async||{})}(this,function(t){"use strict";function n(t,n,r){var e=r.length;switch(e){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function r(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function e(t){var n=r(t)?Zn.call(t):"";return n==Vn||n==Xn}function o(t){if(r(t)){var n=e(t.valueOf)?t.valueOf():t;t=r(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(nr,"");var o=er.test(t);return o||or.test(t)?ur(t.slice(2),o?2:8):rr.test(t)?tr:+t}function u(t){if(!t)return 0===t?t:0;if(t=o(t),t===ir||t===-ir){var n=0>t?-1:1;return n*cr}var r=t%1;return t===t?r?t-r:t:0}function i(t,r){if("function"!=typeof t)throw new TypeError(ar);return r=fr(void 0===r?t.length-1:u(r),0),function(){for(var e=arguments,o=-1,u=fr(e.length-r,0),i=Array(u);++o<u;)i[o]=e[r+o];switch(r){case 0:return t.call(this,i);case 1:return t.call(this,e[0],i);case 2:return t.call(this,e[0],e[1],i)}var c=Array(r+1);for(o=-1;++o<r;)c[o]=e[o];return c[r]=i,n(t,this,c)}}function c(t){return i(function(n){var r=n.pop();t(n,r)})}function a(t){return i(function(n,r){var e=c(function(r,e){var o=this;return t(n,function(t,n,e){t.apply(o,r.concat([e]))},e)});return r.length?e.apply(this,r):e})}function f(){}function l(t,n){var r;if("function"!=typeof n)throw new TypeError(lr);return t=u(t),function(){return--t>0&&(r=n.apply(this,arguments)),1>=t&&(n=void 0),r}}function s(t){return l(2,t)}function p(t){return function(n){return null==n?void 0:n[t]}}function y(t){return"number"==typeof t&&t>-1&&t%1==0&&pr>=t}function h(t){return null!=t&&y(sr(t))&&!e(t)}function v(t){return yr&&t[yr]&&t[yr]()}function d(t,n){return vr.call(t,n)||"object"==typeof t&&n in t&&null===dr(t)}function m(t){return mr(Object(t))}function g(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function b(t){return!!t&&"object"==typeof t}function j(t){return b(t)&&h(t)}function w(t){return j(t)&&jr.call(t,"callee")&&(!Or.call(t,"callee")||wr.call(t)==gr)}function O(t){return"string"==typeof t||!Sr(t)&&b(t)&&Er.call(t)==_r}function S(t){var n=t?t.length:void 0;return y(n)&&(Sr(t)||O(t)||w(t))?g(n,String):null}function _(t,n){return t="number"==typeof t||xr.test(t)?+t:-1,n=null==n?Ar:n,t>-1&&t%1==0&&n>t}function k(t){var n=t&&t.constructor,r="function"==typeof n&&n.prototype||Lr;return t===r}function E(t){var n=k(t);if(!n&&!h(t))return m(t);var r=S(t),e=!!r,o=r||[],u=o.length;for(var i in t)!d(t,i)||e&&("length"==i||_(i,u))||n&&"constructor"==i||o.push(i);return o}function A(t){var n,r=-1;if(h(t))return n=t.length,function(){return r++,n>r?{value:t[r],key:r}:null};var e=v(t);if(e)return function(){var t=e.next();return t.done?null:(r++,{value:t.value,key:r})};var o=E(t);return n=o.length,function(){r++;var e=o[r];return n>r?{value:t[e],key:e}:null}}function x(t){return function(){if(null===t)throw new Error("Callback was already called.");t.apply(this,arguments),t=null}}function L(t){return function(n,r,e){e=s(e||f),n=n||[];var o=A(n);if(0>=t)return e(null);var u=!1,i=0,c=!1;!function a(){if(u&&0>=i)return e(null);for(;t>i&&!c;){var n=o();if(null===n)return u=!0,void(0>=i&&e(null));i+=1,r(n.value,n.key,x(function(t){i-=1,t?(e(t),c=!0):a()}))}}()}}function I(t,n,r,e){L(n)(t,r,e)}function T(t,n){return function(r,e,o){return t(r,n,e,o)}}function F(t){return c(function(n,e){var o;try{o=t.apply(this,n)}catch(u){return e(u)}r(o)&&"function"==typeof o.then?o.then(function(t){e(null,t)})["catch"](function(t){e(t.message?t:new Error(t))}):e(null,o)})}function M(t,n){for(var r=-1,e=t.length;++r<e&&n(t[r],r,t)!==!1;);return t}function $(t){return t}function U(t){return"function"==typeof t?t:$}function P(t){return function(n,r,e){for(var o=-1,u=Object(n),i=e(n),c=i.length;c--;){var a=i[t?c:++o];if(r(u[a],a,u)===!1)break}return n}}function z(t,n){return t&&Ur(t,n,E)}function B(t,n){return t&&z(t,U(n))}function C(t,n,r){for(var e=t.length,o=n+(r?0:-1);r?o--:++o<e;){var u=t[o];if(u!==u)return o}return-1}function q(t,n,r){if(n!==n)return C(t,r);for(var e=r-1,o=t.length;++e<o;)if(t[e]===n)return e;return-1}function D(t,n,r){var e=t?t.length:0;return e?(r=u(r),0>r&&(r=Pr(e+r,0)),q(t,n,r)):-1}function R(t,n,r){function e(t,n){m.push(function(){a(t,n)})}function o(){if(0===m.length&&0===h)return r(null,y);for(;m.length&&n>h;){var t=m.shift();t()}}function u(t,n){var r=d[t];r||(r=d[t]=[]),r.push(n)}function c(t){var n=d[t]||[];M(n,function(t){t()}),o()}function a(t,n){if(!v){var e=x(i(function(n,e){if(h--,e.length<=1&&(e=e[0]),n){var o={};B(y,function(t,n){o[n]=t}),o[t]=e,v=!0,d=[],r(n,o)}else y[t]=e,c(t)}));h++;var o=n[n.length-1];n.length>1?o(y,e):o(e)}}"function"==typeof n&&(r=n,n=null),r=s(r||f);var l=E(t),p=l.length;if(!p)return r(null);n||(n=p);var y={},h=0,v=!1,d={},m=[];B(t,function(n,r){function o(){for(var n,e=i.length;e--;){if(!(n=t[i[e]]))throw new Error("async.auto task `"+r+"` has non-existent dependency in "+i.join(", "));if(Sr(n)&&D(n,r)>=0)throw new Error("async.auto task `"+r+"`Has cyclic dependencies")}}if(!Sr(n))return void e(r,[n]);var i=n.slice(0,n.length-1),c=i.length;o(),M(i,function(t){u(t,function(){c--,0===c&&e(r,n)})})}),o()}function W(t,n){for(var r=-1,e=t.length,o=Array(e);++r<e;)o[r]=n(t[r],r,t);return o}function N(){this.__data__={array:[],map:null}}function G(t,n){return t===n||t!==t&&n!==n}function Q(t,n){for(var r=t.length;r--;)if(G(t[r][0],n))return r;return-1}function H(t,n){var r=Q(t,n);if(0>r)return!1;var e=t.length-1;return r==e?t.pop():Br.call(t,r,1),!0}function J(t){var n=this.__data__,r=n.array;return r?H(r,t):n.map["delete"](t)}function K(t,n){var r=Q(t,n);return 0>r?void 0:t[r][1]}function V(t){var n=this.__data__,r=n.array;return r?K(r,t):n.map.get(t)}function X(t,n){return Q(t,n)>-1}function Y(t){var n=this.__data__,r=n.array;return r?X(r,t):n.map.has(t)}function Z(t){var n=!1;if(null!=t&&"function"!=typeof t.toString)try{n=!!(t+"")}catch(r){}return n}function tt(t){return null==t?!1:e(t)?Nr.test(Rr.call(t)):b(t)&&(Z(t)?Nr:qr).test(t)}function nt(t,n){var r=t[n];return tt(r)?r:void 0}function rt(){}function et(t){return t&&t.Object===Object?t:null}function ot(){this.__data__={hash:new rt,map:ne?new ne:[],string:new rt}}function ut(t,n){return Gr?void 0!==t[n]:ee.call(t,n)}function it(t,n){return ut(t,n)&&delete t[n]}function ct(t){var n=typeof t;return"number"==n||"boolean"==n||"string"==n&&"__proto__"!=t||null==t}function at(t){var n=this.__data__;return ct(t)?it("string"==typeof t?n.string:n.hash,t):ne?n.map["delete"](t):H(n.map,t)}function ft(t,n){if(Gr){var r=t[n];return r===oe?void 0:r}return ie.call(t,n)?t[n]:void 0}function lt(t){var n=this.__data__;return ct(t)?ft("string"==typeof t?n.string:n.hash,t):ne?n.map.get(t):K(n.map,t)}function st(t){var n=this.__data__;return ct(t)?ut("string"==typeof t?n.string:n.hash,t):ne?n.map.has(t):X(n.map,t)}function pt(t,n,r){var e=Q(t,n);0>e?t.push([n,r]):t[e][1]=r}function yt(t,n,r){t[n]=Gr&&void 0===r?ce:r}function ht(t,n){var r=this.__data__;return ct(t)?yt("string"==typeof t?r.string:r.hash,t,n):ne?r.map.set(t,n):pt(r.map,t,n),this}function vt(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function dt(t,n){var r=this.__data__,e=r.array;e&&(e.length<ae-1?pt(e,t,n):(r.array=null,r.map=new vt(e)));var o=r.map;return o&&o.set(t,n),this}function mt(t){var n=-1,r=t?t.length:0;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function gt(t,n,r){var e=t[n];le.call(t,n)&&G(e,r)&&(void 0!==r||n in t)||(t[n]=r)}function bt(t,n,r,e){r||(r={});for(var o=-1,u=n.length;++o<u;){var i=n[o],c=e?e(r[i],t[i],i,r,t):t[i];gt(r,i,c)}return r}function jt(t,n,r){return bt(t,n,r)}function wt(t,n){return t&&jt(n,E(n),t)}function Ot(t,n){if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function St(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r<e;)n[r]=t[r];return n}function _t(t,n){return jt(t,pe(t),n)}function kt(t){return we.call(t)}function Et(t){var n=t.length,r=t.constructor(n);return n&&"string"==typeof t[0]&&Ae.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function At(t){var n=new t.constructor(t.byteLength);return new xe(n).set(new xe(t)),n}function xt(t,n){return t.set(n[0],n[1]),t}function Lt(t,n,r,e){var o=-1,u=t.length;for(e&&u&&(r=t[++o]);++o<u;)r=n(r,t[o],o,t);return r}function It(t){var n=-1,r=Array(t.size);return t.forEach(function(t,e){r[++n]=[e,t]}),r}function Tt(t){return Lt(It(t),xt,new t.constructor)}function Ft(t){var n=new t.constructor(t.source,Le.exec(t));return n.lastIndex=t.lastIndex,n}function Mt(t,n){return t.add(n),t}function $t(t){var n=-1,r=Array(t.size);return t.forEach(function(t){r[++n]=t}),r}function Ut(t){return Lt($t(t),Mt,new t.constructor)}function Pt(t){return Fe?Object(Fe.call(t)):{}}function zt(t,n){var r=n?At(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Bt(t,n,r){var e=t.constructor;switch(n){case De:return At(t);case Me:case $e:return new e(+t);case Re:case We:case Ne:case Ge:case Qe:case He:case Je:case Ke:case Ve:return zt(t,r);case Ue:return Tt(t);case Pe:case Ce:return new e(t);case ze:return Ft(t);case Be:return Ut(t);case qe:return Pt(t)}}function Ct(t){return r(t)?Xe(t):{}}function qt(t){return"function"!=typeof t.constructor||k(t)?{}:Ct(Ye(t))}function Dt(t){return function(){return t}}function Rt(t,n,e,o,u,i,c){var a;if(o&&(a=i?o(t,u,i,c):o(t)),void 0!==a)return a;if(!r(t))return t;var f=Sr(t);if(f){if(a=Et(t),!n)return St(t,a)}else{var l=ke(t),s=l==lo||l==so;if(oo(t))return Ot(t,n);if(l==ho||l==uo||s&&!i){if(Z(t))return i?t:{};if(a=qt(s?{}:t),!n)return a=wt(a,t),e?_t(t,a):a}else{if(!To[l])return i?t:{};a=Bt(t,l,n)}}c||(c=new mt);var p=c.get(t);return p?p:(c.set(t,a),(f?M:z)(t,function(r,u){gt(a,u,Rt(r,n,e,o,u,t,c))}),e&&!f?_t(t,a):a)}function Wt(t){return t.toString().match(Mo)[1].split(/\s*\,\s*/)}function Nt(t,n){var r={};B(t,function(t,n){function e(n,r){var e=W(o,function(t){return n[t]});e.push(r),t.apply(null,e)}var o;if(Sr(t))o=Rt(t),t=o.pop(),r[n]=o.concat(e);else{if(0===t.length)throw new Error("autoInject task functions require explicit parameters.");1===t.length?r[n]=t:(o=Wt(t),o.pop(),r[n]=o.concat(e))}}),R(r,n)}function Gt(t,n,r){function e(t,n,r,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");return t.started=!0,Sr(n)||(n=[n]),0===n.length&&t.idle()?Uo(function(){t.drain()}):(M(n,function(n){var o={data:n,callback:e||f};r?t.tasks.unshift(o):t.tasks.push(o)}),void Uo(t.process))}function o(t,n){return function(){u-=1;var r=!1,e=arguments;M(n,function(t){M(i,function(n,e){n!==t||r||(i.splice(e,1),r=!0)}),t.callback.apply(t,e)}),u<=t.concurrency-t.buffer&&t.unsaturated(),t.tasks.length+u===0&&t.drain(),t.process()}}if(null==n)n=1;else if(0===n)throw new Error("Concurrency must not be zero");var u=0,i=[],c={tasks:[],concurrency:n,payload:r,saturated:f,unsaturated:f,buffer:n/4,empty:f,drain:f,started:!1,paused:!1,push:function(t,n){e(c,t,!1,n)},kill:function(){c.drain=f,c.tasks=[]},unshift:function(t,n){e(c,t,!0,n)},process:function(){for(;!c.paused&&u<c.concurrency&&c.tasks.length;){var n=c.payload?c.tasks.splice(0,c.payload):c.tasks.splice(0,c.tasks.length),r=W(n,p("data"));0===c.tasks.length&&c.empty(),u+=1,i.push(n[0]),u===c.concurrency&&c.saturated();var e=x(o(c,n));t(r,e)}},length:function(){return c.tasks.length},running:function(){return u},workersList:function(){return i},idle:function(){return c.tasks.length+u===0},pause:function(){c.paused=!0},resume:function(){if(c.paused!==!1){c.paused=!1;for(var t=Math.min(c.concurrency,c.tasks.length),n=1;t>=n;n++)Uo(c.process)}}};return c}function Qt(t,n){return Gt(t,1,n)}function Ht(t,n,r,e){Fr(t,function(t,e,o){r(n,t,function(t,r){n=r,o(t)})},function(t){e(t,n)})}function Jt(){var t=arguments;return i(function(n){var r=this,e=n[n.length-1];"function"==typeof e?n.pop():e=f,Ht(t,n,function(t,n,e){n.apply(r,t.concat([i(function(t,n){e(t,n)})]))},function(t,n){e.apply(r,[t].concat(n))})})}function Kt(){return Jt.apply(null,Po.call(arguments))}function Vt(t,n,r,e){var o=[];t(n,function(t,n,e){r(t,function(t,n){o=o.concat(n||[]),e(t)})},function(t){e(t,o)})}function Xt(t){return function(n,r,e){return t(Ir,n,r,e)}}function Yt(t){return function(n,r,e){return t(Fr,n,r,e)}}function Zt(t,n,r){return function(e,o,u,i){function c(t){i&&(t?i(t):i(null,r(!1)))}function a(t,e,o){return i?void u(t,function(e,c){i&&(e?(i(e),i=u=!1):n(c)&&(i(null,r(!0,t)),i=u=!1)),o()}):o()}arguments.length>3?t(e,o,a,c):(i=u,u=o,t(e,a,c))}}function tn(t,n){return n}function nn(t){return i(function(n,r){n.apply(null,r.concat([i(function(n,r){"object"==typeof console&&(n?console.error&&console.error(n):console[t]&&M(r,function(n){console[t](n)}))})]))})}function rn(t,n,r){r=r||f;var e=i(function(n,e){n?r(n):(e.push(o),t.apply(this,e))}),o=function(t,o){return t?r(t):o?void n(e):r(null)};t(o)}function en(t,n,r){var e=0;rn(function(t){return e++<1?t(null,!0):void n.apply(this,arguments)},t,r)}function on(t,n,r){if(r=r||f,!t())return r(null);var e=i(function(o,u){return o?r(o):t.apply(this,u)?n(e):void r.apply(null,[null].concat(u))});n(e)}function un(t,n,r){var e=0;return on(function(){return++e<=1||n.apply(this,arguments)},t,r)}function cn(t,n,r){return un(t,function(){return!n.apply(this,arguments)},r)}function an(t){return function(n,r,e){return t(n,e)}}function fn(t,n,r,e){return L(n)(t,an(r),e)}function ln(t){return c(function(n,r){var e=!0;n.push(function(){var t=arguments;e?Uo(function(){r.apply(null,t)}):r.apply(null,t)}),t.apply(this,n),e=!1})}function sn(t){return!t}function pn(t,n,r,e){var o=[];t(n,function(t,n,e){r(t,function(r,u){r?e(r):(u&&o.push({index:n,value:t}),e())})},function(t){t?e(t):e(null,W(o.sort(function(t,n){return t.index-n.index}),p("value")))})}function yn(t){return function(n,r,e,o){return t(L(r),n,e,o)}}function hn(t,n){function r(t){return t?e(t):void o(r)}var e=x(n||f),o=ln(t);r()}function vn(t){function n(r){function e(){return t.length&&t[r].apply(null,arguments),e.next()}return e.next=function(){return r<t.length-1?n(r+1):null},e}return n(0)}function dn(t,n,r,e){e=s(e||f),n=n||[];var o=h(n)||v(n)?[]:{};t(n,function(t,n,e){r(t,function(t,r){o[n]=r,e(t)})},function(t){e(t,o)})}function mn(t){return"symbol"==typeof t||b(t)&&ou.call(t)==ru}function gn(t){if("string"==typeof t)return t;if(null==t)return"";if(mn(t))return cu?cu.call(t):"";var n=t+"";return"0"==n&&1/t==-uu?"-0":n}function bn(t){var n=[];return gn(t).replace(au,function(t,r,e,o){n.push(e?o.replace(fu,"$1"):r||t)}),n}function jn(t){return Sr(t)?t:bn(t)}function wn(t,n){return"number"==typeof t?!0:!Sr(t)&&(su.test(t)||!lu.test(t)||null!=n&&t in Object(n))}function On(t){var n=t?t.length:0;return n?t[n-1]:void 0}function Sn(t,n,r){var e=-1,o=t.length;0>n&&(n=-n>o?0:o+n),r=r>o?o:r,0>r&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var u=Array(o);++e<o;)u[e]=t[e+n];return u}function _n(t,n){n=wn(n,t)?[n+""]:jn(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[n[r++]];return r&&r==e?t:void 0}function kn(t,n,r){var e=null==t?void 0:_n(t,n);return void 0===e?r:e}function En(t,n){return 1==n.length?t:kn(t,Sn(n,0,-1))}function An(t,n,r){if(null==t)return!1;var e=r(t,n);e||wn(n)||(n=jn(n),t=En(t,n),null!=t&&(n=On(n),e=r(t,n)));var o=t?t.length:void 0;return e||!!o&&y(o)&&_(n,o)&&(Sr(t)||O(t)||w(t))}function xn(t,n){return An(t,n,d)}function Ln(t,n){var r=Object.create(null),e=Object.create(null);n=n||$;var o=c(function(o,u){var c=n.apply(null,o);xn(r,c)?Uo(function(){u.apply(null,r[c])}):xn(e,c)?e[c].push(u):(e[c]=[u],t.apply(null,o.concat([i(function(t){r[c]=t;var n=e[c];delete e[c];for(var o=0,u=n.length;u>o;o++)n[o].apply(null,t)})])))});return o.memo=r,o.unmemoized=t,o}function In(t,n,r){r=r||f;var e=h(n)?[]:{};t(n,function(t,n,r){t(i(function(t,o){o.length<=1&&(o=o[0]),e[n]=o,r(t)}))},function(t){r(t,e)})}function Tn(t,n,r){return In(L(n),t,r)}function Fn(t,n){return Gt(function(n,r){t(n[0],r)},n,1)}function Mn(t,n){function r(t,n){return t.priority-n.priority}function e(t,n,r){for(var e=-1,o=t.length-1;o>e;){var u=e+(o-e+1>>>1);r(n,t[u])>=0?e=u:o=u-1}return e}function o(t,n,o,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,Sr(n)||(n=[n]),0===n.length?Uo(function(){t.drain()}):void M(n,function(n){var i={data:n,priority:o,callback:"function"==typeof u?u:f};t.tasks.splice(e(t.tasks,i,r)+1,0,i),t.tasks.length===t.concurrency&&t.saturated(),t.tasks.length<=t.concurrency-t.buffer&&t.unsaturated(),Uo(t.process)})}var u=Fn(t,n);return u.push=function(t,n,r){o(u,t,n,r)},delete u.unshift,u}function $n(t,n){return function(r,e){if(null==r)return r;if(!h(r))return t(r,e);for(var o=r.length,u=n?o:-1,i=Object(r);(n?u--:++u<o)&&e(i[u],u,i)!==!1;);return r}}function Un(t,n){return"function"==typeof n&&Sr(t)?M(t,n):yu(t,U(n))}function Pn(t,n){return n=s(n||f),Sr(t)?t.length?void Un(t,function(t){t(n)}):n():n(new TypeError("First argument to race must be an array of functions"))}function zn(t,n,r,e){var o=hu.call(t).reverse();Ht(o,n,r,e)}function Bn(t,n,r,e){pn(t,n,function(t,n){r(t,function(t,r){t?n(t):n(null,!r)})},e)}function Cn(t,n){return In(Fr,t,n)}function qn(t,n,r){function e(t,n){if("object"==typeof n)t.times=+n.times||i,t.interval=+n.interval||c;else{if("number"!=typeof n&&"string"!=typeof n)throw new Error("Invalid arguments for async.retry");t.times=+n||i}}function o(t){return function(r){n(function(n,e){r(!n||t,{err:n,result:e})})}}function u(t){return function(n){setTimeout(function(){n(null)},t)}}var i=5,c=0,a={times:i,interval:c};if(arguments.length<3&&"function"==typeof t?(r=n||f,n=t):(e(a,t),r=r||f),"function"!=typeof n)throw new Error("Invalid arguments for async.retry");for(var l=[];a.times;){var s=!(a.times-=1);l.push(o(s)),!s&&a.interval>0&&l.push(u(a.interval))}Cn(l,function(t,n){n=n[n.length-1],r(n.err,n.result)})}function Dn(t,n){return n||(n=t,t=null),c(function(r,e){function o(t){n.apply(null,r.concat([t]))}t?qn(t,o,e):qn(o,e)})}function Rn(t,n,r){function e(t,n){var r=t.criteria,e=n.criteria;return e>r?-1:r>e?1:0}tu(t,function(t,r){n(t,function(n,e){return n?r(n):void r(null,{value:t,criteria:e})})},function(t,n){return t?r(t):void r(null,W(n.sort(e),p("value")))})}function Wn(t,n){function r(){i||(o.apply(null,arguments),clearTimeout(u))}function e(){var t=new Error("Callback function timed out.");t.code="ETIMEDOUT",i=!0,o(t)}var o,u,i=!1;return c(function(i,c){o=c,u=setTimeout(e,n),t.apply(null,i.concat(r))})}function Nn(t,n,r,e){for(var o=-1,u=Ou(wu((n-t)/(r||1)),0),i=Array(u);u--;)i[e?u:++o]=t,t+=r;return i}function Gn(t,n,r,e){return Zo(Nn(0,t,1),n,r,e)}function Qn(t,n,r,e){3===arguments.length&&(e=r,r=n,n=Sr(t)?[]:{}),Ir(t,function(t,e,o){r(n,t,e,o)},function(t){e(t,n)})}function Hn(t){return function(){return(t.unmemoized||t).apply(null,arguments)}}function Jn(t,n,r){return on(function(){return!t.apply(this,arguments)},n,r)}function Kn(t,n){function r(o){if(e===t.length)return n.apply(null,[null].concat(o));var u=x(i(function(t,e){return t?n.apply(null,[t].concat(e)):void r(e)}));o.push(u);var c=t[e++];c.apply(null,o)}if(n=s(n||f),!Sr(t))return n(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return n();var e=0;r([])}var Vn="[object Function]",Xn="[object GeneratorFunction]",Yn=Object.prototype,Zn=Yn.toString,tr=NaN,nr=/^\s+|\s+$/g,rr=/^[-+]0x[0-9a-f]+$/i,er=/^0b[01]+$/i,or=/^0o[0-7]+$/i,ur=parseInt,ir=1/0,cr=1.7976931348623157e308,ar="Expected a function",fr=Math.max,lr="Expected a function",sr=p("length"),pr=9007199254740991,yr="function"==typeof Symbol&&Symbol.iterator,hr=Object.prototype,vr=hr.hasOwnProperty,dr=Object.getPrototypeOf,mr=Object.keys,gr="[object Arguments]",br=Object.prototype,jr=br.hasOwnProperty,wr=br.toString,Or=br.propertyIsEnumerable,Sr=Array.isArray,_r="[object String]",kr=Object.prototype,Er=kr.toString,Ar=9007199254740991,xr=/^(?:0|[1-9]\d*)$/,Lr=Object.prototype,Ir=T(I,1/0),Tr=a(Ir),Fr=T(I,1),Mr=a(Fr),$r=i(function(t,n){return i(function(r){return t.apply(null,n.concat(r))})}),Ur=P(),Pr=Math.max,zr=Array.prototype,Br=zr.splice,Cr=/[\\^$.*+?()[\]{}|]/g,qr=/^\[object .+?Constructor\]$/,Dr=Object.prototype,Rr=Function.prototype.toString,Wr=Dr.hasOwnProperty,Nr=RegExp("^"+Rr.call(Wr).replace(Cr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gr=nt(Object,"create"),Qr=Object.prototype;rt.prototype=Gr?Gr(null):Qr;var Hr={"function":!0,object:!0},Jr=Hr[typeof t]&&t&&!t.nodeType?t:void 0,Kr=Hr[typeof module]&&module&&!module.nodeType?module:void 0,Vr=et(Jr&&Kr&&"object"==typeof global&&global),Xr=et(Hr[typeof self]&&self),Yr=et(Hr[typeof window]&&window),Zr=et(Hr[typeof this]&&this),te=Vr||Yr!==(Zr&&Zr.window)&&Yr||Xr||Zr||Function("return this")(),ne=nt(te,"Map"),re=Object.prototype,ee=re.hasOwnProperty,oe="__lodash_hash_undefined__",ue=Object.prototype,ie=ue.hasOwnProperty,ce="__lodash_hash_undefined__";vt.prototype.clear=ot,vt.prototype["delete"]=at,vt.prototype.get=lt,vt.prototype.has=st,vt.prototype.set=ht;var ae=200;mt.prototype.clear=N,mt.prototype["delete"]=J,mt.prototype.get=V,mt.prototype.has=Y,mt.prototype.set=dt;var fe=Object.prototype,le=fe.hasOwnProperty,se=Object.getOwnPropertySymbols,pe=se||function(){return[]},ye=nt(te,"Set"),he=nt(te,"WeakMap"),ve="[object Map]",de="[object Object]",me="[object Set]",ge="[object WeakMap]",be=Object.prototype,je=Function.prototype.toString,we=be.toString,Oe=ne?je.call(ne):"",Se=ye?je.call(ye):"",_e=he?je.call(he):"";(ne&&kt(new ne)!=ve||ye&&kt(new ye)!=me||he&&kt(new he)!=ge)&&(kt=function(t){var n=we.call(t),r=n==de?t.constructor:null,e="function"==typeof r?je.call(r):"";if(e)switch(e){case Oe:return ve;case Se:return me;case _e:return ge}return n});var ke=kt,Ee=Object.prototype,Ae=Ee.hasOwnProperty,xe=te.Uint8Array,Le=/\w*$/,Ie=te.Symbol,Te=Ie?Ie.prototype:void 0,Fe=Te?Te.valueOf:void 0,Me="[object Boolean]",$e="[object Date]",Ue="[object Map]",Pe="[object Number]",ze="[object RegExp]",Be="[object Set]",Ce="[object String]",qe="[object Symbol]",De="[object ArrayBuffer]",Re="[object Float32Array]",We="[object Float64Array]",Ne="[object Int8Array]",Ge="[object Int16Array]",Qe="[object Int32Array]",He="[object Uint8Array]",Je="[object Uint8ClampedArray]",Ke="[object Uint16Array]",Ve="[object Uint32Array]",Xe=Object.create,Ye=Object.getPrototypeOf,Ze={"function":!0,object:!0},to=Ze[typeof t]&&t&&!t.nodeType?t:void 0,no=Ze[typeof module]&&module&&!module.nodeType?module:void 0,ro=no&&no.exports===to?to:void 0,eo=ro?te.Buffer:void 0,oo=eo?function(t){return t instanceof eo}:Dt(!1),uo="[object Arguments]",io="[object Array]",co="[object Boolean]",ao="[object Date]",fo="[object Error]",lo="[object Function]",so="[object GeneratorFunction]",po="[object Map]",yo="[object Number]",ho="[object Object]",vo="[object RegExp]",mo="[object Set]",go="[object String]",bo="[object Symbol]",jo="[object WeakMap]",wo="[object ArrayBuffer]",Oo="[object Float32Array]",So="[object Float64Array]",_o="[object Int8Array]",ko="[object Int16Array]",Eo="[object Int32Array]",Ao="[object Uint8Array]",xo="[object Uint8ClampedArray]",Lo="[object Uint16Array]",Io="[object Uint32Array]",To={};To[uo]=To[io]=To[wo]=To[co]=To[ao]=To[Oo]=To[So]=To[_o]=To[ko]=To[Eo]=To[po]=To[yo]=To[ho]=To[vo]=To[mo]=To[go]=To[bo]=To[Ao]=To[xo]=To[Lo]=To[Io]=!0,To[fo]=To[lo]=To[jo]=!1;var Fo,Mo=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,$o="function"==typeof setImmediate&&setImmediate;Fo=$o?$o:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:function(t){setTimeout(t,0)};var Uo=i(function(t,n){Fo(function(){t.apply(null,n)})}),Po=Array.prototype.reverse,zo=Xt(Vt),Bo=Yt(Vt),Co=i(function(t){var n=[null].concat(t);return c(function(t,r){return r.apply(this,n)})}),qo=Zt(Ir,$,tn),Do=Zt(I,$,tn),Ro=Zt(Fr,$,tn),Wo=nn("dir"),No=T(fn,1/0),Go=T(fn,1),Qo=Zt(I,sn,sn),Ho=T(Qo,1/0),Jo=T(Qo,1),Ko=yn(pn),Vo=T(Ko,1/0),Xo=T(Ko,1),Yo=nn("log"),Zo=yn(dn),tu=T(Zo,1/0),nu=T(Zo,1),ru="[object Symbol]",eu=Object.prototype,ou=eu.toString,uu=1/0,iu=Ie?Ie.prototype:void 0,cu=iu?iu.toString:void 0,au=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,fu=/\\(\\)?/g,lu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,su=/^\w*$/,pu=T(Tn,1/0),yu=$n(z),hu=Array.prototype.slice,vu=yn(Bn),du=T(vu,1/0),mu=T(vu,1),gu=Zt(I,Boolean,$),bu=T(gu,1/0),ju=T(gu,1),wu=Math.ceil,Ou=Math.max,Su=T(Gn,1/0),_u=T(Gn,1),ku={applyEach:Tr,applyEachSeries:Mr,apply:$r,asyncify:F,auto:R,autoInject:Nt,cargo:Qt,compose:Kt,concat:zo,concatSeries:Bo,constant:Co,detect:qo,detectLimit:Do,detectSeries:Ro,dir:Wo,doDuring:en,doUntil:cn,doWhilst:un,during:rn,each:No,eachLimit:fn,eachOf:Ir,eachOfLimit:I,eachOfSeries:Fr,eachSeries:Go,ensureAsync:ln,every:Ho,everyLimit:Qo,everySeries:Jo,filter:Vo,filterLimit:Ko,filterSeries:Xo,forever:hn,iterator:vn,log:Yo,map:tu,mapLimit:Zo,mapSeries:nu,memoize:Ln,nextTick:Uo,parallel:pu,parallelLimit:Tn,priorityQueue:Mn,queue:Fn,race:Pn,reduce:Ht,reduceRight:zn,reject:du,rejectLimit:vu,rejectSeries:mu,retry:qn,retryable:Dn,seq:Jt,series:Cn,setImmediate:Uo,some:bu,someLimit:gu,someSeries:ju,sortBy:Rn,timeout:Wn,times:Su,timesLimit:Gn,timesSeries:_u,transform:Qn,unmemoize:Hn,until:Jn,waterfall:Kn,whilst:on,all:Ho,any:bu,forEach:No,forEachSeries:Go,forEachLimit:fn,forEachOf:Ir,forEachOfSeries:Fr,forEachOfLimit:I,inject:Ht,foldl:Ht,foldr:zn,select:Vo,selectLimit:Ko,selectSeries:Xo,wrapSync:F};t["default"]=ku,t.applyEach=Tr,t.applyEachSeries=Mr,t.apply=$r,t.asyncify=F,t.auto=R,t.autoInject=Nt,t.cargo=Qt,t.compose=Kt,t.concat=zo,t.concatSeries=Bo,t.constant=Co,t.detect=qo,t.detectLimit=Do,t.detectSeries=Ro,t.dir=Wo,t.doDuring=en,t.doUntil=cn,t.doWhilst=un,t.during=rn,t.each=No,t.eachLimit=fn,t.eachOf=Ir,t.eachOfLimit=I,t.eachOfSeries=Fr,t.eachSeries=Go,t.ensureAsync=ln,t.every=Ho,t.everyLimit=Qo,t.everySeries=Jo,t.filter=Vo,t.filterLimit=Ko,t.filterSeries=Xo,t.forever=hn,t.iterator=vn,t.log=Yo,t.map=tu,t.mapLimit=Zo,t.mapSeries=nu,t.memoize=Ln,t.nextTick=Uo,t.parallel=pu,t.parallelLimit=Tn,t.priorityQueue=Mn,t.queue=Fn,t.race=Pn,t.reduce=Ht,t.reduceRight=zn,t.reject=du,t.rejectLimit=vu,t.rejectSeries=mu,t.retry=qn,t.retryable=Dn,t.seq=Jt,t.series=Cn,t.setImmediate=Uo,t.some=bu,t.someLimit=gu,t.someSeries=ju,t.sortBy=Rn,t.timeout=Wn,t.times=Su,t.timesLimit=Gn,t.timesSeries=_u,t.transform=Qn,t.unmemoize=Hn,t.until=Jn,t.waterfall=Kn,t.whilst=on,t.all=Ho,t.allLimit=Qo,t.allSeries=Jo,t.any=bu,t.anyLimit=gu,t.anySeries=ju,t.find=qo,t.findLimit=Do,t.findSeries=Ro,t.forEach=No,t.forEachSeries=Go,t.forEachLimit=fn,t.forEachOf=Ir,t.forEachOfSeries=Fr,t.forEachOfLimit=I,t.inject=Ht,t.foldl=Ht,t.foldr=zn,t.select=Vo,t.selectLimit=Ko,t.selectSeries=Xo,t.wrapSync=F}); | ||
//# sourceMappingURL=dist/async.min.map |
@@ -8,6 +8,2 @@ 'use strict'; | ||
var _rest = require('lodash/rest'); | ||
var _rest2 = _interopRequireDefault(_rest); | ||
var _setImmediate = require('./internal/setImmediate'); | ||
@@ -17,7 +13,10 @@ | ||
var _initialParams = require('./internal/initialParams'); | ||
var _initialParams2 = _interopRequireDefault(_initialParams); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function ensureAsync(fn) { | ||
return (0, _rest2.default)(function (args) { | ||
var callback = args.pop(); | ||
return (0, _initialParams2.default)(function (args, callback) { | ||
var sync = true; | ||
@@ -24,0 +23,0 @@ args.push(function () { |
@@ -12,2 +12,6 @@ 'use strict'; | ||
var _initialParams = require('./initialParams'); | ||
var _initialParams2 = _interopRequireDefault(_initialParams); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -17,5 +21,4 @@ | ||
return (0, _rest2.default)(function (fns, args) { | ||
var go = (0, _rest2.default)(function (args) { | ||
var go = (0, _initialParams2.default)(function (args, callback) { | ||
var that = this; | ||
var callback = args.pop(); | ||
return eachfn(fns, function (fn, _, cb) { | ||
@@ -22,0 +25,0 @@ fn.apply(that, args.concat([cb])); |
@@ -16,5 +16,5 @@ 'use strict'; | ||
var _keyIterator = require('./keyIterator'); | ||
var _iterator = require('./iterator'); | ||
var _keyIterator2 = _interopRequireDefault(_keyIterator); | ||
var _iterator2 = _interopRequireDefault(_iterator); | ||
@@ -31,3 +31,3 @@ var _onlyOnce = require('./onlyOnce'); | ||
obj = obj || []; | ||
var nextKey = (0, _keyIterator2.default)(obj); | ||
var nextElem = (0, _iterator2.default)(obj); | ||
if (limit <= 0) { | ||
@@ -46,4 +46,4 @@ return callback(null); | ||
while (running < limit && !errored) { | ||
var key = nextKey(); | ||
if (key === null) { | ||
var elem = nextElem(); | ||
if (elem === null) { | ||
done = true; | ||
@@ -56,3 +56,3 @@ if (running <= 0) { | ||
running += 1; | ||
iteratee(obj[key], key, (0, _onlyOnce2.default)(function (err) { | ||
iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(function (err) { | ||
running -= 1; | ||
@@ -59,0 +59,0 @@ if (err) { |
@@ -12,2 +12,6 @@ 'use strict'; | ||
var _getIterator = require('./getIterator'); | ||
var _getIterator2 = _interopRequireDefault(_getIterator); | ||
var _noop = require('lodash/noop'); | ||
@@ -26,3 +30,3 @@ | ||
arr = arr || []; | ||
var results = (0, _isArrayLike2.default)(arr) ? [] : {}; | ||
var results = (0, _isArrayLike2.default)(arr) || (0, _getIterator2.default)(arr) ? [] : {}; | ||
eachfn(arr, function (value, index, callback) { | ||
@@ -29,0 +33,0 @@ iteratee(value, function (err, v) { |
@@ -69,9 +69,2 @@ 'use strict'; | ||
} | ||
if (q.tasks.length === q.concurrency) { | ||
q.saturated(); | ||
} | ||
if (q.tasks.length <= q.concurrency - q.buffer) { | ||
q.unsaturated(); | ||
} | ||
}); | ||
@@ -96,2 +89,7 @@ (0, _setImmediate2.default)(q.process); | ||
}); | ||
if (workers <= q.concurrency - q.buffer) { | ||
q.unsaturated(); | ||
} | ||
if (q.tasks.length + workers === 0) { | ||
@@ -139,2 +137,7 @@ q.drain(); | ||
workersList.push(tasks[0]); | ||
if (workers === q.concurrency) { | ||
q.saturated(); | ||
} | ||
var cb = (0, _onlyOnce2.default)(_next(q, tasks)); | ||
@@ -141,0 +144,0 @@ worker(data, cb); |
@@ -24,2 +24,6 @@ 'use strict'; | ||
var _initialParams = require('./internal/initialParams'); | ||
var _initialParams2 = _interopRequireDefault(_initialParams); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -31,4 +35,3 @@ | ||
hasher = hasher || _identity2.default; | ||
var memoized = (0, _rest2.default)(function memoized(args) { | ||
var callback = args.pop(); | ||
var memoized = (0, _initialParams2.default)(function memoized(args, callback) { | ||
var key = hasher.apply(null, args); | ||
@@ -35,0 +38,0 @@ if ((0, _has2.default)(memo, key)) { |
{ | ||
"name": "async", | ||
"description": "Higher-order functions and common patterns for asynchronous code", | ||
"version": "2.0.0-rc.1", | ||
"version": "2.0.0-rc.2", | ||
"main": "dist/async.js", | ||
@@ -6,0 +6,0 @@ "author": "Caolan McMahon", |
@@ -12,5 +12,3 @@ 'use strict'; | ||
} | ||
return (0, _rest2.default)(function (args) { | ||
var callback = args.pop(); | ||
return (0, _initialParams2.default)(function (args, callback) { | ||
function taskFn(cb) { | ||
@@ -28,5 +26,5 @@ task.apply(null, args.concat([cb])); | ||
var _rest = require('lodash/rest'); | ||
var _initialParams = require('./internal/initialParams'); | ||
var _rest2 = _interopRequireDefault(_rest); | ||
var _initialParams2 = _interopRequireDefault(_initialParams); | ||
@@ -33,0 +31,0 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -7,2 +7,9 @@ 'use strict'; | ||
exports.default = timeout; | ||
var _initialParams = require('./internal/initialParams'); | ||
var _initialParams2 = _interopRequireDefault(_initialParams); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function timeout(asyncFn, miliseconds) { | ||
@@ -26,18 +33,9 @@ var originalCallback, timer; | ||
function injectCallback(asyncFnArgs) { | ||
// replace callback in asyncFn args | ||
var args = Array.prototype.slice.call(asyncFnArgs, 0); | ||
originalCallback = args[args.length - 1]; | ||
args[args.length - 1] = injectedCallback; | ||
return args; | ||
} | ||
function wrappedFn() { | ||
return (0, _initialParams2.default)(function (args, origCallback) { | ||
originalCallback = origCallback; | ||
// setup timer and call original function | ||
timer = setTimeout(timeoutCallback, miliseconds); | ||
asyncFn.apply(null, injectCallback(arguments)); | ||
} | ||
return wrappedFn; | ||
asyncFn.apply(null, args.concat(injectedCallback)); | ||
}); | ||
} | ||
module.exports = exports['default']; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
388175
100
5861