From 842c22f6284ed5093ddfe281a82a2d885a3e8d01 Mon Sep 17 00:00:00 2001 From: Suguru Motegi Date: Sun, 25 Jun 2017 18:57:01 -0700 Subject: [PATCH] 1.5.0 --- dist/aigle-es5.js | 1243 +++++++++++++++++++++++++---------------- dist/aigle-es5.min.js | 2 +- dist/aigle.js | 1015 ++++++++++++++++++++------------- dist/aigle.min.js | 2 +- package.json | 2 +- 5 files changed, 1381 insertions(+), 883 deletions(-) diff --git a/dist/aigle-es5.js b/dist/aigle-es5.js index 15cf95a9..a7c0cf22 100644 --- a/dist/aigle-es5.js +++ b/dist/aigle-es5.js @@ -4,7 +4,7 @@ require('setimmediate'); module.exports = require('./lib/aigle'); -},{"./lib/aigle":2,"setimmediate":73}],2:[function(require,module,exports){ +},{"./lib/aigle":2,"setimmediate":79}],2:[function(require,module,exports){ (function (process){ 'use strict'; @@ -425,6 +425,9 @@ var Aigle = (function (AigleCore) { }; /** + * `Aigle#map` will execute [`Aigle.map`](https://suguru03.github.io/aigle/docs/global.html#map) using a previous promise value and a defined iterator. + * The value will be assigned as the first argument to [`Aigle.map`](https://suguru03.github.io/aigle/docs/global.html#map) and + * the iterator will be assigned as the second argument. * @param {Function|string} iterator - if you define string, you can use shorthand which is similar to lodash * @return {Aigle} Returns an Aigle instance * @example @@ -488,6 +491,7 @@ var Aigle = (function (AigleCore) { }; /** + * `Aigle#mapSeries` is almost the same as [`Aigle#map`](https://suguru03.github.io/aigle/docs/global.html#map), but it will work in series. * @param {Array|Object} collection * @param {Function} iterator * @return {Aigle} Returns an Aigle instance @@ -530,6 +534,8 @@ var Aigle = (function (AigleCore) { }; /** + * `Aigle#mapLimit` is almost the same as [`Aigle#map`](https://suguru03.github.io/aigle/docs/global.html#map) + * and [`Aigle#mapSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#mapSeries)), but it will work with concurrency. * @param {Array|Object} collection * @param {integer} [limit=8] * @param {Function} iterator @@ -759,6 +765,9 @@ var Aigle = (function (AigleCore) { }; /** + * `Aigle#filter` will execute [`Aigle.filter`](https://suguru03.github.io/aigle/docs/global.html#filter) using a previous promise value and a defined iterator. + * The value will be assigned as the first argument to [`Aigle.filter`](https://suguru03.github.io/aigle/docs/global.html#filter) and + * the iterator will be assigned as the second argument. * @param {Function|Array|Object|string} iterator * @return {Aigle} Returns an Aigle instance * @example @@ -839,6 +848,7 @@ var Aigle = (function (AigleCore) { }; /** + * `Aigle#filterSeries` is almost the same as [`Aigle#filter`](https://suguru03.github.io/aigle/docs/global.html#filter), but it will work in series. * @param {Function} iterator * @return {Aigle} Returns an Aigle instance * @example @@ -880,6 +890,8 @@ var Aigle = (function (AigleCore) { }; /** + * `Aigle#filterLimit` is almost the same as [`Aigle#filter`](https://suguru03.github.io/aigle/docs/global.html#filter) + * and [`Aigle#filterSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#filterSeries)), but it will work with concurrency. * @param {Array|Object} collection * @param {integer} [limit=8] * @param {Function} iterator @@ -1126,6 +1138,9 @@ var Aigle = (function (AigleCore) { }; /** + * `Aigle#find` will execute [`Aigle.find`](https://suguru03.github.io/aigle/docs/global.html#find) using a previous promise value and a defined iterator. + * The value will be assigned as the first argument to [`Aigle.find`](https://suguru03.github.io/aigle/docs/global.html#find) and + * the iterator will be assigned as the second argument. * @param {Function|Array|Object|string} iterator * @return {Aigle} Returns an Aigle instance * @example @@ -1220,6 +1235,7 @@ var Aigle = (function (AigleCore) { }; /** + * `Aigle#findSeries` is almost the same as [`Aigle#find`](https://suguru03.github.io/aigle/docs/global.html#find), but it will work in series. * @param {Function} iterator * @return {Aigle} Returns an Aigle instance * @example @@ -1278,6 +1294,8 @@ var Aigle = (function (AigleCore) { }; /** + * `Aigle#findLimit` is almost the same as [`Aigle#find`](https://suguru03.github.io/aigle/docs/global.html#find) + * and [`Aigle#findSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#findSeries)), but it will work with concurrency. * @param {integer} [limit=8] * @param {Function} iterator * @return {Aigle} Returns an Aigle instance @@ -1342,6 +1360,56 @@ var Aigle = (function (AigleCore) { return addProxy(this, FindLimit, limit, iterator); }; + /** + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ + Aigle.prototype.findIndex = function findIndex (iterator) { + return addProxy(this, FindIndex, iterator); + }; + + /** + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ + Aigle.prototype.findIndexSeries = function findIndexSeries (iterator) { + return addProxy(this, FindIndexSeries, iterator); + }; + + /** + * @param {integer} [limit=8] + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ + Aigle.prototype.findIndexLimit = function findIndexLimit (limit, iterator) { + return addProxy(this, FindIndexLimit, limit, iterator); + }; + + /** + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ + Aigle.prototype.findKey = function findKey (iterator) { + return addProxy(this, FindKey, iterator); + }; + + /** + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ + Aigle.prototype.findKeySeries = function findKeySeries (iterator) { + return addProxy(this, FindKeySeries, iterator); + }; + + /** + * @param {integer} [limit=8] + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ + Aigle.prototype.findKeyLimit = function findKeyLimit (limit, iterator) { + return addProxy(this, FindKeyLimit, limit, iterator); + }; + /** * @param {Function|string} iterator * @return {Aigle} Returns an Aigle instance @@ -2614,7 +2682,7 @@ var Aigle = (function (AigleCore) { /** * `Aigle#concatLimit` is almost the same as [`Aigle#concat`](https://suguru03.github.io/aigle/docs/global.html#concat) - * and [`Aigle#concatSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#concat)), but it will work with concurrency. + * and [`Aigle#concatSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#concatSeries)), but it will work with concurrency. * @param {integer} [limit=8] * @param {Function} iterator * @example @@ -3214,111 +3282,129 @@ var FindSeries = ref$22.FindSeries; var ref$23 = require('./findLimit'); var findLimit = ref$23.findLimit; var FindLimit = ref$23.FindLimit; -var ref$24 = require('./pick'); -var pick = ref$24.pick; -var Pick = ref$24.Pick; -var ref$25 = require('./pickSeries'); -var pickSeries = ref$25.pickSeries; -var PickSeries = ref$25.PickSeries; -var ref$26 = require('./pickLimit'); -var pickLimit = ref$26.pickLimit; -var PickLimit = ref$26.PickLimit; -var ref$27 = require('./omit'); -var omit = ref$27.omit; -var Omit = ref$27.Omit; -var ref$28 = require('./omitSeries'); -var omitSeries = ref$28.omitSeries; -var OmitSeries = ref$28.OmitSeries; -var ref$29 = require('./omitLimit'); -var omitLimit = ref$29.omitLimit; -var OmitLimit = ref$29.OmitLimit; -var ref$30 = require('./reduce'); -var reduce = ref$30.reduce; -var Reduce = ref$30.Reduce; -var ref$31 = require('./transform'); -var transform = ref$31.transform; -var Transform = ref$31.Transform; -var ref$32 = require('./transformSeries'); -var transformSeries = ref$32.transformSeries; -var TransformSeries = ref$32.TransformSeries; -var ref$33 = require('./transformLimit'); -var transformLimit = ref$33.transformLimit; -var TransformLimit = ref$33.TransformLimit; -var ref$34 = require('./sortBy'); -var sortBy = ref$34.sortBy; -var SortBy = ref$34.SortBy; -var ref$35 = require('./sortBySeries'); -var sortBySeries = ref$35.sortBySeries; -var SortBySeries = ref$35.SortBySeries; -var ref$36 = require('./sortByLimit'); -var sortByLimit = ref$36.sortByLimit; -var SortByLimit = ref$36.SortByLimit; -var ref$37 = require('./some'); -var some = ref$37.some; -var Some = ref$37.Some; -var ref$38 = require('./someSeries'); -var someSeries = ref$38.someSeries; -var SomeSeries = ref$38.SomeSeries; -var ref$39 = require('./someLimit'); -var someLimit = ref$39.someLimit; -var SomeLimit = ref$39.SomeLimit; -var ref$40 = require('./every'); -var every = ref$40.every; -var Every = ref$40.Every; -var ref$41 = require('./everySeries'); -var everySeries = ref$41.everySeries; -var EverySeries = ref$41.EverySeries; -var ref$42 = require('./everyLimit'); -var everyLimit = ref$42.everyLimit; -var EveryLimit = ref$42.EveryLimit; -var ref$43 = require('./concat'); -var concat = ref$43.concat; -var Concat = ref$43.Concat; -var ref$44 = require('./concatSeries'); -var concatSeries = ref$44.concatSeries; -var ConcatSeries = ref$44.ConcatSeries; -var ref$45 = require('./concatLimit'); -var concatLimit = ref$45.concatLimit; -var ConcatLimit = ref$45.ConcatLimit; -var ref$46 = require('./groupBy'); -var groupBy = ref$46.groupBy; -var GroupBy = ref$46.GroupBy; -var ref$47 = require('./groupBySeries'); -var groupBySeries = ref$47.groupBySeries; -var GroupBySeries = ref$47.GroupBySeries; -var ref$48 = require('./groupByLimit'); -var groupByLimit = ref$48.groupByLimit; -var GroupByLimit = ref$48.GroupByLimit; -var ref$49 = require('./join'); -var join = ref$49.join; -var Spread = ref$49.Spread; -var ref$50 = require('./delay'); -var delay = ref$50.delay; -var Delay = ref$50.Delay; +var ref$24 = require('./findIndex'); +var findIndex = ref$24.findIndex; +var FindIndex = ref$24.FindIndex; +var ref$25 = require('./findIndexSeries'); +var findIndexSeries = ref$25.findIndexSeries; +var FindIndexSeries = ref$25.FindIndexSeries; +var ref$26 = require('./findIndexLimit'); +var findIndexLimit = ref$26.findIndexLimit; +var FindIndexLimit = ref$26.FindIndexLimit; +var ref$27 = require('./findKey'); +var findKey = ref$27.findKey; +var FindKey = ref$27.FindKey; +var ref$28 = require('./findKeySeries'); +var findKeySeries = ref$28.findKeySeries; +var FindKeySeries = ref$28.FindKeySeries; +var ref$29 = require('./findKeyLimit'); +var findKeyLimit = ref$29.findKeyLimit; +var FindKeyLimit = ref$29.FindKeyLimit; +var ref$30 = require('./pick'); +var pick = ref$30.pick; +var Pick = ref$30.Pick; +var ref$31 = require('./pickSeries'); +var pickSeries = ref$31.pickSeries; +var PickSeries = ref$31.PickSeries; +var ref$32 = require('./pickLimit'); +var pickLimit = ref$32.pickLimit; +var PickLimit = ref$32.PickLimit; +var ref$33 = require('./omit'); +var omit = ref$33.omit; +var Omit = ref$33.Omit; +var ref$34 = require('./omitSeries'); +var omitSeries = ref$34.omitSeries; +var OmitSeries = ref$34.OmitSeries; +var ref$35 = require('./omitLimit'); +var omitLimit = ref$35.omitLimit; +var OmitLimit = ref$35.OmitLimit; +var ref$36 = require('./reduce'); +var reduce = ref$36.reduce; +var Reduce = ref$36.Reduce; +var ref$37 = require('./transform'); +var transform = ref$37.transform; +var Transform = ref$37.Transform; +var ref$38 = require('./transformSeries'); +var transformSeries = ref$38.transformSeries; +var TransformSeries = ref$38.TransformSeries; +var ref$39 = require('./transformLimit'); +var transformLimit = ref$39.transformLimit; +var TransformLimit = ref$39.TransformLimit; +var ref$40 = require('./sortBy'); +var sortBy = ref$40.sortBy; +var SortBy = ref$40.SortBy; +var ref$41 = require('./sortBySeries'); +var sortBySeries = ref$41.sortBySeries; +var SortBySeries = ref$41.SortBySeries; +var ref$42 = require('./sortByLimit'); +var sortByLimit = ref$42.sortByLimit; +var SortByLimit = ref$42.SortByLimit; +var ref$43 = require('./some'); +var some = ref$43.some; +var Some = ref$43.Some; +var ref$44 = require('./someSeries'); +var someSeries = ref$44.someSeries; +var SomeSeries = ref$44.SomeSeries; +var ref$45 = require('./someLimit'); +var someLimit = ref$45.someLimit; +var SomeLimit = ref$45.SomeLimit; +var ref$46 = require('./every'); +var every = ref$46.every; +var Every = ref$46.Every; +var ref$47 = require('./everySeries'); +var everySeries = ref$47.everySeries; +var EverySeries = ref$47.EverySeries; +var ref$48 = require('./everyLimit'); +var everyLimit = ref$48.everyLimit; +var EveryLimit = ref$48.EveryLimit; +var ref$49 = require('./concat'); +var concat = ref$49.concat; +var Concat = ref$49.Concat; +var ref$50 = require('./concatSeries'); +var concatSeries = ref$50.concatSeries; +var ConcatSeries = ref$50.ConcatSeries; +var ref$51 = require('./concatLimit'); +var concatLimit = ref$51.concatLimit; +var ConcatLimit = ref$51.ConcatLimit; +var ref$52 = require('./groupBy'); +var groupBy = ref$52.groupBy; +var GroupBy = ref$52.GroupBy; +var ref$53 = require('./groupBySeries'); +var groupBySeries = ref$53.groupBySeries; +var GroupBySeries = ref$53.GroupBySeries; +var ref$54 = require('./groupByLimit'); +var groupByLimit = ref$54.groupByLimit; +var GroupByLimit = ref$54.GroupByLimit; +var ref$55 = require('./join'); +var join = ref$55.join; +var Spread = ref$55.Spread; +var ref$56 = require('./delay'); +var delay = ref$56.delay; +var Delay = ref$56.Delay; var Timeout = require('./timeout'); -var ref$51 = require('./whilst'); -var whilst = ref$51.whilst; -var ref$52 = require('./doWhilst'); -var doWhilst = ref$52.doWhilst; -var ref$53 = require('./until'); -var until = ref$53.until; +var ref$57 = require('./whilst'); +var whilst = ref$57.whilst; +var ref$58 = require('./doWhilst'); +var doWhilst = ref$58.doWhilst; +var ref$59 = require('./until'); +var until = ref$59.until; var doUntil = require('./doUntil'); var retry = require('./retry'); -var ref$54 = require('./times'); -var times = ref$54.times; -var Times = ref$54.Times; -var ref$55 = require('./timesSeries'); -var timesSeries = ref$55.timesSeries; -var TimesSeries = ref$55.TimesSeries; -var ref$56 = require('./timesLimit'); -var timesLimit = ref$56.timesLimit; -var TimesLimit = ref$56.TimesLimit; -var ref$57 = require('./using'); -var using = ref$57.using; -var Disposer = ref$57.Disposer; -var ref$58 = require('./debug'); -var resolveStack = ref$58.resolveStack; -var reconstructStack = ref$58.reconstructStack; +var ref$60 = require('./times'); +var times = ref$60.times; +var Times = ref$60.Times; +var ref$61 = require('./timesSeries'); +var timesSeries = ref$61.timesSeries; +var TimesSeries = ref$61.TimesSeries; +var ref$62 = require('./timesLimit'); +var timesLimit = ref$62.timesLimit; +var TimesLimit = ref$62.TimesLimit; +var ref$63 = require('./using'); +var using = ref$63.using; +var Disposer = ref$63.Disposer; +var ref$64 = require('./debug'); +var resolveStack = ref$64.resolveStack; +var reconstructStack = ref$64.reconstructStack; Aigle.VERSION = VERSION; @@ -3351,6 +3437,12 @@ Aigle.rejectLimit = rejectLimit; Aigle.find = find; Aigle.findSeries = findSeries; Aigle.findLimit = findLimit; +Aigle.findIndex = findIndex; +Aigle.findIndexSeries = findIndexSeries; +Aigle.findIndexLimit = findIndexLimit; +Aigle.findKey = findKey; +Aigle.findKeySeries = findKeySeries; +Aigle.findKeyLimit = findKeyLimit; Aigle.detect = find; Aigle.detectSeries = findSeries; Aigle.detectLimit = findLimit; @@ -3401,9 +3493,9 @@ Aigle.config = config; Aigle.longStackTraces = longStackTraces; /* errors */ -var ref$59 = require('./error'); -var CancellationError = ref$59.CancellationError; -var TimeoutError = ref$59.TimeoutError; +var ref$65 = require('./error'); +var CancellationError = ref$65.CancellationError; +var TimeoutError = ref$65.TimeoutError; Aigle.CancellationError = CancellationError; Aigle.TimeoutError = TimeoutError; @@ -3603,7 +3695,7 @@ function longStackTraces() { } }).call(this,require('_process')) -},{"./all":3,"./attempt":4,"./concat":5,"./concatLimit":6,"./concatSeries":7,"./debug":8,"./delay":9,"./doUntil":10,"./doWhilst":11,"./each":12,"./eachLimit":13,"./eachSeries":14,"./error":15,"./every":16,"./everyLimit":17,"./everySeries":18,"./filter":19,"./filterLimit":20,"./filterSeries":21,"./find":22,"./findLimit":23,"./findSeries":24,"./groupBy":25,"./groupByLimit":26,"./groupBySeries":27,"./internal/async":28,"./internal/queue":30,"./internal/util":31,"./join":32,"./map":33,"./mapLimit":34,"./mapSeries":35,"./mapValues":36,"./mapValuesLimit":37,"./mapValuesSeries":38,"./omit":39,"./omitLimit":40,"./omitSeries":41,"./parallel":42,"./pick":43,"./pickLimit":44,"./pickSeries":45,"./promisify":46,"./promisifyAll":47,"./props":48,"./race":49,"./reduce":50,"./reject":51,"./rejectLimit":52,"./rejectSeries":53,"./retry":54,"./some":55,"./someLimit":56,"./someSeries":57,"./sortBy":58,"./sortByLimit":59,"./sortBySeries":60,"./timeout":61,"./times":62,"./timesLimit":63,"./timesSeries":64,"./transform":65,"./transformLimit":66,"./transformSeries":67,"./until":68,"./using":69,"./whilst":70,"_process":72,"aigle-core":71}],3:[function(require,module,exports){ +},{"./all":3,"./attempt":4,"./concat":5,"./concatLimit":6,"./concatSeries":7,"./debug":8,"./delay":9,"./doUntil":10,"./doWhilst":11,"./each":12,"./eachLimit":13,"./eachSeries":14,"./error":15,"./every":16,"./everyLimit":17,"./everySeries":18,"./filter":19,"./filterLimit":20,"./filterSeries":21,"./find":22,"./findIndex":23,"./findIndexLimit":24,"./findIndexSeries":25,"./findKey":26,"./findKeyLimit":27,"./findKeySeries":28,"./findLimit":29,"./findSeries":30,"./groupBy":31,"./groupByLimit":32,"./groupBySeries":33,"./internal/async":34,"./internal/queue":36,"./internal/util":37,"./join":38,"./map":39,"./mapLimit":40,"./mapSeries":41,"./mapValues":42,"./mapValuesLimit":43,"./mapValuesSeries":44,"./omit":45,"./omitLimit":46,"./omitSeries":47,"./parallel":48,"./pick":49,"./pickLimit":50,"./pickSeries":51,"./promisify":52,"./promisifyAll":53,"./props":54,"./race":55,"./reduce":56,"./reject":57,"./rejectLimit":58,"./rejectSeries":59,"./retry":60,"./some":61,"./someLimit":62,"./someSeries":63,"./sortBy":64,"./sortByLimit":65,"./sortBySeries":66,"./timeout":67,"./times":68,"./timesLimit":69,"./timesSeries":70,"./transform":71,"./transformLimit":72,"./transformSeries":73,"./until":74,"./using":75,"./whilst":76,"_process":78,"aigle-core":77}],3:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -3701,7 +3793,7 @@ function all(array) { } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],4:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],4:[function(require,module,exports){ 'use strict'; var ref = require('./aigle'); @@ -3727,32 +3819,30 @@ function attempt(handler) { return receiver; } -},{"./aigle":2,"./internal/util":31}],5:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37}],5:[function(require,module,exports){ 'use strict'; var ref = require('./each'); var Each = ref.Each; +var ref$1 = require('./internal/util'); +var concatArray = ref$1.concatArray; +var ref$2 = require('./internal/collection'); +var setParallel = ref$2.setParallel; var Concat = (function (Each) { function Concat(collection, iterator) { - Each.call(this, collection, iterator); - this._result = []; + Each.call(this, collection, iterator, set); } if ( Each ) Concat.__proto__ = Each; Concat.prototype = Object.create( Each && Each.prototype ); Concat.prototype.constructor = Concat; - Concat.prototype._callResolve = function _callResolve (value) { - if (Array.isArray(value)) { - (ref = this._result).push.apply(ref, value); - } else { - this._result.push(value); - } + Concat.prototype._callResolve = function _callResolve (value, index) { + this._result[index] = value; if (--this._rest === 0) { - this._promise._resolve(this._result); + this._promise._resolve(concatArray(this._result)); } - var ref; }; return Concat; @@ -3760,6 +3850,12 @@ var Concat = (function (Each) { module.exports = { concat: concat, Concat: Concat }; +function set(collection) { + setParallel.call(this, collection); + this._result = Array(this._rest); + return this; +} + /** * `Aigle.concat` has almost the same functionality as `Array#concat`. * It iterates all elements of `collection` and executes `iterator` using each element on parallel. @@ -3806,34 +3902,32 @@ function concat(collection, iterator) { return new Concat(collection, iterator)._execute(); } -},{"./each":12}],6:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],6:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); var EachLimit = ref.EachLimit; +var ref$1 = require('./internal/util'); +var concatArray = ref$1.concatArray; +var ref$2 = require('./internal/collection'); +var setLimit = ref$2.setLimit; var ConcatLimit = (function (EachLimit) { function ConcatLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); - this._result = []; + EachLimit.call(this, collection, limit, iterator, set); } if ( EachLimit ) ConcatLimit.__proto__ = EachLimit; ConcatLimit.prototype = Object.create( EachLimit && EachLimit.prototype ); ConcatLimit.prototype.constructor = ConcatLimit; - ConcatLimit.prototype._callResolve = function _callResolve (value) { - if (Array.isArray(value)) { - (ref = this._result).push.apply(ref, value); - } else { - this._result.push(value); - } + ConcatLimit.prototype._callResolve = function _callResolve (value, index) { + this._result[index] = value; if (--this._rest === 0) { - this._promise._resolve(this._result); + this._promise._resolve(concatArray(this._result)); } else if (this._callRest-- > 0) { this._iterate(); } - var ref; }; return ConcatLimit; @@ -3841,6 +3935,11 @@ var ConcatLimit = (function (EachLimit) { module.exports = { concatLimit: concatLimit, ConcatLimit: ConcatLimit }; +function set(collection) { + setLimit.call(this, collection); + this._result = Array(this._rest); + return this; +} /** * `Aigle.concatLimit` is almost the as [`Aigle.concat`](https://suguru03.github.io/aigle/docs/Aigle.html#concat) and @@ -3907,7 +4006,7 @@ function concatLimit(collection, limit, iterator) { return new ConcatLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13}],7:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],7:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); @@ -3926,7 +4025,7 @@ var ConcatSeries = (function (EachSeries) { ConcatSeries.prototype._callResolve = function _callResolve (value) { if (Array.isArray(value)) { (ref = this._result).push.apply(ref, value); - } else { + } else if (value !== undefined) { this._result.push(value); } if (--this._rest === 0) { @@ -4071,7 +4170,7 @@ function delay(ms, value) { return new Delay(ms)._resolve(value); } -},{"./aigle":2,"./internal/util":31}],10:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37}],10:[function(require,module,exports){ 'use strict'; var ref = require('./doWhilst'); @@ -4135,7 +4234,7 @@ function doUntil(value, iterator, tester) { return new DoWhilst(new UntilTester(tester), iterator)._iterate(value); } -},{"./doWhilst":11,"./until":68}],11:[function(require,module,exports){ +},{"./doWhilst":11,"./until":74}],11:[function(require,module,exports){ 'use strict'; var ref = require('./whilst'); @@ -4215,7 +4314,7 @@ function doWhilst(value, iterator, tester) { return new DoWhilst(new WhilstTester(tester), iterator)._iterate(value); } -},{"./whilst":70}],12:[function(require,module,exports){ +},{"./whilst":76}],12:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -4231,21 +4330,24 @@ var execute = ref$3.execute; var setParallel = ref$3.setParallel; var Each = (function (AigleProxy) { - function Each(collection, iterator) { + function Each(collection, iterator, set) { + if ( set === void 0 ) set = setParallel; + AigleProxy.call(this); this._iterator = iterator; this._promise = new Aigle(INTERNAL); this._coll = undefined; + this._size = undefined; this._rest = undefined; this._keys = undefined; this._result = undefined; this._iterate = undefined; if (collection === PENDING) { - this._set = setParallel; + this._set = set; this._iterate = this._callResolve; this._callResolve = execute; } else { - setParallel.call(this, collection); + set.call(this, collection); } } @@ -4331,7 +4433,7 @@ function each(collection, iterator) { return new Each(collection, iterator)._execute(); } -},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],13:[function(require,module,exports){ +},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],13:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -4348,7 +4450,9 @@ var execute = ref$3.execute; var setLimit = ref$3.setLimit; var EachLimit = (function (AigleProxy) { - function EachLimit(collection, limit, iterator) { + function EachLimit(collection, limit, iterator, set) { + if ( set === void 0 ) set = setLimit; + AigleProxy.call(this); if (typeof limit === 'function') { iterator = limit; @@ -4366,11 +4470,11 @@ var EachLimit = (function (AigleProxy) { this._iterate = undefined; this._callRest = undefined; if (collection === PENDING) { - this._set = setLimit; + this._set = set; this._iterate = this._callResolve; this._callResolve = execute; } else { - setLimit.call(this, collection); + set.call(this, collection); } } @@ -4496,7 +4600,7 @@ function eachLimit(collection, limit, iterator) { } -},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],14:[function(require,module,exports){ +},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],14:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -4512,7 +4616,9 @@ var execute = ref$3.execute; var setSeries = ref$3.setSeries; var EachSeries = (function (AigleProxy) { - function EachSeries(collection, iterator) { + function EachSeries(collection, iterator, set) { + if ( set === void 0 ) set = setSeries; + AigleProxy.call(this); this._iterator = iterator; this._promise = new Aigle(INTERNAL); @@ -4524,11 +4630,11 @@ var EachSeries = (function (AigleProxy) { this._result = undefined; this._iterate = undefined; if (collection === PENDING) { - this._set = setSeries; + this._set = set; this._iterate = this._callResolve; this._callResolve = execute; } else { - setSeries.call(this, collection); + set.call(this, collection); } } @@ -4613,7 +4719,7 @@ function eachSeries(collection, iterator) { return new EachSeries(collection, iterator)._execute(); } -},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],15:[function(require,module,exports){ +},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],15:[function(require,module,exports){ 'use strict'; var types = [ @@ -4765,7 +4871,7 @@ function every(collection, iterator) { return new Every(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],17:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],17:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); @@ -4956,17 +5062,11 @@ var ref$1 = require('./internal/collection'); var setShorthand = ref$1.setShorthand; var ref$2 = require('./internal/util'); var INTERNAL = ref$2.INTERNAL; -var PENDING = ref$2.PENDING; var compactArray = ref$2.compactArray; var Filter = (function (Each) { function Filter(collection, iterator) { - Each.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + Each.call(this, collection, iterator, set); } if ( Each ) Filter.__proto__ = Each; @@ -5002,6 +5102,12 @@ function callResolveObject(value, index) { } /** + * `Aigle.filter` has almost the same functionality as `Array#filter`. + * It iterates all elements of `collection` and executes `iterator` using each element on parallel. + * The `iterator` needs to return a promise or something. + * If a promise is returned, the function will wait until the promise is fulfilled. + * If the result is falsy, the element will be removed. + * All of them are finished, the function will return an array as a result. * @param {Array|Object} collection * @param {Function|Array|Object|string} iterator * @return {Aigle} Returns an Aigle instance @@ -5077,7 +5183,7 @@ function filter(collection, iterator) { return new Filter(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],20:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],20:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); @@ -5086,18 +5192,11 @@ var ref$1 = require('./internal/collection'); var setLimit = ref$1.setLimit; var ref$2 = require('./internal/util'); var INTERNAL = ref$2.INTERNAL; -var PENDING = ref$2.PENDING; var compactArray = ref$2.compactArray; var FilterLimit = (function (EachLimit) { function FilterLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + EachLimit.call(this, collection, limit, iterator, set); } if ( EachLimit ) FilterLimit.__proto__ = EachLimit; @@ -5135,6 +5234,8 @@ function callResolveObject(value, index) { } /** + * `Aigle.filterLimit` is almost the as [`Aigle.filter`](https://suguru03.github.io/aigle/docs/Aigle.html#filter) and + * [`Aigle.filterSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#filterSeries), but it will work with concurrency. * @param {Array|Object} collection * @param {integer} [limit=8] * @param {Function} iterator @@ -5197,7 +5298,7 @@ function filterLimit(collection, limit, iterator) { return new FilterLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],21:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],21:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); @@ -5206,18 +5307,11 @@ var ref$1 = require('./internal/collection'); var setSeries = ref$1.setSeries; var ref$2 = require('./internal/util'); var INTERNAL = ref$2.INTERNAL; -var PENDING = ref$2.PENDING; var compactArray = ref$2.compactArray; var FilterSeries = (function (EachSeries) { function FilterSeries(collection, iterator) { - EachSeries.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + EachSeries.call(this, collection, iterator, set); } if ( EachSeries ) FilterSeries.__proto__ = EachSeries; @@ -5255,6 +5349,7 @@ function callResolveObject(value, index) { } /** + * `Aigle.filterSeries` is almost the as [`Aigle.filter`](https://suguru03.github.io/aigle/docs/Aigle.html#filter), but it will work in series. * @param {Array|Object} collection * @param {Function} iterator * @return {Aigle} Returns an Aigle instance @@ -5294,24 +5389,17 @@ function filterSeries(collection, iterator) { return new FilterSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],22:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],22:[function(require,module,exports){ 'use strict'; var ref = require('./each'); var Each = ref.Each; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setShorthand = ref$2.setShorthand; +var ref$1 = require('./internal/collection'); +var setShorthand = ref$1.setShorthand; var Find = (function (Each) { function Find(collection, iterator) { - Each.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + Each.call(this, collection, iterator, set); } if ( Each ) Find.__proto__ = Each; @@ -5348,6 +5436,11 @@ function callResolveObject(value, index) { } /** + * `Aigle.find` has almost the same functionality as `Array#find`. + * It iterates all elements of `collection` and executes `iterator` using each element on parallel. + * The `iterator` needs to return a promise or something. + * If a promise is returned, the function will wait until the promise is fulfilled. + * If the result is truthly, the element will be returned as a result. * @param {Array|Object} collection * @param {Function|Array|Object|string} iterator * @return {Aigle} Returns an Aigle instance @@ -5436,56 +5529,360 @@ function find(collection, iterator) { return new Find(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],23:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],23:[function(require,module,exports){ +'use strict'; + +var ref = require('./each'); +var Each = ref.Each; +var ref$1 = require('./internal/collection'); +var setShorthand = ref$1.setShorthand; + +var FindIndex = (function (Each) { + function FindIndex(collection, iterator) { + Each.call(this, collection, iterator, set); + this._result = -1; + } + + if ( Each ) FindIndex.__proto__ = Each; + FindIndex.prototype = Object.create( Each && Each.prototype ); + FindIndex.prototype.constructor = FindIndex; + + FindIndex.prototype._callResolve = function _callResolve (value, index) { + if (value) { + this._size = 0; + this._promise._resolve(index); + } else if (--this._rest === 0) { + this._promise._resolve(-1); + } + }; + + return FindIndex; +}(Each)); + +module.exports = { findIndex: findIndex, FindIndex: FindIndex }; + +function set(collection) { + setShorthand.call(this, collection); + if (this._keys !== undefined) { + this._rest = 0; + } + return this; +} + +/** + * @param {Array|Object} collection + * @param {Function|Array|Object|string} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findIndex(collection, iterator) { + return new FindIndex(collection, iterator)._execute(); +} + +},{"./each":12,"./internal/collection":35}],24:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); var EachLimit = ref.EachLimit; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setLimit = ref$2.setLimit; +var ref$1 = require('./internal/collection'); +var setLimit = ref$1.setLimit; -var FindLimit = (function (EachLimit) { - function FindLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } +var FindIndexLimit = (function (EachLimit) { + function FindIndexLimit(collection, limit, iterator) { + EachLimit.call(this, collection, limit, iterator, set); + this._result = -1; } - if ( EachLimit ) FindLimit.__proto__ = EachLimit; - FindLimit.prototype = Object.create( EachLimit && EachLimit.prototype ); - FindLimit.prototype.constructor = FindLimit; + if ( EachLimit ) FindIndexLimit.__proto__ = EachLimit; + FindIndexLimit.prototype = Object.create( EachLimit && EachLimit.prototype ); + FindIndexLimit.prototype.constructor = FindIndexLimit; - return FindLimit; + FindIndexLimit.prototype._callResolve = function _callResolve (value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(index); + } else if (--this._rest === 0) { + this._promise._resolve(-1); + } else if (this._callRest-- > 0) { + this._iterate(); + } + }; + + return FindIndexLimit; }(EachLimit)); -module.exports = { findLimit: findLimit, FindLimit: FindLimit }; +module.exports = { findIndexLimit: findIndexLimit, FindIndexLimit: FindIndexLimit }; function set(collection) { setLimit.call(this, collection); + if (this._keys !== undefined) { + this._rest = 0; + } + return this; +} + +/** + * @param {Array|Object} collection + * @param {integer} [limit=8] + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findIndexLimit(collection, limit, iterator) { + return new FindIndexLimit(collection, limit, iterator)._execute(); +} + +},{"./eachLimit":13,"./internal/collection":35}],25:[function(require,module,exports){ +'use strict'; + +var ref = require('./eachSeries'); +var EachSeries = ref.EachSeries; +var ref$1 = require('./internal/collection'); +var setSeries = ref$1.setSeries; + +var FindIndexSeries = (function (EachSeries) { + function FindIndexSeries(collection, iterator) { + EachSeries.call(this, collection, iterator, set); + this._result = -1; + } + + if ( EachSeries ) FindIndexSeries.__proto__ = EachSeries; + FindIndexSeries.prototype = Object.create( EachSeries && EachSeries.prototype ); + FindIndexSeries.prototype.constructor = FindIndexSeries; + FindIndexSeries.prototype._callResolve = function _callResolve (value, index) { + if (value) { + this._promise._resolve(index); + } else if (--this._rest === 0) { + this._promise._resolve(-1); + } else { + this._iterate(); + } + }; + + return FindIndexSeries; +}(EachSeries)); + +module.exports = { findIndexSeries: findIndexSeries, FindIndexSeries: FindIndexSeries }; + +function set(collection) { + setSeries.call(this, collection); + if (this._keys !== undefined) { + this._rest = 0; + } + return this; +} + +/** + * @param {Array|Object} collection + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findIndexSeries(collection, iterator) { + return new FindIndexSeries(collection, iterator)._execute(); +} + +},{"./eachSeries":14,"./internal/collection":35}],26:[function(require,module,exports){ +'use strict'; + +var ref = require('./each'); +var Each = ref.Each; +var ref$1 = require('./internal/collection'); +var setShorthand = ref$1.setShorthand; + +var FindKey = (function (Each) { + function FindKey(collection, iterator) { + Each.call(this, collection, iterator, set); + } + + if ( Each ) FindKey.__proto__ = Each; + FindKey.prototype = Object.create( Each && Each.prototype ); + FindKey.prototype.constructor = FindKey; + + return FindKey; +}(Each)); + +module.exports = { findKey: findKey, FindKey: FindKey }; + +function set(collection) { + setShorthand.call(this, collection); this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; return this; } function callResolveArray(value, index) { if (value) { - this._callRest = 0; - this._promise._resolve(this._coll[index]); + this._size = 0; + this._promise._resolve(("" + index)); } else if (--this._rest === 0) { this._promise._resolve(); - } else if (this._callRest-- > 0) { - this._iterate(); } } function callResolveObject(value, index) { if (value) { - this._callRest = 0; - this._promise._resolve(this._coll[this._keys[index]]); + this._size = 0; + this._promise._resolve(this._keys[index]); + } else if (--this._rest === 0) { + this._promise._resolve(); + } +} + +/** + * @param {Array|Object} collection + * @param {Function|Array|Object|string} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findKey(collection, iterator) { + return new FindKey(collection, iterator)._execute(); +} + +},{"./each":12,"./internal/collection":35}],27:[function(require,module,exports){ +'use strict'; + +var ref = require('./eachLimit'); +var EachLimit = ref.EachLimit; +var ref$1 = require('./internal/collection'); +var setLimit = ref$1.setLimit; + +var FindKeyLimit = (function (EachLimit) { + function FindKeyLimit(collection, limit, iterator) { + EachLimit.call(this, collection, limit, iterator, set); + } + + if ( EachLimit ) FindKeyLimit.__proto__ = EachLimit; + FindKeyLimit.prototype = Object.create( EachLimit && EachLimit.prototype ); + FindKeyLimit.prototype.constructor = FindKeyLimit; + + return FindKeyLimit; +}(EachLimit)); + +module.exports = { findKeyLimit: findKeyLimit, FindKeyLimit: FindKeyLimit }; + +function set(collection) { + setLimit.call(this, collection); + this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + return this; +} + +function callResolveArray(value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(("" + index)); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else if (this._callRest-- > 0) { + this._iterate(); + } +} + +function callResolveObject(value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(this._keys[index]); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else if (this._callRest-- > 0) { + this._iterate(); + } +} + +/** + * @param {Array|Object} collection + * @param {integer} [limit=8] + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findKeyLimit(collection, limit, iterator) { + return new FindKeyLimit(collection, limit, iterator)._execute(); +} + +},{"./eachLimit":13,"./internal/collection":35}],28:[function(require,module,exports){ +'use strict'; + +var ref = require('./eachSeries'); +var EachSeries = ref.EachSeries; +var ref$1 = require('./internal/collection'); +var setSeries = ref$1.setSeries; + +var FindKeySeries = (function (EachSeries) { + function FindKeySeries(collection, iterator) { + EachSeries.call(this, collection, iterator, set); + } + + if ( EachSeries ) FindKeySeries.__proto__ = EachSeries; + FindKeySeries.prototype = Object.create( EachSeries && EachSeries.prototype ); + FindKeySeries.prototype.constructor = FindKeySeries; + + return FindKeySeries; +}(EachSeries)); + +module.exports = { findKeySeries: findKeySeries, FindKeySeries: FindKeySeries }; + +function set(collection) { + setSeries.call(this, collection); + this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + return this; +} + +function callResolveArray(value, index) { + if (value) { + this._promise._resolve(("" + index)); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else { + this._iterate(); + } +} + +function callResolveObject(value, index) { + if (value) { + this._promise._resolve(this._keys[index]); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else { + this._iterate(); + } +} + +/** + * @param {Array|Object} collection + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findKeySeries(collection, iterator) { + return new FindKeySeries(collection, iterator)._execute(); +} + +},{"./eachSeries":14,"./internal/collection":35}],29:[function(require,module,exports){ +'use strict'; + +var ref = require('./eachLimit'); +var EachLimit = ref.EachLimit; +var ref$1 = require('./internal/collection'); +var setLimit = ref$1.setLimit; + +var FindLimit = (function (EachLimit) { + function FindLimit(collection, limit, iterator) { + EachLimit.call(this, collection, limit, iterator, set); + } + + if ( EachLimit ) FindLimit.__proto__ = EachLimit; + FindLimit.prototype = Object.create( EachLimit && EachLimit.prototype ); + FindLimit.prototype.constructor = FindLimit; + + return FindLimit; +}(EachLimit)); + +module.exports = { findLimit: findLimit, FindLimit: FindLimit }; + +function set(collection) { + setLimit.call(this, collection); + this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + return this; +} + +function callResolveArray(value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(this._coll[index]); } else if (--this._rest === 0) { this._promise._resolve(); } else if (this._callRest-- > 0) { @@ -5493,8 +5890,20 @@ function callResolveObject(value, index) { } } +function callResolveObject(value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(this._coll[this._keys[index]]); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else if (this._callRest-- > 0) { + this._iterate(); + } +} /** + * `Aigle.findLimit` is almost the as [`Aigle.find`](https://suguru03.github.io/aigle/docs/Aigle.html#find) and + * [`Aigle.findSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#findSeries), but it will work with concurrency. * @param {Array|Object} collection * @param {integer} [limit=8] * @param {Function} iterator @@ -5551,24 +5960,17 @@ function findLimit(collection, limit, iterator) { return new FindLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],24:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],30:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); var EachSeries = ref.EachSeries; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setSeries = ref$2.setSeries; +var ref$1 = require('./internal/collection'); +var setSeries = ref$1.setSeries; var FindSeries = (function (EachSeries) { function FindSeries(collection, iterator) { - EachSeries.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + EachSeries.call(this, collection, iterator, set); } if ( EachSeries ) FindSeries.__proto__ = EachSeries; @@ -5607,6 +6009,7 @@ function callResolveObject(value, index) { } /** + * `Aigle.findSeries` is almost the as [`Aigle.find`](https://suguru03.github.io/aigle/docs/Aigle.html#find), but it will work in series. * @param {Array|Object} collection * @param {Function} iterator * @return {Aigle} Returns an Aigle instance @@ -5662,25 +6065,18 @@ function findSeries(collection, iterator) { return new FindSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],25:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],31:[function(require,module,exports){ 'use strict'; var ref = require('./each'); var Each = ref.Each; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setShorthand = ref$2.setShorthand; +var ref$1 = require('./internal/collection'); +var setShorthand = ref$1.setShorthand; var GroupBy = (function (Each) { function GroupBy(collection, iterator) { - Each.call(this, collection, iterator); + Each.call(this, collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } if ( Each ) GroupBy.__proto__ = Each; @@ -5792,25 +6188,18 @@ function groupBy(collection, iterator) { return new GroupBy(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],26:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],32:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); var EachLimit = ref.EachLimit; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setLimit = ref$2.setLimit; +var ref$1 = require('./internal/collection'); +var setLimit = ref$1.setLimit; var GroupByLimit = (function (EachLimit) { function GroupByLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); + EachLimit.call(this, collection, limit, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } if ( EachLimit ) GroupByLimit.__proto__ = EachLimit; @@ -5917,25 +6306,18 @@ function groupByLimit(collection, limit, iterator) { return new GroupByLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],27:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],33:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); var EachSeries = ref.EachSeries; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setSeries = ref$2.setSeries; +var ref$1 = require('./internal/collection'); +var setSeries = ref$1.setSeries; var GroupBySeries = (function (EachSeries) { function GroupBySeries(collection, iterator) { - EachSeries.call(this, collection, iterator); + EachSeries.call(this, collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } if ( EachSeries ) GroupBySeries.__proto__ = EachSeries; @@ -6019,7 +6401,7 @@ function groupBySeries(collection, iterator) { return new GroupBySeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],28:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],34:[function(require,module,exports){ 'use strict'; var queue = Array(8); @@ -6057,7 +6439,7 @@ function invoke(promise) { module.exports = invoke; -},{}],29:[function(require,module,exports){ +},{}],35:[function(require,module,exports){ 'use strict'; var ref = require('./util'); @@ -6325,7 +6707,7 @@ function iterateObjectWithObject() { } } -},{"./util":31}],30:[function(require,module,exports){ +},{"./util":37}],36:[function(require,module,exports){ 'use strict'; var Queue = function Queue(size) { @@ -6341,7 +6723,7 @@ Queue.prototype.push = function push (task) { module.exports = Queue; -},{}],31:[function(require,module,exports){ +},{}],37:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -6370,6 +6752,7 @@ module.exports = { promiseArrayEach: promiseArrayEach, promiseObjectEach: promiseObjectEach, compactArray: compactArray, + concatArray: concatArray, clone: clone, sort: sort }; @@ -6595,6 +6978,21 @@ function compactArray(array) { return result; } +function concatArray(array) { + var i = -1; + var l = array.length; + var result = []; + while (++i < l) { + var value = array[i]; + if (Array.isArray(value)) { + result.push.apply(result, value); + } else if (value !== undefined) { + result.push(value); + } + } + return result; +} + function clone(target) { return Array.isArray(target) ? cloneArray(target) : cloneObject(target); } @@ -6632,7 +7030,7 @@ function sort(array) { return array; } -},{"../../package.json":74,"aigle-core":71}],32:[function(require,module,exports){ +},{"../../package.json":80,"aigle-core":77}],38:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -6766,24 +7164,17 @@ function spread(proxy, array) { callProxyReciever(apply(_handler, array), proxy, INTERNAL); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],33:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],39:[function(require,module,exports){ 'use strict'; var ref = require('./each'); var Each = ref.Each; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setShorthand = ref$2.setShorthand; +var ref$1 = require('./internal/collection'); +var setShorthand = ref$1.setShorthand; var Map = (function (Each) { function Map(collection, iterator) { - Each.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + Each.call(this, collection, iterator, set); } if ( Each ) Map.__proto__ = Each; @@ -6809,6 +7200,11 @@ function set(collection) { } /** + * `Aigle.map` has almost the same functionality as `Array#map`. + * It iterates all elements of `collection` and executes `iterator` using each element on parallel. + * The `iterator` needs to return a promise or something. + * Then the result will be assigned to an array and the array order will be ensured. + * All of them are finished, the function will return an array as a result. * @param {Array|Object} collection * @param {Function|string} iterator * @return {Aigle} Returns an Aigle instance @@ -6859,24 +7255,17 @@ function map(collection, iterator) { return new Map(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],34:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],40:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); var EachLimit = ref.EachLimit; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setLimit = ref$2.setLimit; +var ref$1 = require('./internal/collection'); +var setLimit = ref$1.setLimit; var MapLimit = (function (EachLimit) { function MapLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - } + EachLimit.call(this, collection, limit, iterator, set); } if ( EachLimit ) MapLimit.__proto__ = EachLimit; @@ -6905,6 +7294,8 @@ function set(collection) { /** + * `Aigle.mapLimit` is almost the as [`Aigle.map`](https://suguru03.github.io/aigle/docs/Aigle.html#map) and + * [`Aigle.mapSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#mapSeries), but it will work with concurrency. * @param {Array|Object} collection * @param {integer} [limit=8] * @param {Function} iterator @@ -6962,24 +7353,17 @@ function mapLimit(collection, limit, iterator) { } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],35:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],41:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); var EachSeries = ref.EachSeries; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setSeries = ref$2.setSeries; +var ref$1 = require('./internal/collection'); +var setSeries = ref$1.setSeries; var MapSeries = (function (EachSeries) { function MapSeries(collection, iterator) { - EachSeries.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - } + EachSeries.call(this, collection, iterator, set); } if ( EachSeries ) MapSeries.__proto__ = EachSeries; @@ -7007,6 +7391,7 @@ function set(collection) { } /** + * `Aigle.mapSeries` is almost the as [`Aigle.map`](https://suguru03.github.io/aigle/docs/Aigle.html#map), but it will work in series. * @param {Array|Object} collection * @param {Function} iterator * @return {Aigle} Returns an Aigle instance @@ -7046,25 +7431,18 @@ function mapSeries(collection, iterator) { return new MapSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],36:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],42:[function(require,module,exports){ 'use strict'; var ref = require('./each'); var Each = ref.Each; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setShorthand = ref$2.setShorthand; +var ref$1 = require('./internal/collection'); +var setShorthand = ref$1.setShorthand; var MapValues = (function (Each) { function MapValues(collection, iterator) { - Each.call(this, collection, iterator); + Each.call(this, collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } if ( Each ) MapValues.__proto__ = Each; @@ -7145,25 +7523,18 @@ function mapValues(collection, iterator) { return new MapValues(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],37:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],43:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); var EachLimit = ref.EachLimit; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setLimit = ref$2.setLimit; +var ref$1 = require('./internal/collection'); +var setLimit = ref$1.setLimit; var MapValuesLimit = (function (EachLimit) { function MapValuesLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); + EachLimit.call(this, collection, limit, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } if ( EachLimit ) MapValuesLimit.__proto__ = EachLimit; @@ -7256,25 +7627,18 @@ function mapValuesLimit(collection, limit, iterator) { return new MapValuesLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],38:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],44:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); var EachSeries = ref.EachSeries; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setSeries = ref$2.setSeries; +var ref$1 = require('./internal/collection'); +var setSeries = ref$1.setSeries; var MapValuesSeries = (function (EachSeries) { function MapValuesSeries(collection, iterator) { - EachSeries.call(this, collection, iterator); + EachSeries.call(this, collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } if ( EachSeries ) MapValuesSeries.__proto__ = EachSeries; @@ -7350,25 +7714,18 @@ function mapValuesSeries(collection, iterator) { return new MapValuesSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],39:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],45:[function(require,module,exports){ 'use strict'; var ref = require('./each'); var Each = ref.Each; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setShorthand = ref$2.setShorthand; +var ref$1 = require('./internal/collection'); +var setShorthand = ref$1.setShorthand; var Omit = (function (Each) { function Omit(collection, iterator) { - Each.call(this, collection, iterator); + Each.call(this, collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } if ( Each ) Omit.__proto__ = Each; @@ -7481,25 +7838,18 @@ function omit(collection, iterator) { return new Omit(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],40:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],46:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); var EachLimit = ref.EachLimit; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setLimit = ref$2.setLimit; +var ref$1 = require('./internal/collection'); +var setLimit = ref$1.setLimit; var OmitLimit = (function (EachLimit) { function OmitLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); + EachLimit.call(this, collection, limit, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } if ( EachLimit ) OmitLimit.__proto__ = EachLimit; @@ -7597,7 +7947,7 @@ function omitLimit(collection, limit, iterator) { return new OmitLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],41:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],47:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); @@ -7696,7 +8046,7 @@ function omitSeries(collection, iterator) { return new OmitSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],42:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],48:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -7828,25 +8178,18 @@ function parallel(collection) { return new Parallel(collection)._execute(); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],43:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],49:[function(require,module,exports){ 'use strict'; var ref = require('./each'); var Each = ref.Each; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setShorthand = ref$2.setShorthand; +var ref$1 = require('./internal/collection'); +var setShorthand = ref$1.setShorthand; var Pick = (function (Each) { function Pick(collection, iterator) { - Each.call(this, collection, iterator); + Each.call(this, collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } if ( Each ) Pick.__proto__ = Each; @@ -7959,25 +8302,18 @@ function pick(collection, iterator) { return new Pick(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],44:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],50:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); var EachLimit = ref.EachLimit; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setLimit = ref$2.setLimit; +var ref$1 = require('./internal/collection'); +var setLimit = ref$1.setLimit; var PickLimit = (function (EachLimit) { function PickLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); + EachLimit.call(this, collection, limit, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } if ( EachLimit ) PickLimit.__proto__ = EachLimit; @@ -8075,25 +8411,18 @@ function pickLimit(collection, limit, iterator) { return new PickLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],45:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],51:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); var EachSeries = ref.EachSeries; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setSeries = ref$2.setSeries; +var ref$1 = require('./internal/collection'); +var setSeries = ref$1.setSeries; var PickSeries = (function (EachSeries) { function PickSeries(collection, iterator) { - EachSeries.call(this, collection, iterator); + EachSeries.call(this, collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } if ( EachSeries ) PickSeries.__proto__ = EachSeries; @@ -8174,7 +8503,7 @@ function pickSeries(collection, iterator) { return new PickSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],46:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],52:[function(require,module,exports){ 'use strict'; var ref = require('./aigle'); @@ -8303,7 +8632,7 @@ function makeFunction(fn, ctx) { } } -},{"./aigle":2,"./internal/util":31}],47:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37}],53:[function(require,module,exports){ 'use strict'; var promisify = require('./promisify'); @@ -8397,7 +8726,7 @@ function iterate(suffix, filter, obj, target, depth, memo) { } } -},{"./promisify":46}],48:[function(require,module,exports){ +},{"./promisify":52}],54:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -8496,7 +8825,7 @@ function props(object) { return new Props(object)._execute(); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],49:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],55:[function(require,module,exports){ 'use strict'; var ref = require('./parallel'); @@ -8543,7 +8872,7 @@ function race(collection) { return new Race(collection)._execute(); } -},{"./parallel":42}],50:[function(require,module,exports){ +},{"./parallel":48}],56:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -8671,7 +9000,7 @@ function reduce(collection, iterator, result) { return new Reduce(collection, iterator, result)._execute(); } -},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],51:[function(require,module,exports){ +},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],57:[function(require,module,exports){ 'use strict'; var ref = require('./each'); @@ -8680,17 +9009,11 @@ var ref$1 = require('./internal/collection'); var setShorthand = ref$1.setShorthand; var ref$2 = require('./internal/util'); var INTERNAL = ref$2.INTERNAL; -var PENDING = ref$2.PENDING; var compactArray = ref$2.compactArray; var Reject = (function (Each) { function Reject(collection, iterator) { - Each.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + Each.call(this, collection, iterator, set); } if ( Each ) Reject.__proto__ = Each; @@ -8811,7 +9134,7 @@ function reject(collection, iterator) { return new Reject(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],52:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],58:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); @@ -8820,18 +9143,11 @@ var ref$1 = require('./internal/collection'); var setLimit = ref$1.setLimit; var ref$2 = require('./internal/util'); var INTERNAL = ref$2.INTERNAL; -var PENDING = ref$2.PENDING; var compactArray = ref$2.compactArray; var RejectLimit = (function (EachLimit) { function RejectLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + EachLimit.call(this, collection, limit, iterator, set); } if ( EachLimit ) RejectLimit.__proto__ = EachLimit; @@ -8925,7 +9241,7 @@ function rejectLimit(collection, limit, iterator) { return new RejectLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],53:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],59:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); @@ -8934,18 +9250,11 @@ var ref$1 = require('./internal/collection'); var setSeries = ref$1.setSeries; var ref$2 = require('./internal/util'); var INTERNAL = ref$2.INTERNAL; -var PENDING = ref$2.PENDING; var compactArray = ref$2.compactArray; var RejectSeries = (function (EachSeries) { function RejectSeries(collection, iterator) { - EachSeries.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + EachSeries.call(this, collection, iterator, set); } if ( EachSeries ) RejectSeries.__proto__ = EachSeries; @@ -9022,7 +9331,7 @@ function rejectSeries(collection, iterator) { return new RejectSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],54:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],60:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -9104,25 +9413,18 @@ function retry(times, handler) { return new Retry(handler, times)._promise; } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],55:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],61:[function(require,module,exports){ 'use strict'; var ref = require('./each'); var Each = ref.Each; -var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; -var ref$2 = require('./internal/collection'); -var setShorthand = ref$2.setShorthand; +var ref$1 = require('./internal/collection'); +var setShorthand = ref$1.setShorthand; var Some = (function (Each) { function Some(collection, iterator) { - Each.call(this, collection, iterator); + Each.call(this, collection, iterator, setShorthand); this._result = false; - if (collection === PENDING) { - this._set = setShorthand; - } else { - setShorthand.call(this, collection); - } } if ( Each ) Some.__proto__ = Each; @@ -9231,7 +9533,7 @@ function some(collection, iterator) { return new Some(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],56:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],62:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); @@ -9319,7 +9621,7 @@ function someLimit(collection, limit, iterator) { return new SomeLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13}],57:[function(require,module,exports){ +},{"./eachLimit":13}],63:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries.js'); @@ -9406,25 +9708,19 @@ function someSeries(collection, iterator) { return new SomeSeries(collection, iterator)._execute(); } -},{"./eachSeries.js":14}],58:[function(require,module,exports){ +},{"./eachSeries.js":14}],64:[function(require,module,exports){ 'use strict'; var ref = require('./each'); var Each = ref.Each; var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; var sort = ref$1.sort; var ref$2 = require('./internal/collection'); var setShorthand = ref$2.setShorthand; var SortBy = (function (Each) { function SortBy(collection, iterator) { - Each.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + Each.call(this, collection, iterator, set); } if ( Each ) SortBy.__proto__ = Each; @@ -9509,26 +9805,19 @@ function sortBy(collection, iterator) { return new SortBy(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],59:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],65:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); var EachLimit = ref.EachLimit; var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; var sort = ref$1.sort; var ref$2 = require('./internal/collection'); var setLimit = ref$2.setLimit; var SortByLimit = (function (EachLimit) { function SortByLimit(collection, limit, iterator) { - EachLimit.call(this, collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + EachLimit.call(this, collection, limit, iterator, set); } if ( EachLimit ) SortByLimit.__proto__ = EachLimit; @@ -9622,26 +9911,19 @@ function sortByLimit(collection, limit, iterator) { return new SortByLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],60:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],66:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); var EachSeries = ref.EachSeries; var ref$1 = require('./internal/util'); -var PENDING = ref$1.PENDING; var sort = ref$1.sort; var ref$2 = require('./internal/collection'); var setSeries = ref$2.setSeries; var SortBySeries = (function (EachSeries) { function SortBySeries(collection, iterator) { - EachSeries.call(this, collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + EachSeries.call(this, collection, iterator, set); } if ( EachSeries ) SortBySeries.__proto__ = EachSeries; @@ -9718,7 +10000,7 @@ function sortBySeries(collection, iterator) { return new SortBySeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],61:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],67:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -9765,7 +10047,7 @@ var Timeout = (function (AigleProxy) { module.exports = Timeout; -},{"./aigle":2,"./error":15,"./internal/util":31,"aigle-core":71}],62:[function(require,module,exports){ +},{"./aigle":2,"./error":15,"./internal/util":37,"aigle-core":77}],68:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -9869,7 +10151,7 @@ function times(times, iterator) { return new Times(times, iterator)._execute(); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],63:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],69:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -10011,7 +10293,7 @@ function timesLimit(times, limit, iterator) { return new TimesLimit(times, limit, iterator)._execute(); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],64:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],70:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -10105,7 +10387,7 @@ function timesSeries(times, iterator) { return new TimesSeries(times, iterator)._execute(); } -},{"./aigle":2,"./internal/util":31,"./times":62,"aigle-core":71}],65:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"./times":68,"aigle-core":77}],71:[function(require,module,exports){ 'use strict'; var ref = require('./each'); @@ -10113,22 +10395,16 @@ var Each = ref.Each; var ref$1 = require('./internal/collection'); var setParallel = ref$1.setParallel; var ref$2 = require('./internal/util'); -var PENDING = ref$2.PENDING; var call3 = ref$2.call3; var callProxyReciever = ref$2.callProxyReciever; var clone = ref$2.clone; var Transform = (function (Each) { function Transform(collection, iterator, accumulator) { - Each.call(this, collection, iterator); + Each.call(this, collection, iterator, set); if (accumulator !== undefined) { this._result = accumulator; } - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } if ( Each ) Transform.__proto__ = Each; @@ -10250,7 +10526,7 @@ function transform(collection, iterator, accumulator) { return new Transform(collection, iterator, accumulator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],66:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],72:[function(require,module,exports){ 'use strict'; var ref = require('./eachLimit'); @@ -10259,7 +10535,6 @@ var ref$1 = require('./internal/collection'); var setLimit = ref$1.setLimit; var ref$2 = require('./internal/util'); var DEFAULT_LIMIT = ref$2.DEFAULT_LIMIT; -var PENDING = ref$2.PENDING; var call3 = ref$2.call3; var callProxyReciever = ref$2.callProxyReciever; var clone = ref$2.clone; @@ -10271,15 +10546,10 @@ var TransformLimit = (function (EachLimit) { iterator = limit; limit = DEFAULT_LIMIT; } - EachLimit.call(this, collection, limit, iterator); + EachLimit.call(this, collection, limit, iterator, set); if (accumulator !== undefined) { this._result = accumulator; } - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } if ( EachLimit ) TransformLimit.__proto__ = EachLimit; @@ -10403,7 +10673,7 @@ function transformLimit(collection, limit, iterator, accumulator) { return new TransformLimit(collection, limit, iterator, accumulator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],67:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],73:[function(require,module,exports){ 'use strict'; var ref = require('./eachSeries'); @@ -10411,22 +10681,16 @@ var EachSeries = ref.EachSeries; var ref$1 = require('./internal/collection'); var setSeries = ref$1.setSeries; var ref$2 = require('./internal/util'); -var PENDING = ref$2.PENDING; var call3 = ref$2.call3; var callProxyReciever = ref$2.callProxyReciever; var clone = ref$2.clone; var TransformSeries = (function (EachSeries) { function TransformSeries(collection, iterator, accumulator) { - EachSeries.call(this, collection, iterator); + EachSeries.call(this, collection, iterator, set); if (accumulator !== undefined) { this._result = accumulator; } - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } if ( EachSeries ) TransformSeries.__proto__ = EachSeries; @@ -10533,7 +10797,7 @@ function transformSeries(collection, iterator, accumulator) { return new TransformSeries(collection, iterator, accumulator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],68:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],74:[function(require,module,exports){ 'use strict'; var ref = require('./whilst'); @@ -10576,7 +10840,7 @@ function until(value, tester, iterator) { return new AigleWhilst(new UntilTester(tester), iterator)._iterate(value); } -},{"./whilst":70}],69:[function(require,module,exports){ +},{"./whilst":76}],75:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -10709,7 +10973,7 @@ function using() { return new Using(array, handler)._promise; } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],70:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],76:[function(require,module,exports){ 'use strict'; var ref = require('aigle-core'); @@ -10802,7 +11066,7 @@ function whilst(value, tester, iterator) { return new AigleWhilst(new WhilstTester(tester), iterator)._iterate(value); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],71:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],77:[function(require,module,exports){ 'use strict'; var AigleCore = function AigleCore() {}; @@ -10811,7 +11075,7 @@ var AigleProxy = function AigleProxy() {}; module.exports = { AigleCore: AigleCore, AigleProxy: AigleProxy }; -},{}],72:[function(require,module,exports){ +},{}],78:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -10999,7 +11263,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],73:[function(require,module,exports){ +},{}],79:[function(require,module,exports){ (function (process,global){ (function (global, undefined) { "use strict"; @@ -11191,14 +11455,15 @@ process.umask = function() { return 0; }; }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":72}],74:[function(require,module,exports){ +},{"_process":78}],80:[function(require,module,exports){ module.exports={ "name": "aigle", - "version": "1.4.2", + "version": "1.5.0", "description": "Aigle is an ideal Promise library, faster and more functional than other Promise libraries", "main": "index.js", "browser": "browser.js", "scripts": { + "bench": "node --expose_gc ./benchmark -d", "test": "DELAY=50 istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -R spec ./test --recursive && codecov" }, "keywords": [ @@ -11216,7 +11481,7 @@ module.exports={ "author": "Suguru Motegi", "license": "MIT", "devDependencies": { - "babili": "0.1.2", + "babili": "0.1.4", "benchmark": "^2.1.1", "bluebird": "^3.5.0", "browserify": "^14.1.0", diff --git a/dist/aigle-es5.min.js b/dist/aigle-es5.min.js index 5e40b59a..1471b70b 100644 --- a/dist/aigle-es5.min.js +++ b/dist/aigle-es5.min.js @@ -1 +1 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Promise=t()}}(function(){return function t(e,i,r){function s(n,l){if(!i[n]){if(!e[n]){var c="function"==typeof require&&require;if(!l&&c)return c(n,!0);if(o)return o(n,!0);var u=new Error("Cannot find module '"+n+"'");throw u.code="MODULE_NOT_FOUND",u}var a=i[n]={exports:{}};e[n][0].call(a.exports,function(t){var i=e[n][1][t];return s(i||t)},a,a.exports,t,e,i,r)}return i[n].exports}for(var o="function"==typeof require&&require,n=0;n1){var r=arguments.length;if("function"==typeof(t=arguments[--r])){for(var s=Array(r);r--;)s[r]=i[r];t=l(s,t)}}return u(this,new e(x),void 0,t)},e.prototype.finally=function(t){return t="function"!=typeof t?t:c(this,t),u(this,new e(x),t,t)},e.prototype.cancel=function(){if(this._execute!==o){var t=this._onCancelQueue;if(t){var e=-1,i=t.array;for(this._onCancelQueue=void 0;++e0&&this._iterate();var e},e}(t("./eachLimit").EachLimit);e.exports={concatLimit:r,ConcatLimit:s}},{"./eachLimit":13}],7:[function(t,e,i){"use strict";function r(t,e){return new s(t,e)._execute()}var s=function(t){function e(e,i){t.call(this,e,i),this._result=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){Array.isArray(t)?(e=this._result).push.apply(e,t):this._result.push(t),0==--this._rest?this._promise._resolve(this._result):this._iterate();var e},e}(t("./eachSeries").EachSeries);e.exports={concatSeries:r,ConcatSeries:s}},{"./eachSeries":14}],8:[function(t,e,i){"use strict";function r(t,e){var i=(new Error).stack;t._stacks=t._stacks||[],e&&e._stacks&&(s=t._stacks).push.apply(s,e._stacks);var r=i.split("\n").slice(4);t._stacks.push(r.join("\n"));var s}function s(t){var e=t._value,i=t._stacks;if(e instanceof Error!=!1&&i&&!e._reconstructed){for(var r=e.stack.split("\n"),s=i.length;s--;)r.push("From previous event:"),r.push(i[s]);e.stack=r.join("\n"),e._reconstructed=!0}}e.exports={resolveStack:r,reconstructStack:s}},{}],9:[function(t,e,i){"use strict";function r(t,e){return new n(t)._resolve(e)}var s=t("./aigle").Aigle,o=t("./internal/util").INTERNAL,n=function(t){function e(e){t.call(this,o),this._ms=e,this._timer=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._resolve=function(e){var i=this;return this._timer=setTimeout(function(){return t.prototype._resolve.call(i,e)},this._ms),this},e.prototype._reject=function(e){clearTimeout(this._timer),t.prototype._reject.call(this,e)},e}(s);e.exports={delay:r,Delay:n}},{"./aigle":2,"./internal/util":31}],10:[function(t,e,i){"use strict";function r(t,e,i){return"function"!=typeof i&&(i=e,e=t,t=void 0),new s(new o(i),e)._iterate(t)}var s=t("./doWhilst").DoWhilst,o=t("./until").UntilTester;e.exports=r},{"./doWhilst":11,"./until":68}],11:[function(t,e,i){"use strict";function r(t,e,i){return"function"!=typeof i&&(i=e,e=t,t=void 0),new l(new n(i),e)._iterate(t)}var s=t("./whilst"),o=s.AigleWhilst,n=s.WhilstTester,l=function(t){function e(e,i){t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._iterate=function(t){return this._next(t),this._promise},e}(o);e.exports={doWhilst:r,DoWhilst:l}},{"./whilst":70}],12:[function(t,e,i){"use strict";function r(t,e){return new h(t,e)._execute()}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),l=n.INTERNAL,c=n.PENDING,u=t("./internal/collection"),a=u.execute,_=u.setParallel,h=function(t){function e(e,i){t.call(this),this._iterator=i,this._promise=new o(l),this._coll=void 0,this._rest=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,e===c?(this._set=_,this._iterate=this._callResolve,this._callResolve=a):_.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){return 0===this._rest?this._promise._resolve(this._result):this._iterate(),this._promise},e.prototype._callResolve=function(t){0!=--this._rest&&!1!==t||this._promise._resolve()},e.prototype._callReject=function(t){this._promise._reject(t)},e}(s);e.exports={each:r,Each:h}},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],13:[function(t,e,i){"use strict";function r(t,e,i){return new p(t,e,i)._execute()}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),l=n.DEFAULT_LIMIT,c=n.INTERNAL,u=n.PENDING,a=t("./internal/collection"),_=a.execute,h=a.setLimit,p=function(t){function e(e,i,r){t.call(this),"function"==typeof i&&(r=i,i=l),this._iterator=r,this._promise=new o(c),this._index=0,this._limit=i,this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,this._callRest=void 0,e===u?(this._set=h,this._iterate=this._callResolve,this._callResolve=_):h.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){var t=this;if(0===this._rest)this._promise._resolve(this._result);else for(;this._limit--;)t._iterate();return this._promise},e.prototype._callResolve=function(t){!1===t?(this._callRest=0,this._promise._resolve()):0==--this._rest?this._promise._resolve():this._callRest-- >0&&this._iterate()},e.prototype._callReject=function(t){this._callRest=0,this._promise._reject(t)},e}(s);e.exports={eachLimit:r,EachLimit:p}},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],14:[function(t,e,i){"use strict";function r(t,e){return new h(t,e)._execute()}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),l=n.INTERNAL,c=n.PENDING,u=t("./internal/collection"),a=u.execute,_=u.setSeries,h=function(t){function e(e,i){t.call(this),this._iterator=i,this._promise=new o(l),this._index=0,this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,e===c?(this._set=_,this._iterate=this._callResolve,this._callResolve=a):_.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){return 0===this._rest?this._promise._resolve(this._result):this._iterate(),this._promise},e.prototype._callResolve=function(t){0==--this._rest||!1===t?this._promise._resolve():this._iterate()},e.prototype._callReject=function(t){this._promise._reject(t)},e}(s);e.exports={eachSeries:r,EachSeries:h}},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],15:[function(t,e,i){"use strict";for(var r=["CancellationError","TimeoutError"],s=r.length;s--;)i[r[s]]=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error)},{}],16:[function(t,e,i){"use strict";function r(t,e){return new l(t,e)._execute()}var s=t("./each").Each,o=t("./internal/util").PENDING,n=t("./internal/collection").setShorthand,l=function(t){function e(e,i){t.call(this,e,i),this._result=!0,e===o?this._set=n:n.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?0==--this._rest&&this._promise._resolve(!0):this._promise._resolve(!1)},e}(s);e.exports={every:r,Every:l}},{"./each":12,"./internal/collection":29,"./internal/util":31}],17:[function(t,e,i){"use strict";function r(t,e,i){return new s(t,e,i)._execute()}var s=function(t){function e(e,i,r){t.call(this,e,i,r),this._result=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?0==--this._rest?this._promise._resolve(!0):this._callRest-- >0&&this._iterate():this._promise._resolve(!1)},e}(t("./eachLimit").EachLimit);e.exports={everyLimit:r,EveryLimit:s}},{"./eachLimit":13}],18:[function(t,e,i){"use strict";function r(t,e){return new s(t,e)._execute()}var s=function(t){function e(e,i){t.call(this,e,i),this._result=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?0==--this._rest?this._promise._resolve(!0):this._iterate():this._promise._resolve(!1)},e}(t("./eachSeries.js").EachSeries);e.exports={everySeries:r,EverySeries:s}},{"./eachSeries.js":14}],19:[function(t,e,i){"use strict";function r(t){return c.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?this._coll[e]:a,0==--this._rest&&this._promise._resolve(h(this._result))}function o(t,e){this._result[e]=t?this._coll[this._keys[e]]:a,0==--this._rest&&this._promise._resolve(h(this._result))}function n(t,e){return new p(t,e)._execute()}var l=t("./each").Each,c=t("./internal/collection").setShorthand,u=t("./internal/util"),a=u.INTERNAL,_=u.PENDING,h=u.compactArray,p=function(t){function e(e,i){t.call(this,e,i),e===_?this._set=r:r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);p.prototype._set=r,e.exports={filter:n,Filter:p}},{"./each":12,"./internal/collection":29,"./internal/util":31}],20:[function(t,e,i){"use strict";function r(t){return c.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?this._coll[e]:a,0==--this._rest?this._promise._resolve(h(this._result)):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[e]=t?this._coll[this._keys[e]]:a,0==--this._rest?this._promise._resolve(h(this._result)):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new p(t,e,i)._execute()}var l=t("./eachLimit").EachLimit,c=t("./internal/collection").setLimit,u=t("./internal/util"),a=u.INTERNAL,_=u.PENDING,h=u.compactArray,p=function(t){function e(e,i,n){t.call(this,e,i,n),e===_?this._set=r:(this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={filterLimit:n,FilterLimit:p}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],21:[function(t,e,i){"use strict";function r(t){return c.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?this._coll[e]:a,0==--this._rest?this._promise._resolve(h(this._result)):this._iterate()}function o(t,e){this._result[e]=t?this._coll[this._keys[e]]:a,0==--this._rest?this._promise._resolve(h(this._result)):this._iterate()}function n(t,e){return new p(t,e)._execute()}var l=t("./eachSeries").EachSeries,c=t("./internal/collection").setSeries,u=t("./internal/util"),a=u.INTERNAL,_=u.PENDING,h=u.compactArray,p=function(t){function e(e,i){t.call(this,e,i),e===_?this._set=r:(this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={filterSeries:n,FilterSeries:p}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],22:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t?(this._size=0,this._promise._resolve(this._coll[e])):0==--this._rest&&this._promise._resolve()}function o(t,e){t?(this._size=0,this._promise._resolve(this._coll[this._keys[e]])):0==--this._rest&&this._promise._resolve()}function n(t,e){return new a(t,e)._execute()}var l=t("./each").Each,c=t("./internal/util").PENDING,u=t("./internal/collection").setShorthand,a=function(t){function e(e,i){t.call(this,e,i),e===c?this._set=r:r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={find:n,Find:a}},{"./each":12,"./internal/collection":29,"./internal/util":31}],23:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t?(this._callRest=0,this._promise._resolve(this._coll[e])):0==--this._rest?this._promise._resolve():this._callRest-- >0&&this._iterate()}function o(t,e){t?(this._callRest=0,this._promise._resolve(this._coll[this._keys[e]])):0==--this._rest?this._promise._resolve():this._callRest-- >0&&this._iterate()}function n(t,e,i){return new a(t,e,i)._execute()}var l=t("./eachLimit").EachLimit,c=t("./internal/util").PENDING,u=t("./internal/collection").setLimit,a=function(t){function e(e,i,n){t.call(this,e,i,n),e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={findLimit:n,FindLimit:a}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],24:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t?this._promise._resolve(this._coll[e]):0==--this._rest?this._promise._resolve():this._iterate()}function o(t,e){t?this._promise._resolve(this._coll[this._keys[e]]):0==--this._rest?this._promise._resolve():this._iterate()}function n(t,e){return new a(t,e)._execute()}var l=t("./eachSeries").EachSeries,c=t("./internal/util").PENDING,u=t("./internal/collection").setSeries,a=function(t){function e(e,i){t.call(this,e,i),e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={findSeries:n,FindSeries:a}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],25:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[t]?this._result[t].push(this._coll[e]):this._result[t]=[this._coll[e]],0==--this._rest&&this._promise._resolve(this._result)}function o(t,e){this._result[t]?this._result[t].push(this._coll[this._keys[e]]):this._result[t]=[this._coll[this._keys[e]]],0==--this._rest&&this._promise._resolve(this._result)}function n(t,e){return new a(t,e)._execute()}var l=t("./each").Each,c=t("./internal/util").PENDING,u=t("./internal/collection").setShorthand,a=function(t){function e(e,i){t.call(this,e,i),this._result={},e===c?this._set=r:r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={groupBy:n,GroupBy:a}},{"./each":12,"./internal/collection":29,"./internal/util":31}],26:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[t]?this._result[t].push(this._coll[e]):this._result[t]=[this._coll[e]],0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[t]?this._result[t].push(this._coll[this._keys[e]]):this._result[t]=[this._coll[this._keys[e]]],0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new a(t,e,i)._execute()}var l=t("./eachLimit").EachLimit,c=t("./internal/util").PENDING,u=t("./internal/collection").setLimit,a=function(t){function e(e,i,n){t.call(this,e,i,n),this._result={},e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={groupByLimit:n,GroupByLimit:a}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],27:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[t]?this._result[t].push(this._coll[e]):this._result[t]=[this._coll[e]],0==--this._rest?this._promise._resolve(this._result):this._iterate()}function o(t,e){this._result[t]?this._result[t].push(this._coll[this._keys[e]]):this._result[t]=[this._coll[this._keys[e]]],0==--this._rest?this._promise._resolve(this._result):this._iterate()}function n(t,e){return new a(t,e)._execute()}var l=t("./eachSeries").EachSeries,c=t("./internal/util").PENDING,u=t("./internal/collection").setSeries,a=function(t){function e(e,i){t.call(this,e,i),this._result={},e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={groupBySeries:n,GroupBySeries:a}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],28:[function(t,e,i){"use strict";function r(){for(var t=-1;++t0&&this._iterate()},e}(o);e.exports={mapLimit:s,MapLimit:c}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],35:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._result=Array(this._rest),this}function s(t,e){return new c(t,e)._execute()}var o=t("./eachSeries").EachSeries,n=t("./internal/util").PENDING,l=t("./internal/collection").setSeries,c=function(t){function e(e,i){t.call(this,e,i),e===n?this._set=r:this._result=Array(this._rest)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t,e){this._result[e]=t,0==--this._rest?this._promise._resolve(this._result):this._iterate()},e}(o);e.exports={mapSeries:s,MapSeries:c}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],36:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t,0==--this._rest&&this._promise._resolve(this._result)}function o(t,e){this._result[this._keys[e]]=t,0==--this._rest&&this._promise._resolve(this._result)}function n(t,e){return new a(t,e)._execute()}var l=t("./each").Each,c=t("./internal/util").PENDING,u=t("./internal/collection").setShorthand,a=function(t){function e(e,i){t.call(this,e,i),this._result={},e===c?this._set=r:r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={mapValues:n,MapValues:a}},{"./each":12,"./internal/collection":29,"./internal/util":31}],37:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t,0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[this._keys[e]]=t,0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new a(t,e,i)._execute()}var l=t("./eachLimit").EachLimit,c=t("./internal/util").PENDING,u=t("./internal/collection").setLimit,a=function(t){function e(e,i,n){t.call(this,e,i,n),this._result={},e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={mapValuesLimit:n,MapValuesLimit:a}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],38:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t,0==--this._rest?this._promise._resolve(this._result):this._iterate()}function o(t,e){this._result[this._keys[e]]=t,0==--this._rest?this._promise._resolve(this._result):this._iterate()}function n(t,e){return new a(t,e)._execute()}var l=t("./eachSeries").EachSeries,c=t("./internal/util").PENDING,u=t("./internal/collection").setSeries,a=function(t){function e(e,i){t.call(this,e,i),this._result={},e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={mapValuesSeries:n,MapValuesSeries:a}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],39:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t||(this._result[e]=this._coll[e]),0==--this._rest&&this._promise._resolve(this._result)}function o(t,e){if(!t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest&&this._promise._resolve(this._result)}function n(t,e){return new a(t,e)._execute()}var l=t("./each").Each,c=t("./internal/util").PENDING,u=t("./internal/collection").setShorthand,a=function(t){function e(e,i){t.call(this,e,i),this._result={},e===c?this._set=r:r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={omit:n,Omit:a}},{"./each":12,"./internal/collection":29,"./internal/util":31}],40:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t||(this._result[e]=this._coll[e]),0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function o(t,e){if(!t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new a(t,e,i)._execute()}var l=t("./eachLimit").EachLimit,c=t("./internal/util").PENDING,u=t("./internal/collection").setLimit,a=function(t){function e(e,i,n){t.call(this,e,i,n),this._result={},e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={omitLimit:n,OmitLimit:a}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],41:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t||(this._result[e]=this._coll[e]),0==--this._rest?this._promise._resolve(this._result):this._iterate()}function o(t,e){if(!t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest?this._promise._resolve(this._result):this._iterate()}function n(t,e){return new a(t,e)._execute()}var l=t("./eachSeries").EachSeries,c=t("./internal/util").PENDING,u=t("./internal/collection").setSeries,a=function(t){function e(e,i){t.call(this,e,i),this._result={},e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={omitSeries:n,OmitSeries:a}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],42:[function(t,e,i){"use strict";function r(t){this._callResolve=this._result,s.call(this,t),this._execute()}function s(t){if(Array.isArray(t)){var e=t.length;this._rest=e,this._coll=t,this._result=Array(e),this._iterate=_}else if(t&&"object"==typeof t){var i=Object.keys(t);this._rest=i.length,this._coll=t,this._keys=i,this._result={},this._iterate=h}else this._rest=0,this._result={};return this}function o(t){return new p(t)._execute()}var n=t("aigle-core").AigleProxy,l=t("./aigle").Aigle,c=t("./internal/util"),u=c.INTERNAL,a=c.PENDING,_=c.promiseArrayEach,h=c.promiseObjectEach,p=function(t){function e(e){t.call(this),this._promise=new l(u),this._rest=void 0,this._coll=void 0,this._keys=void 0,this._result=void 0,e===a?(this._result=this._callResolve,this._callResolve=r):s.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._keys?_(this):h(this),this._promise},e.prototype._callResolve=function(t,e){this._result[e]=t,0==--this._rest&&this._promise._resolve(this._result)},e.prototype._callReject=function(t){this._promise._reject(t)},e}(n);e.exports={parallel:o,Parallel:p}},{"./aigle":2,"./internal/util":31,"aigle-core":71}],43:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t&&(this._result[e]=this._coll[e]),0==--this._rest&&this._promise._resolve(this._result)}function o(t,e){if(t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest&&this._promise._resolve(this._result)}function n(t,e){return new a(t,e)._execute()}var l=t("./each").Each,c=t("./internal/util").PENDING,u=t("./internal/collection").setShorthand,a=function(t){function e(e,i){t.call(this,e,i),this._result={},e===c?this._set=r:r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={pick:n,Pick:a}},{"./each":12,"./internal/collection":29,"./internal/util":31}],44:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t&&(this._result[e]=this._coll[e]),0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function o(t,e){if(t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new a(t,e,i)._execute()}var l=t("./eachLimit").EachLimit,c=t("./internal/util").PENDING,u=t("./internal/collection").setLimit,a=function(t){function e(e,i,n){t.call(this,e,i,n),this._result={},e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={pickLimit:n,PickLimit:a}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],45:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t&&(this._result[e]=this._coll[e]),0==--this._rest?this._promise._resolve(this._result):this._iterate()}function o(t,e){if(t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest?this._promise._resolve(this._result):this._iterate()}function n(t,e){return new a(t,e)._execute()}var l=t("./eachSeries").EachSeries,c=t("./internal/util").PENDING,u=t("./internal/collection").setSeries,a=function(t){function e(e,i){t.call(this,e,i),this._result={},e===c?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={pickSeries:n,PickSeries:a}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],46:[function(t,e,i){"use strict";function r(t,e){switch(typeof t){case"object":switch(typeof e){case"string":case"number":return t[e].__isPromisified__?t[e]:o(t,e);default:throw new TypeError("Second argument is invalid")}case"function":return t.__isPromisified__?t:n(t,e&&void 0!==e.context?e.context:void 0);default:throw new TypeError("Type of first argument is not function")}}function s(t){return function(e,i){e?t._reject(e):t._resolve(i)}}function o(t,e){function i(i){var r=arguments,o=new l(c),n=s(o),u=arguments.length;switch(u){case 0:t[e](n);break;case 1:t[e](i,n);break;default:for(var a=Array(u);u--;)a[u]=r[u];a[a.length]=n,t[e].apply(t,a)}return o}return i.__isPromisified__=!0,i}function n(t,e){function i(i){var r=arguments,o=new l(c),n=s(o),u=arguments.length;switch(u){case 0:t.call(e||this,n);break;case 1:t.call(e||this,i,n);break;default:for(var a=Array(u);u--;)a[u]=r[u];a[a.length]=n,t.apply(e||this,a)}return o}return i.__isPromisified__=!0,i}var l=t("./aigle").Aigle,c=t("./internal/util").INTERNAL;e.exports=r},{"./aigle":2,"./internal/util":31}],47:[function(t,e,i){"use strict";function r(t,e){var i=e||{},r=i.suffix;void 0===r&&(r="Async");var n=i.filter;void 0===n&&(n=s);var l=i.depth;return void 0===l&&(l=2),o(r,n,t,void 0,void 0,l),t}function s(t){return/^_/.test(t)}function o(t,e,i,r,s,o){var c={};switch(typeof i){case"function":if(s){var u=""+r+t;if(s[u]){if(!s[u].__isPromisified__)throw new TypeError("Cannot promisify an API that has normal methods with '"+t+"'-suffix")}else s[u]=l(i)}n(t,e,i,i,o,c),n(t,e,i.prototype,i.prototype,o,c);break;case"object":n(t,e,i,i,o,c),n(t,e,Object.getPrototypeOf(i),i,o,c)}}function n(t,e,i,r,s,n){if(0!=s--&&i&&u!==i&&a!==i&&_!==i&&!Object.isFrozen(i))for(var l=Object.getOwnPropertyNames(i),h=l.length;h--;){var p=l[h];if(!0!==c[p]&&!0!==n[p]&&!e(p)){var f=Object.getOwnPropertyDescriptor(i,p);!f||f.set||f.get||(n[p]=!0,o(t,e,i[p],p,r,s))}}}var l=t("./promisify"),c={constructor:!0,arity:!0,length:!0,name:!0,arguments:!0,caller:!0,callee:!0,prototype:!0,__isPromisified__:!0};e.exports=r;var u=Function.prototype,a=Object.prototype,_=Array.prototype},{"./promisify":46}],48:[function(t,e,i){"use strict";function r(t){var e=Object.keys(t);return this._rest=e.length,this._coll=t,this._keys=e,this._callResolve=this._execute,s.call(this),this}function s(){return 0===this._rest?this._promise._resolve(this._result):_(this),this._promise}function o(t){return new h(t)._execute()}var n=t("aigle-core").AigleProxy,l=t("./aigle").Aigle,c=t("./internal/util"),u=c.INTERNAL,a=c.PENDING,_=c.promiseObjectEach,h=function(t){function e(e){if(t.call(this),this._promise=new l(u),this._result={},e===a)this._rest=void 0,this._coll=void 0,this._keys=void 0,this._execute=this._callResolve,this._callResolve=r;else{var i=Object.keys(e);this._rest=i.length,this._coll=e,this._keys=i,this._execute=s}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t,e){this._result[e]=t,0==--this._rest&&this._promise._resolve(this._result)},e.prototype._callReject=function(t){this._promise._reject(t)},e}(n);e.exports={props:o,Props:h},e.exports={props:o,Props:h}},{"./aigle":2,"./internal/util":31,"aigle-core":71}],49:[function(t,e,i){"use strict";function r(t){return new s(t)._execute()}var s=function(t){function e(e){t.call(this,e),this._result=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){this._promise._resolve(t)},e}(t("./parallel").Parallel);e.exports={race:r,Race:s}},{"./parallel":42}],50:[function(t,e,i){"use strict";function r(t){return p.call(this,t),void 0===this._keys?(this._iterate=s,this._execute=n):(this._iterate=o,this._execute=l),this}function s(t,e){d(m(this._iterator,e,this._coll[t],t),this,t)}function o(t,e){var i=this._keys[t];d(m(this._iterator,e,this._coll[i],i),this,t)}function n(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._result?this._callResolve(this._coll[0],0):this._iterate(0,this._result),this._promise}function l(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._result?this._callResolve(this._coll[this._keys[0]],0):this._iterate(0,this._result),this._promise}function c(t,e,i){return new R(t,e,i)._execute()}var u=t("aigle-core").AigleProxy,a=t("./aigle").Aigle,_=t("./internal/collection"),h=_.execute,p=_.setSeries,f=t("./internal/util"),v=f.INTERNAL,y=f.PENDING,m=f.call3,d=f.callProxyReciever,R=function(t){function e(e,i,s){t.call(this),this._result=s,this._iterator=i,this._promise=new a(v),this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._iterate=void 0,e===y?(this._set=r,this._iterate=this._callResolve,this._callResolve=h):r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t,e){0==--this._rest?this._promise._resolve(t):this._iterate(++e,t)},e.prototype._callReject=function(t){this._promise._reject(t)},e}(u);e.exports={reduce:c,Reduce:R}},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],51:[function(t,e,i){"use strict";function r(t){return c.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?a:this._coll[e],0==--this._rest&&this._promise._resolve(h(this._result))}function o(t,e){this._result[e]=t?a:this._coll[this._keys[e]],0==--this._rest&&this._promise._resolve(h(this._result))}function n(t,e){return new p(t,e)._execute()}var l=t("./each").Each,c=t("./internal/collection").setShorthand,u=t("./internal/util"),a=u.INTERNAL,_=u.PENDING,h=u.compactArray,p=function(t){function e(e,i){t.call(this,e,i),e===_?this._set=r:r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={reject:n,Reject:p}},{"./each":12,"./internal/collection":29,"./internal/util":31}],52:[function(t,e,i){"use strict";function r(t){return c.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?a:this._coll[e],0==--this._rest?this._promise._resolve(h(this._result)):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[e]=t?a:this._coll[this._keys[e]],0==--this._rest?this._promise._resolve(h(this._result)):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new p(t,e,i)._execute()}var l=t("./eachLimit").EachLimit,c=t("./internal/collection").setLimit,u=t("./internal/util"),a=u.INTERNAL,_=u.PENDING,h=u.compactArray,p=function(t){function e(e,i,n){t.call(this,e,i,n),e===_?this._set=r:(this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={rejectLimit:n,RejectLimit:p}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],53:[function(t,e,i){"use strict";function r(t){return c.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?a:this._coll[e],0==--this._rest?this._promise._resolve(h(this._result)):this._iterate()}function o(t,e){this._result[e]=t?a:this._coll[this._keys[e]],0==--this._rest?this._promise._resolve(h(this._result)):this._iterate()}function n(t,e){return new p(t,e)._execute()}var l=t("./eachSeries").EachSeries,c=t("./internal/collection").setSeries,u=t("./internal/util"),a=u.INTERNAL,_=u.PENDING,h=u.compactArray,p=function(t){function e(e,i){t.call(this,e,i),e===_?this._set=r:(this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={rejectSeries:n,RejectSeries:p}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],54:[function(t,e,i){"use strict";function r(t,e){return"function"==typeof t&&(e=t,t=a),new _(e,t)._promise}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),l=n.INTERNAL,c=n.call0,u=n.callProxyReciever,a=5,_=function(t){function e(e,i){t.call(this),this._promise=new o(l),this._rest=i,this._handler=e,this._iterate()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._iterate=function(){u(c(this._handler),this,void 0)},e.prototype._callResolve=function(t){this._promise._resolve(t)},e.prototype._callReject=function(t){0==--this._rest?this._promise._reject(t):this._iterate()},e}(s);e.exports=r},{"./aigle":2,"./internal/util":31,"aigle-core":71}],55:[function(t,e,i){"use strict";function r(t,e){return new l(t,e)._execute()}var s=t("./each").Each,o=t("./internal/util").PENDING,n=t("./internal/collection").setShorthand,l=function(t){function e(e,i){t.call(this,e,i),this._result=!1,e===o?this._set=n:n.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?this._promise._resolve(!0):0==--this._rest&&this._promise._resolve(!1)},e}(s);e.exports={some:r,Some:l}},{"./each":12,"./internal/collection":29,"./internal/util":31}],56:[function(t,e,i){"use strict";function r(t,e,i){return new s(t,e,i)._execute()}var s=function(t){function e(e,i,r){t.call(this,e,i,r),this._result=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?this._promise._resolve(!0):0==--this._rest?this._promise._resolve(!1):this._callRest-- >0&&this._iterate()},e}(t("./eachLimit").EachLimit);e.exports={someLimit:r,SomeLimit:s}},{"./eachLimit":13}],57:[function(t,e,i){"use strict";function r(t,e){return new s(t,e)._execute()}var s=function(t){function e(e,i){t.call(this,e,i),this._result=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?this._promise._resolve(!0):0==--this._rest?this._promise._resolve(!1):this._iterate()},e}(t("./eachSeries.js").EachSeries);e.exports={someSeries:r,SomeSeries:s}},{"./eachSeries.js":14}],58:[function(t,e,i){"use strict";function r(t){return _.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]={criteria:t,value:this._coll[e]},0==--this._rest&&this._promise._resolve(a(this._result))}function o(t,e){this._result[e]={criteria:t,value:this._coll[this._keys[e]]},0==--this._rest&&this._promise._resolve(a(this._result))}function n(t,e){return new h(t,e)._execute()}var l=t("./each").Each,c=t("./internal/util"),u=c.PENDING,a=c.sort,_=t("./internal/collection").setShorthand,h=function(t){function e(e,i){t.call(this,e,i),e===u?this._set=r:r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={sortBy:n,SortBy:h}},{"./each":12,"./internal/collection":29,"./internal/util":31}],59:[function(t,e,i){"use strict";function r(t){return _.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]={criteria:t,value:this._coll[e]},0==--this._rest?this._promise._resolve(a(this._result)):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[e]={criteria:t,value:this._coll[this._keys[e]]},0==--this._rest?this._promise._resolve(a(this._result)):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new h(t,e,i)._execute()}var l=t("./eachLimit").EachLimit,c=t("./internal/util"),u=c.PENDING,a=c.sort,_=t("./internal/collection").setLimit,h=function(t){function e(e,i,n){t.call(this,e,i,n),e===u?this._set=r:(this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={sortByLimit:n,SortByLimit:h}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],60:[function(t,e,i){"use strict";function r(t){return _.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]={criteria:t,value:this._coll[e]},0==--this._rest?this._promise._resolve(a(this._result)):this._iterate()}function o(t,e){this._result[e]={criteria:t,value:this._coll[this._keys[e]]},0==--this._rest?this._promise._resolve(a(this._result)):this._iterate()}function n(t,e){return new h(t,e)._execute()}var l=t("./eachSeries").EachSeries,c=t("./internal/util"),u=c.PENDING,a=c.sort,_=t("./internal/collection").setSeries,h=function(t){function e(e,i){t.call(this,e,i),e===u?this._set=r:(this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l);e.exports={sortBySeries:n,SortBySeries:h}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],61:[function(t,e,i){"use strict";var r=t("aigle-core").AigleProxy,s=t("./aigle").Aigle,o=t("./error").TimeoutError,n=t("./internal/util").INTERNAL,l=function(t){function e(e,i){var r=this;t.call(this),this._promise=new s(n),this._message=i,this._timer=setTimeout(function(){i?r._callReject(i):r._callReject(new o("operation timed out"))},e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){clearTimeout(this._timer),this._promise._resolve(t)},e.prototype._callReject=function(t){clearTimeout(this._timer),this._promise._reject(t)},e}(r);e.exports=l},{"./aigle":2,"./error":15,"./internal/util":31,"aigle-core":71}],62:[function(t,e,i){"use strict";function r(t){(t=+t)>=1?(this._rest=t,this._result=Array(t)):(this._rest=0,this._result=[])}function s(t){this._callResolve=this._rest,r.call(this,t),this._execute()}function o(t,e){return new f(t,e)._execute()}var n=t("aigle-core").AigleProxy,l=t("./aigle").Aigle,c=t("./internal/util"),u=c.INTERNAL,a=c.PENDING,_=c.defaultIterator,h=c.call1,p=c.callProxyReciever,f=function(t){function e(e,i){t.call(this),this._promise=new l(u),this._iterator="function"==typeof i?i:_,this._rest=void 0,this._result=void 0,e===a?(this._rest=this._callResolve,this._callResolve=s):r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){if(this._rest>=1)for(var t=this,e=t._rest,i=t._iterator,r=-1;++r=1){this._rest=t,this._result=Array(t);var e=this._limit;this._limit=e0&&this._iterate()},e.prototype._callReject=function(t){this._callRest=0,this._promise._reject(t)},e}(n);e.exports={timesLimit:o,TimesLimit:v}},{"./aigle":2,"./internal/util":31,"aigle-core":71}],64:[function(t,e,i){"use strict";function r(t,e){return new v(t,e)._execute()}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./times"),l=n.set,c=n.execute,u=t("./internal/util"),a=u.INTERNAL,_=u.PENDING,h=u.defaultIterator,p=u.call1,f=u.callProxyReciever,v=function(t){function e(e,i){t.call(this),this._promise=new o(a),this._iterator="function"==typeof i?i:h,this._index=0,this._rest=void 0,this._result=void 0,e===_?(this._rest=this._callResolve,this._callResolve=c):l.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){return this._rest>=1?this._iterate():this._promise._resolve(this._result),this._promise},e.prototype._iterate=function(){var t=this._index++;f(p(this._iterator,t),this,t)},e.prototype._callResolve=function(t,e){this._result[e]=t,0==--this._rest?this._promise._resolve(this._result):this._iterate()},e.prototype._callReject=function(t){this._promise._reject(t)},e}(s);e.exports={timesSeries:r,TimesSeries:v}},{"./aigle":2,"./internal/util":31,"./times":62,"aigle-core":71}],65:[function(t,e,i){"use strict";function r(t){return c.call(this,t),void 0!==this._keys||void 0===this._coll?(void 0===this._result&&(this._result={}),this._iterate=o):(void 0===this._result&&(this._result=[]),this._iterate=s),this}function s(){for(var t=this,e=t._rest,i=t._result,r=t._iterator,s=t._coll,o=-1;++o0&&this._iterate()},e}(l);e.exports={transformLimit:n,TransformLimit:v}},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],67:[function(t,e,i){"use strict";function r(t){return c.call(this,t),void 0!==this._keys||void 0===this._coll?(void 0===this._result&&(this._result={}),this._iterate=o):(void 0===this._result&&(this._result=[]),this._iterate=s),this}function s(){var t=this._index++;h(_(this._iterator,this._result,this._coll[t],t),this,t)}function o(){var t=this._index++,e=this._keys[t];h(_(this._iterator,this._result,this._coll[e],e),this,t)}function n(t,e,i){return new f(t,e,i)._execute()}var l=t("./eachSeries").EachSeries,c=t("./internal/collection").setSeries,u=t("./internal/util"),a=u.PENDING,_=u.call3,h=u.callProxyReciever,p=u.clone,f=function(t){function e(e,i,s){t.call(this,e,i),void 0!==s&&(this._result=s),e===a?this._set=r:r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){!1===t?this._promise._resolve(p(this._result)):0==--this._rest?this._promise._resolve(this._result):this._iterate()},e}(l);e.exports={transformSeries:n,TransformSeries:f}},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],68:[function(t,e,i){"use strict";function r(t,e,i){return"function"!=typeof i&&(i=e,e=t,t=void 0),new o(new n(e),i)._iterate(t)}var s=t("./whilst"),o=s.AigleWhilst,n=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?this._proxy._promise._resolve(this._value):this._proxy._next(this._value)},e}(s.WhilstTester);e.exports={until:r,UntilTester:n}},{"./whilst":70}],69:[function(t,e,i){"use strict";function r(){for(var t=arguments,e=arguments.length,i=arguments[--e],r=Array(e);e--;)r[e]=t[e];return new p(r,i)._promise}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),l=n.INTERNAL,c=n.apply,u=n.call1,a=n.callProxyReciever,_={},h=function(t,e){this._promise=t,this._handler=e};h.prototype._dispose=function(){var t=this,e=this._promise;switch(e._resolved){case 0:return e.then(function(){return t._dispose()});case 1:return u(this._handler,this._promise._value)}};var p=function(t){function e(e,i){var r=this;t.call(this);var s=e.length;this._promise=new o(l),this._rest=s,this._disposed=s,this._array=e,this._error=void 0,this._result=Array(s),this._handler=i;for(var n=-1;++n1)for(var r=1;r1){var r=arguments.length;if("function"==typeof(t=arguments[--r])){for(var s=Array(r);r--;)s[r]=i[r];t=c(s,t)}}return u(this,new e(g),void 0,t)},e.prototype.finally=function(t){return t="function"!=typeof t?t:l(this,t),u(this,new e(g),t,t)},e.prototype.cancel=function(){if(this._execute!==o){var t=this._onCancelQueue;if(t){var e=-1,i=t.array;for(this._onCancelQueue=void 0;++e0&&this._iterate()},e}(o);e.exports={concatLimit:s,ConcatLimit:l}},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],7:[function(t,e,i){"use strict";function r(t,e){return new s(t,e)._execute()}var s=function(t){function e(e,i){t.call(this,e,i),this._result=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){Array.isArray(t)?(e=this._result).push.apply(e,t):void 0!==t&&this._result.push(t),0==--this._rest?this._promise._resolve(this._result):this._iterate();var e},e}(t("./eachSeries").EachSeries);e.exports={concatSeries:r,ConcatSeries:s}},{"./eachSeries":14}],8:[function(t,e,i){"use strict";function r(t,e){var i=(new Error).stack;t._stacks=t._stacks||[],e&&e._stacks&&(s=t._stacks).push.apply(s,e._stacks);var r=i.split("\n").slice(4);t._stacks.push(r.join("\n"));var s}function s(t){var e=t._value,i=t._stacks;if(e instanceof Error!=!1&&i&&!e._reconstructed){for(var r=e.stack.split("\n"),s=i.length;s--;)r.push("From previous event:"),r.push(i[s]);e.stack=r.join("\n"),e._reconstructed=!0}}e.exports={resolveStack:r,reconstructStack:s}},{}],9:[function(t,e,i){"use strict";function r(t,e){return new n(t)._resolve(e)}var s=t("./aigle").Aigle,o=t("./internal/util").INTERNAL,n=function(t){function e(e){t.call(this,o),this._ms=e,this._timer=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._resolve=function(e){var i=this;return this._timer=setTimeout(function(){return t.prototype._resolve.call(i,e)},this._ms),this},e.prototype._reject=function(e){clearTimeout(this._timer),t.prototype._reject.call(this,e)},e}(s);e.exports={delay:r,Delay:n}},{"./aigle":2,"./internal/util":37}],10:[function(t,e,i){"use strict";function r(t,e,i){return"function"!=typeof i&&(i=e,e=t,t=void 0),new s(new o(i),e)._iterate(t)}var s=t("./doWhilst").DoWhilst,o=t("./until").UntilTester;e.exports=r},{"./doWhilst":11,"./until":74}],11:[function(t,e,i){"use strict";function r(t,e,i){return"function"!=typeof i&&(i=e,e=t,t=void 0),new c(new n(i),e)._iterate(t)}var s=t("./whilst"),o=s.AigleWhilst,n=s.WhilstTester,c=function(t){function e(e,i){t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._iterate=function(t){return this._next(t),this._promise},e}(o);e.exports={doWhilst:r,DoWhilst:c}},{"./whilst":76}],12:[function(t,e,i){"use strict";function r(t,e){return new h(t,e)._execute()}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),c=n.INTERNAL,l=n.PENDING,u=t("./internal/collection"),_=u.execute,a=u.setParallel,h=function(t){function e(e,i,r){void 0===r&&(r=a),t.call(this),this._iterator=i,this._promise=new o(c),this._coll=void 0,this._size=void 0,this._rest=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,e===l?(this._set=r,this._iterate=this._callResolve,this._callResolve=_):r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){return 0===this._rest?this._promise._resolve(this._result):this._iterate(),this._promise},e.prototype._callResolve=function(t){0!=--this._rest&&!1!==t||this._promise._resolve()},e.prototype._callReject=function(t){this._promise._reject(t)},e}(s);e.exports={each:r,Each:h}},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],13:[function(t,e,i){"use strict";function r(t,e,i){return new p(t,e,i)._execute()}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),c=n.DEFAULT_LIMIT,l=n.INTERNAL,u=n.PENDING,_=t("./internal/collection"),a=_.execute,h=_.setLimit,p=function(t){function e(e,i,r,s){void 0===s&&(s=h),t.call(this),"function"==typeof i&&(r=i,i=c),this._iterator=r,this._promise=new o(l),this._index=0,this._limit=i,this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,this._callRest=void 0,e===u?(this._set=s,this._iterate=this._callResolve,this._callResolve=a):s.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){var t=this;if(0===this._rest)this._promise._resolve(this._result);else for(;this._limit--;)t._iterate();return this._promise},e.prototype._callResolve=function(t){!1===t?(this._callRest=0,this._promise._resolve()):0==--this._rest?this._promise._resolve():this._callRest-- >0&&this._iterate()},e.prototype._callReject=function(t){this._callRest=0,this._promise._reject(t)},e}(s);e.exports={eachLimit:r,EachLimit:p}},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],14:[function(t,e,i){"use strict";function r(t,e){return new h(t,e)._execute()}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),c=n.INTERNAL,l=n.PENDING,u=t("./internal/collection"),_=u.execute,a=u.setSeries,h=function(t){function e(e,i,r){void 0===r&&(r=a),t.call(this),this._iterator=i,this._promise=new o(c),this._index=0,this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,e===l?(this._set=r,this._iterate=this._callResolve,this._callResolve=_):r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){return 0===this._rest?this._promise._resolve(this._result):this._iterate(),this._promise},e.prototype._callResolve=function(t){0==--this._rest||!1===t?this._promise._resolve():this._iterate()},e.prototype._callReject=function(t){this._promise._reject(t)},e}(s);e.exports={eachSeries:r,EachSeries:h}},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],15:[function(t,e,i){"use strict";for(var r=["CancellationError","TimeoutError"],s=r.length;s--;)i[r[s]]=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error)},{}],16:[function(t,e,i){"use strict";function r(t,e){return new c(t,e)._execute()}var s=t("./each").Each,o=t("./internal/util").PENDING,n=t("./internal/collection").setShorthand,c=function(t){function e(e,i){t.call(this,e,i),this._result=!0,e===o?this._set=n:n.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?0==--this._rest&&this._promise._resolve(!0):this._promise._resolve(!1)},e}(s);e.exports={every:r,Every:c}},{"./each":12,"./internal/collection":35,"./internal/util":37}],17:[function(t,e,i){"use strict";function r(t,e,i){return new s(t,e,i)._execute()}var s=function(t){function e(e,i,r){t.call(this,e,i,r),this._result=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?0==--this._rest?this._promise._resolve(!0):this._callRest-- >0&&this._iterate():this._promise._resolve(!1)},e}(t("./eachLimit").EachLimit);e.exports={everyLimit:r,EveryLimit:s}},{"./eachLimit":13}],18:[function(t,e,i){"use strict";function r(t,e){return new s(t,e)._execute()}var s=function(t){function e(e,i){t.call(this,e,i),this._result=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?0==--this._rest?this._promise._resolve(!0):this._iterate():this._promise._resolve(!1)},e}(t("./eachSeries.js").EachSeries);e.exports={everySeries:r,EverySeries:s}},{"./eachSeries.js":14}],19:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?this._coll[e]:_,0==--this._rest&&this._promise._resolve(a(this._result))}function o(t,e){this._result[e]=t?this._coll[this._keys[e]]:_,0==--this._rest&&this._promise._resolve(a(this._result))}function n(t,e){return new h(t,e)._execute()}var c=t("./each").Each,l=t("./internal/collection").setShorthand,u=t("./internal/util"),_=u.INTERNAL,a=u.compactArray,h=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);h.prototype._set=r,e.exports={filter:n,Filter:h}},{"./each":12,"./internal/collection":35,"./internal/util":37}],20:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?this._coll[e]:_,0==--this._rest?this._promise._resolve(a(this._result)):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[e]=t?this._coll[this._keys[e]]:_,0==--this._rest?this._promise._resolve(a(this._result)):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new h(t,e,i)._execute()}var c=t("./eachLimit").EachLimit,l=t("./internal/collection").setLimit,u=t("./internal/util"),_=u.INTERNAL,a=u.compactArray,h=function(t){function e(e,i,s){t.call(this,e,i,s,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={filterLimit:n,FilterLimit:h}},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],21:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?this._coll[e]:_,0==--this._rest?this._promise._resolve(a(this._result)):this._iterate()}function o(t,e){this._result[e]=t?this._coll[this._keys[e]]:_,0==--this._rest?this._promise._resolve(a(this._result)):this._iterate()}function n(t,e){return new h(t,e)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/collection").setSeries,u=t("./internal/util"),_=u.INTERNAL,a=u.compactArray,h=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={filterSeries:n,FilterSeries:h}},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],22:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t?(this._size=0,this._promise._resolve(this._coll[e])):0==--this._rest&&this._promise._resolve()}function o(t,e){t?(this._size=0,this._promise._resolve(this._coll[this._keys[e]])):0==--this._rest&&this._promise._resolve()}function n(t,e){return new u(t,e)._execute()}var c=t("./each").Each,l=t("./internal/collection").setShorthand,u=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={find:n,Find:u}},{"./each":12,"./internal/collection":35}],23:[function(t,e,i){"use strict";function r(t){return n.call(this,t),void 0!==this._keys&&(this._rest=0),this}function s(t,e){return new c(t,e)._execute()}var o=t("./each").Each,n=t("./internal/collection").setShorthand,c=function(t){function e(e,i){t.call(this,e,i,r),this._result=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t,e){t?(this._size=0,this._promise._resolve(e)):0==--this._rest&&this._promise._resolve(-1)},e}(o);e.exports={findIndex:s,FindIndex:c}},{"./each":12,"./internal/collection":35}],24:[function(t,e,i){"use strict";function r(t){return n.call(this,t),void 0!==this._keys&&(this._rest=0),this}function s(t,e,i){return new c(t,e,i)._execute()}var o=t("./eachLimit").EachLimit,n=t("./internal/collection").setLimit,c=function(t){function e(e,i,s){t.call(this,e,i,s,r),this._result=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t,e){t?(this._callRest=0,this._promise._resolve(e)):0==--this._rest?this._promise._resolve(-1):this._callRest-- >0&&this._iterate()},e}(o);e.exports={findIndexLimit:s,FindIndexLimit:c}},{"./eachLimit":13,"./internal/collection":35}],25:[function(t,e,i){"use strict";function r(t){return n.call(this,t),void 0!==this._keys&&(this._rest=0),this}function s(t,e){return new c(t,e)._execute()}var o=t("./eachSeries").EachSeries,n=t("./internal/collection").setSeries,c=function(t){function e(e,i){t.call(this,e,i,r),this._result=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t,e){t?this._promise._resolve(e):0==--this._rest?this._promise._resolve(-1):this._iterate()},e}(o);e.exports={findIndexSeries:s,FindIndexSeries:c}},{"./eachSeries":14,"./internal/collection":35}],26:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t?(this._size=0,this._promise._resolve(""+e)):0==--this._rest&&this._promise._resolve()}function o(t,e){t?(this._size=0,this._promise._resolve(this._keys[e])):0==--this._rest&&this._promise._resolve()}function n(t,e){return new u(t,e)._execute()}var c=t("./each").Each,l=t("./internal/collection").setShorthand,u=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={findKey:n,FindKey:u}},{"./each":12,"./internal/collection":35}],27:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t?(this._callRest=0,this._promise._resolve(""+e)):0==--this._rest?this._promise._resolve():this._callRest-- >0&&this._iterate()}function o(t,e){t?(this._callRest=0,this._promise._resolve(this._keys[e])):0==--this._rest?this._promise._resolve():this._callRest-- >0&&this._iterate()}function n(t,e,i){return new u(t,e,i)._execute()}var c=t("./eachLimit").EachLimit,l=t("./internal/collection").setLimit,u=function(t){function e(e,i,s){t.call(this,e,i,s,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={findKeyLimit:n,FindKeyLimit:u}},{"./eachLimit":13,"./internal/collection":35}],28:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t?this._promise._resolve(""+e):0==--this._rest?this._promise._resolve():this._iterate()}function o(t,e){t?this._promise._resolve(this._keys[e]):0==--this._rest?this._promise._resolve():this._iterate()}function n(t,e){return new u(t,e)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/collection").setSeries,u=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={findKeySeries:n,FindKeySeries:u}},{"./eachSeries":14,"./internal/collection":35}],29:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t?(this._callRest=0,this._promise._resolve(this._coll[e])):0==--this._rest?this._promise._resolve():this._callRest-- >0&&this._iterate()}function o(t,e){t?(this._callRest=0,this._promise._resolve(this._coll[this._keys[e]])):0==--this._rest?this._promise._resolve():this._callRest-- >0&&this._iterate()}function n(t,e,i){return new u(t,e,i)._execute()}var c=t("./eachLimit").EachLimit,l=t("./internal/collection").setLimit,u=function(t){function e(e,i,s){t.call(this,e,i,s,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={findLimit:n,FindLimit:u}},{"./eachLimit":13,"./internal/collection":35}],30:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t?this._promise._resolve(this._coll[e]):0==--this._rest?this._promise._resolve():this._iterate()}function o(t,e){t?this._promise._resolve(this._coll[this._keys[e]]):0==--this._rest?this._promise._resolve():this._iterate()}function n(t,e){return new u(t,e)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/collection").setSeries,u=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={findSeries:n,FindSeries:u}},{"./eachSeries":14,"./internal/collection":35}],31:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[t]?this._result[t].push(this._coll[e]):this._result[t]=[this._coll[e]],0==--this._rest&&this._promise._resolve(this._result)}function o(t,e){this._result[t]?this._result[t].push(this._coll[this._keys[e]]):this._result[t]=[this._coll[this._keys[e]]],0==--this._rest&&this._promise._resolve(this._result)}function n(t,e){return new u(t,e)._execute()}var c=t("./each").Each,l=t("./internal/collection").setShorthand,u=function(t){function e(e,i){t.call(this,e,i,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={groupBy:n,GroupBy:u}},{"./each":12,"./internal/collection":35}],32:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[t]?this._result[t].push(this._coll[e]):this._result[t]=[this._coll[e]],0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[t]?this._result[t].push(this._coll[this._keys[e]]):this._result[t]=[this._coll[this._keys[e]]],0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new u(t,e,i)._execute()}var c=t("./eachLimit").EachLimit,l=t("./internal/collection").setLimit,u=function(t){function e(e,i,s){t.call(this,e,i,s,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={groupByLimit:n,GroupByLimit:u}},{"./eachLimit":13,"./internal/collection":35}],33:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[t]?this._result[t].push(this._coll[e]):this._result[t]=[this._coll[e]],0==--this._rest?this._promise._resolve(this._result):this._iterate()}function o(t,e){this._result[t]?this._result[t].push(this._coll[this._keys[e]]):this._result[t]=[this._coll[this._keys[e]]],0==--this._rest?this._promise._resolve(this._result):this._iterate()}function n(t,e){return new u(t,e)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/collection").setSeries,u=function(t){function e(e,i){t.call(this,e,i,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={groupBySeries:n,GroupBySeries:u}},{"./eachSeries":14,"./internal/collection":35}],34:[function(t,e,i){"use strict";function r(){for(var t=-1;++t0&&this._iterate()},e}(o);e.exports={mapLimit:s,MapLimit:c}},{"./eachLimit":13,"./internal/collection":35}],41:[function(t,e,i){"use strict";function r(t){return n.call(this,t),this._result=Array(this._rest),this}function s(t,e){return new c(t,e)._execute()}var o=t("./eachSeries").EachSeries,n=t("./internal/collection").setSeries,c=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t,e){this._result[e]=t,0==--this._rest?this._promise._resolve(this._result):this._iterate()},e}(o);e.exports={mapSeries:s,MapSeries:c}},{"./eachSeries":14,"./internal/collection":35}],42:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t,0==--this._rest&&this._promise._resolve(this._result)}function o(t,e){this._result[this._keys[e]]=t,0==--this._rest&&this._promise._resolve(this._result)}function n(t,e){return new u(t,e)._execute()}var c=t("./each").Each,l=t("./internal/collection").setShorthand,u=function(t){function e(e,i){t.call(this,e,i,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={mapValues:n,MapValues:u}},{"./each":12,"./internal/collection":35}],43:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t,0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[this._keys[e]]=t,0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new u(t,e,i)._execute()}var c=t("./eachLimit").EachLimit,l=t("./internal/collection").setLimit,u=function(t){function e(e,i,s){t.call(this,e,i,s,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={mapValuesLimit:n,MapValuesLimit:u}},{"./eachLimit":13,"./internal/collection":35}],44:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t,0==--this._rest?this._promise._resolve(this._result):this._iterate()}function o(t,e){this._result[this._keys[e]]=t,0==--this._rest?this._promise._resolve(this._result):this._iterate()}function n(t,e){return new u(t,e)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/collection").setSeries,u=function(t){function e(e,i){t.call(this,e,i,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={mapValuesSeries:n,MapValuesSeries:u}},{"./eachSeries":14,"./internal/collection":35}],45:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t||(this._result[e]=this._coll[e]),0==--this._rest&&this._promise._resolve(this._result)}function o(t,e){if(!t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest&&this._promise._resolve(this._result)}function n(t,e){return new u(t,e)._execute()}var c=t("./each").Each,l=t("./internal/collection").setShorthand,u=function(t){function e(e,i){t.call(this,e,i,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={omit:n,Omit:u}},{"./each":12,"./internal/collection":35}],46:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t||(this._result[e]=this._coll[e]),0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function o(t,e){if(!t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new u(t,e,i)._execute()}var c=t("./eachLimit").EachLimit,l=t("./internal/collection").setLimit,u=function(t){function e(e,i,s){t.call(this,e,i,s,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={omitLimit:n,OmitLimit:u}},{"./eachLimit":13,"./internal/collection":35}],47:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t||(this._result[e]=this._coll[e]),0==--this._rest?this._promise._resolve(this._result):this._iterate()}function o(t,e){if(!t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest?this._promise._resolve(this._result):this._iterate()}function n(t,e){return new _(t,e)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/util").PENDING,u=t("./internal/collection").setSeries,_=function(t){function e(e,i){t.call(this,e,i),this._result={},e===l?this._set=r:this._callResolve=void 0===this._keys?s:o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={omitSeries:n,OmitSeries:_}},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],48:[function(t,e,i){"use strict";function r(t){this._callResolve=this._result,s.call(this,t),this._execute()}function s(t){if(Array.isArray(t)){var e=t.length;this._rest=e,this._coll=t,this._result=Array(e),this._iterate=a}else if(t&&"object"==typeof t){var i=Object.keys(t);this._rest=i.length,this._coll=t,this._keys=i,this._result={},this._iterate=h}else this._rest=0,this._result={};return this}function o(t){return new p(t)._execute()}var n=t("aigle-core").AigleProxy,c=t("./aigle").Aigle,l=t("./internal/util"),u=l.INTERNAL,_=l.PENDING,a=l.promiseArrayEach,h=l.promiseObjectEach,p=function(t){function e(e){t.call(this),this._promise=new c(u),this._rest=void 0,this._coll=void 0,this._keys=void 0,this._result=void 0,e===_?(this._result=this._callResolve,this._callResolve=r):s.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._keys?a(this):h(this),this._promise},e.prototype._callResolve=function(t,e){this._result[e]=t,0==--this._rest&&this._promise._resolve(this._result)},e.prototype._callReject=function(t){this._promise._reject(t)},e}(n);e.exports={parallel:o,Parallel:p}},{"./aigle":2,"./internal/util":37,"aigle-core":77}],49:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t&&(this._result[e]=this._coll[e]),0==--this._rest&&this._promise._resolve(this._result)}function o(t,e){if(t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest&&this._promise._resolve(this._result)}function n(t,e){return new u(t,e)._execute()}var c=t("./each").Each,l=t("./internal/collection").setShorthand,u=function(t){function e(e,i){t.call(this,e,i,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={pick:n,Pick:u}},{"./each":12,"./internal/collection":35}],50:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t&&(this._result[e]=this._coll[e]),0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function o(t,e){if(t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest?this._promise._resolve(this._result):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new u(t,e,i)._execute()}var c=t("./eachLimit").EachLimit,l=t("./internal/collection").setLimit,u=function(t){function e(e,i,s){t.call(this,e,i,s,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={pickLimit:n,PickLimit:u}},{"./eachLimit":13,"./internal/collection":35}],51:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){t&&(this._result[e]=this._coll[e]),0==--this._rest?this._promise._resolve(this._result):this._iterate()}function o(t,e){if(t){var i=this._keys[e];this._result[i]=this._coll[i]}0==--this._rest?this._promise._resolve(this._result):this._iterate()}function n(t,e){return new u(t,e)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/collection").setSeries,u=function(t){function e(e,i){t.call(this,e,i,r),this._result={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={pickSeries:n,PickSeries:u}},{"./eachSeries":14,"./internal/collection":35}],52:[function(t,e,i){"use strict";function r(t,e){switch(typeof t){case"object":switch(typeof e){case"string":case"number":return t[e].__isPromisified__?t[e]:o(t,e);default:throw new TypeError("Second argument is invalid")}case"function":return t.__isPromisified__?t:n(t,e&&void 0!==e.context?e.context:void 0);default:throw new TypeError("Type of first argument is not function")}}function s(t){return function(e,i){e?t._reject(e):t._resolve(i)}}function o(t,e){function i(i){var r=arguments,o=new c(l),n=s(o),u=arguments.length;switch(u){case 0:t[e](n);break;case 1:t[e](i,n);break;default:for(var _=Array(u);u--;)_[u]=r[u];_[_.length]=n,t[e].apply(t,_)}return o}return i.__isPromisified__=!0,i}function n(t,e){function i(i){var r=arguments,o=new c(l),n=s(o),u=arguments.length;switch(u){case 0:t.call(e||this,n);break;case 1:t.call(e||this,i,n);break;default:for(var _=Array(u);u--;)_[u]=r[u];_[_.length]=n,t.apply(e||this,_)}return o}return i.__isPromisified__=!0,i}var c=t("./aigle").Aigle,l=t("./internal/util").INTERNAL;e.exports=r},{"./aigle":2,"./internal/util":37}],53:[function(t,e,i){"use strict";function r(t,e){var i=e||{},r=i.suffix;void 0===r&&(r="Async");var n=i.filter;void 0===n&&(n=s);var c=i.depth;return void 0===c&&(c=2),o(r,n,t,void 0,void 0,c),t}function s(t){return/^_/.test(t)}function o(t,e,i,r,s,o){var l={};switch(typeof i){case"function":if(s){var u=""+r+t;if(s[u]){if(!s[u].__isPromisified__)throw new TypeError("Cannot promisify an API that has normal methods with '"+t+"'-suffix")}else s[u]=c(i)}n(t,e,i,i,o,l),n(t,e,i.prototype,i.prototype,o,l);break;case"object":n(t,e,i,i,o,l),n(t,e,Object.getPrototypeOf(i),i,o,l)}}function n(t,e,i,r,s,n){if(0!=s--&&i&&u!==i&&_!==i&&a!==i&&!Object.isFrozen(i))for(var c=Object.getOwnPropertyNames(i),h=c.length;h--;){var p=c[h];if(!0!==l[p]&&!0!==n[p]&&!e(p)){var f=Object.getOwnPropertyDescriptor(i,p);!f||f.set||f.get||(n[p]=!0,o(t,e,i[p],p,r,s))}}}var c=t("./promisify"),l={constructor:!0,arity:!0,length:!0,name:!0,arguments:!0,caller:!0,callee:!0,prototype:!0,__isPromisified__:!0};e.exports=r;var u=Function.prototype,_=Object.prototype,a=Array.prototype},{"./promisify":52}],54:[function(t,e,i){"use strict";function r(t){var e=Object.keys(t);return this._rest=e.length,this._coll=t,this._keys=e,this._callResolve=this._execute,s.call(this),this}function s(){return 0===this._rest?this._promise._resolve(this._result):a(this),this._promise}function o(t){return new h(t)._execute()}var n=t("aigle-core").AigleProxy,c=t("./aigle").Aigle,l=t("./internal/util"),u=l.INTERNAL,_=l.PENDING,a=l.promiseObjectEach,h=function(t){function e(e){if(t.call(this),this._promise=new c(u),this._result={},e===_)this._rest=void 0,this._coll=void 0,this._keys=void 0,this._execute=this._callResolve,this._callResolve=r;else{var i=Object.keys(e);this._rest=i.length,this._coll=e,this._keys=i,this._execute=s}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t,e){this._result[e]=t,0==--this._rest&&this._promise._resolve(this._result)},e.prototype._callReject=function(t){this._promise._reject(t)},e}(n);e.exports={props:o,Props:h},e.exports={props:o,Props:h}},{"./aigle":2,"./internal/util":37,"aigle-core":77}],55:[function(t,e,i){"use strict";function r(t){return new s(t)._execute()}var s=function(t){function e(e){t.call(this,e),this._result=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){this._promise._resolve(t)},e}(t("./parallel").Parallel);e.exports={race:r,Race:s}},{"./parallel":48}],56:[function(t,e,i){"use strict";function r(t){return p.call(this,t),void 0===this._keys?(this._iterate=s,this._execute=n):(this._iterate=o,this._execute=c),this}function s(t,e){d(m(this._iterator,e,this._coll[t],t),this,t)}function o(t,e){var i=this._keys[t];d(m(this._iterator,e,this._coll[i],i),this,t)}function n(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._result?this._callResolve(this._coll[0],0):this._iterate(0,this._result),this._promise}function c(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._result?this._callResolve(this._coll[this._keys[0]],0):this._iterate(0,this._result),this._promise}function l(t,e,i){return new R(t,e,i)._execute()}var u=t("aigle-core").AigleProxy,_=t("./aigle").Aigle,a=t("./internal/collection"),h=a.execute,p=a.setSeries,f=t("./internal/util"),v=f.INTERNAL,y=f.PENDING,m=f.call3,d=f.callProxyReciever,R=function(t){function e(e,i,s){t.call(this),this._result=s,this._iterator=i,this._promise=new _(v),this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._iterate=void 0,e===y?(this._set=r,this._iterate=this._callResolve,this._callResolve=h):r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t,e){0==--this._rest?this._promise._resolve(t):this._iterate(++e,t)},e.prototype._callReject=function(t){this._promise._reject(t)},e}(u);e.exports={reduce:l,Reduce:R}},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],57:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?_:this._coll[e],0==--this._rest&&this._promise._resolve(a(this._result))}function o(t,e){this._result[e]=t?_:this._coll[this._keys[e]],0==--this._rest&&this._promise._resolve(a(this._result))}function n(t,e){return new h(t,e)._execute()}var c=t("./each").Each,l=t("./internal/collection").setShorthand,u=t("./internal/util"),_=u.INTERNAL,a=u.compactArray,h=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={reject:n,Reject:h}},{"./each":12,"./internal/collection":35,"./internal/util":37}],58:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?_:this._coll[e],0==--this._rest?this._promise._resolve(a(this._result)):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[e]=t?_:this._coll[this._keys[e]],0==--this._rest?this._promise._resolve(a(this._result)):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new h(t,e,i)._execute()}var c=t("./eachLimit").EachLimit,l=t("./internal/collection").setLimit,u=t("./internal/util"),_=u.INTERNAL,a=u.compactArray,h=function(t){function e(e,i,s){t.call(this,e,i,s,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={rejectLimit:n,RejectLimit:h}},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],59:[function(t,e,i){"use strict";function r(t){return l.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]=t?_:this._coll[e],0==--this._rest?this._promise._resolve(a(this._result)):this._iterate()}function o(t,e){this._result[e]=t?_:this._coll[this._keys[e]],0==--this._rest?this._promise._resolve(a(this._result)):this._iterate()}function n(t,e){return new h(t,e)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/collection").setSeries,u=t("./internal/util"),_=u.INTERNAL,a=u.compactArray,h=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={rejectSeries:n,RejectSeries:h}},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],60:[function(t,e,i){"use strict";function r(t,e){return"function"==typeof t&&(e=t,t=_),new a(e,t)._promise}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),c=n.INTERNAL,l=n.call0,u=n.callProxyReciever,_=5,a=function(t){function e(e,i){t.call(this),this._promise=new o(c),this._rest=i,this._handler=e,this._iterate()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._iterate=function(){u(l(this._handler),this,void 0)},e.prototype._callResolve=function(t){this._promise._resolve(t)},e.prototype._callReject=function(t){0==--this._rest?this._promise._reject(t):this._iterate()},e}(s);e.exports=r},{"./aigle":2,"./internal/util":37,"aigle-core":77}],61:[function(t,e,i){"use strict";function r(t,e){return new n(t,e)._execute()}var s=t("./each").Each,o=t("./internal/collection").setShorthand,n=function(t){function e(e,i){t.call(this,e,i,o),this._result=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?this._promise._resolve(!0):0==--this._rest&&this._promise._resolve(!1)},e}(s);e.exports={some:r,Some:n}},{"./each":12,"./internal/collection":35}],62:[function(t,e,i){"use strict";function r(t,e,i){return new s(t,e,i)._execute()}var s=function(t){function e(e,i,r){t.call(this,e,i,r),this._result=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?this._promise._resolve(!0):0==--this._rest?this._promise._resolve(!1):this._callRest-- >0&&this._iterate()},e}(t("./eachLimit").EachLimit);e.exports={someLimit:r,SomeLimit:s}},{"./eachLimit":13}],63:[function(t,e,i){"use strict";function r(t,e){return new s(t,e)._execute()}var s=function(t){function e(e,i){t.call(this,e,i),this._result=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?this._promise._resolve(!0):0==--this._rest?this._promise._resolve(!1):this._iterate()},e}(t("./eachSeries.js").EachSeries);e.exports={someSeries:r,SomeSeries:s}},{"./eachSeries.js":14}],64:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]={criteria:t,value:this._coll[e]},0==--this._rest&&this._promise._resolve(l(this._result))}function o(t,e){this._result[e]={criteria:t,value:this._coll[this._keys[e]]},0==--this._rest&&this._promise._resolve(l(this._result))}function n(t,e){return new _(t,e)._execute()}var c=t("./each").Each,l=t("./internal/util").sort,u=t("./internal/collection").setShorthand,_=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={sortBy:n,SortBy:_}},{"./each":12,"./internal/collection":35,"./internal/util":37}],65:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]={criteria:t,value:this._coll[e]},0==--this._rest?this._promise._resolve(l(this._result)):this._callRest-- >0&&this._iterate()}function o(t,e){this._result[e]={criteria:t,value:this._coll[this._keys[e]]},0==--this._rest?this._promise._resolve(l(this._result)):this._callRest-- >0&&this._iterate()}function n(t,e,i){return new _(t,e,i)._execute()}var c=t("./eachLimit").EachLimit,l=t("./internal/util").sort,u=t("./internal/collection").setLimit,_=function(t){function e(e,i,s){t.call(this,e,i,s,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={sortByLimit:n,SortByLimit:_}},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],66:[function(t,e,i){"use strict";function r(t){return u.call(this,t),this._result=Array(this._rest),this._callResolve=void 0===this._keys?s:o,this}function s(t,e){this._result[e]={criteria:t,value:this._coll[e]},0==--this._rest?this._promise._resolve(l(this._result)):this._iterate()}function o(t,e){this._result[e]={criteria:t,value:this._coll[this._keys[e]]},0==--this._rest?this._promise._resolve(l(this._result)):this._iterate()}function n(t,e){return new _(t,e)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/util").sort,u=t("./internal/collection").setSeries,_=function(t){function e(e,i){t.call(this,e,i,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(c);e.exports={sortBySeries:n,SortBySeries:_}},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],67:[function(t,e,i){"use strict";var r=t("aigle-core").AigleProxy,s=t("./aigle").Aigle,o=t("./error").TimeoutError,n=t("./internal/util").INTERNAL,c=function(t){function e(e,i){var r=this;t.call(this),this._promise=new s(n),this._message=i,this._timer=setTimeout(function(){i?r._callReject(i):r._callReject(new o("operation timed out"))},e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){clearTimeout(this._timer),this._promise._resolve(t)},e.prototype._callReject=function(t){clearTimeout(this._timer),this._promise._reject(t)},e}(r);e.exports=c},{"./aigle":2,"./error":15,"./internal/util":37,"aigle-core":77}],68:[function(t,e,i){"use strict";function r(t){(t=+t)>=1?(this._rest=t,this._result=Array(t)):(this._rest=0,this._result=[])}function s(t){this._callResolve=this._rest,r.call(this,t),this._execute()}function o(t,e){return new f(t,e)._execute()}var n=t("aigle-core").AigleProxy,c=t("./aigle").Aigle,l=t("./internal/util"),u=l.INTERNAL,_=l.PENDING,a=l.defaultIterator,h=l.call1,p=l.callProxyReciever,f=function(t){function e(e,i){t.call(this),this._promise=new c(u),this._iterator="function"==typeof i?i:a,this._rest=void 0,this._result=void 0,e===_?(this._rest=this._callResolve,this._callResolve=s):r.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){if(this._rest>=1)for(var t=this,e=t._rest,i=t._iterator,r=-1;++r=1){this._rest=t,this._result=Array(t);var e=this._limit;this._limit=e0&&this._iterate()},e.prototype._callReject=function(t){this._callRest=0,this._promise._reject(t)},e}(n);e.exports={timesLimit:o,TimesLimit:v}},{"./aigle":2,"./internal/util":37,"aigle-core":77}],70:[function(t,e,i){"use strict";function r(t,e){return new v(t,e)._execute()}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./times"),c=n.set,l=n.execute,u=t("./internal/util"),_=u.INTERNAL,a=u.PENDING,h=u.defaultIterator,p=u.call1,f=u.callProxyReciever,v=function(t){function e(e,i){t.call(this),this._promise=new o(_),this._iterator="function"==typeof i?i:h,this._index=0,this._rest=void 0,this._result=void 0,e===a?(this._rest=this._callResolve,this._callResolve=l):c.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._execute=function(){return this._rest>=1?this._iterate():this._promise._resolve(this._result),this._promise},e.prototype._iterate=function(){var t=this._index++;f(p(this._iterator,t),this,t)},e.prototype._callResolve=function(t,e){this._result[e]=t,0==--this._rest?this._promise._resolve(this._result):this._iterate()},e.prototype._callReject=function(t){this._promise._reject(t)},e}(s);e.exports={timesSeries:r,TimesSeries:v}},{"./aigle":2,"./internal/util":37,"./times":68,"aigle-core":77}],71:[function(t,e,i){"use strict";function r(t){return l.call(this,t),void 0!==this._keys||void 0===this._coll?(void 0===this._result&&(this._result={}),this._iterate=o):(void 0===this._result&&(this._result=[]),this._iterate=s),this}function s(){for(var t=this,e=t._rest,i=t._result,r=t._iterator,s=t._coll,o=-1;++o0&&this._iterate()},e}(c);e.exports={transformLimit:n,TransformLimit:f}},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],73:[function(t,e,i){"use strict";function r(t){return l.call(this,t),void 0!==this._keys||void 0===this._coll?(void 0===this._result&&(this._result={}),this._iterate=o):(void 0===this._result&&(this._result=[]),this._iterate=s),this}function s(){var t=this._index++;a(_(this._iterator,this._result,this._coll[t],t),this,t)}function o(){var t=this._index++,e=this._keys[t];a(_(this._iterator,this._result,this._coll[e],e),this,t)}function n(t,e,i){return new p(t,e,i)._execute()}var c=t("./eachSeries").EachSeries,l=t("./internal/collection").setSeries,u=t("./internal/util"),_=u.call3,a=u.callProxyReciever,h=u.clone,p=function(t){function e(e,i,s){t.call(this,e,i,r),void 0!==s&&(this._result=s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){!1===t?this._promise._resolve(h(this._result)):0==--this._rest?this._promise._resolve(this._result):this._iterate()},e}(c);e.exports={transformSeries:n,TransformSeries:p}},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],74:[function(t,e,i){"use strict";function r(t,e,i){return"function"!=typeof i&&(i=e,e=t,t=void 0),new o(new n(e),i)._iterate(t)}var s=t("./whilst"),o=s.AigleWhilst,n=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._callResolve=function(t){t?this._proxy._promise._resolve(this._value):this._proxy._next(this._value)},e}(s.WhilstTester);e.exports={until:r,UntilTester:n}},{"./whilst":76}],75:[function(t,e,i){"use strict";function r(){for(var t=arguments,e=arguments.length,i=arguments[--e],r=Array(e);e--;)r[e]=t[e];return new p(r,i)._promise}var s=t("aigle-core").AigleProxy,o=t("./aigle").Aigle,n=t("./internal/util"),c=n.INTERNAL,l=n.apply,u=n.call1,_=n.callProxyReciever,a={},h=function(t,e){this._promise=t,this._handler=e};h.prototype._dispose=function(){var t=this,e=this._promise;switch(e._resolved){case 0:return e.then(function(){return t._dispose()});case 1:return u(this._handler,this._promise._value)}};var p=function(t){function e(e,i){var r=this;t.call(this);var s=e.length;this._promise=new o(c),this._rest=s,this._disposed=s,this._array=e,this._error=void 0,this._result=Array(s),this._handler=i;for(var n=-1;++n1)for(var r=1;r 0) { this._iterate(); } @@ -3698,6 +3778,11 @@ class ConcatLimit extends EachLimit { module.exports = { concatLimit, ConcatLimit }; +function set(collection) { + setLimit.call(this, collection); + this._result = Array(this._rest); + return this; +} /** * `Aigle.concatLimit` is almost the as [`Aigle.concat`](https://suguru03.github.io/aigle/docs/Aigle.html#concat) and @@ -3764,7 +3849,7 @@ function concatLimit(collection, limit, iterator) { return new ConcatLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13}],7:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],7:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); @@ -3779,7 +3864,7 @@ class ConcatSeries extends EachSeries { _callResolve(value) { if (Array.isArray(value)) { this._result.push(...value); - } else { + } else if (value !== undefined) { this._result.push(value); } if (--this._rest === 0) { @@ -3909,7 +3994,7 @@ function delay(ms, value) { return new Delay(ms)._resolve(value); } -},{"./aigle":2,"./internal/util":31}],10:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37}],10:[function(require,module,exports){ 'use strict'; const { DoWhilst } = require('./doWhilst'); @@ -3971,7 +4056,7 @@ function doUntil(value, iterator, tester) { return new DoWhilst(new UntilTester(tester), iterator)._iterate(value); } -},{"./doWhilst":11,"./until":68}],11:[function(require,module,exports){ +},{"./doWhilst":11,"./until":74}],11:[function(require,module,exports){ 'use strict'; const { AigleWhilst, WhilstTester } = require('./whilst'); @@ -4044,7 +4129,7 @@ function doWhilst(value, iterator, tester) { return new DoWhilst(new WhilstTester(tester), iterator)._iterate(value); } -},{"./whilst":70}],12:[function(require,module,exports){ +},{"./whilst":76}],12:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -4055,21 +4140,22 @@ const { execute, setParallel } = require('./internal/collection'); class Each extends AigleProxy { - constructor(collection, iterator) { + constructor(collection, iterator, set = setParallel) { super(); this._iterator = iterator; this._promise = new Aigle(INTERNAL); this._coll = undefined; + this._size = undefined; this._rest = undefined; this._keys = undefined; this._result = undefined; this._iterate = undefined; if (collection === PENDING) { - this._set = setParallel; + this._set = set; this._iterate = this._callResolve; this._callResolve = execute; } else { - setParallel.call(this, collection); + set.call(this, collection); } } @@ -4149,7 +4235,7 @@ function each(collection, iterator) { return new Each(collection, iterator)._execute(); } -},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],13:[function(require,module,exports){ +},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],13:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -4167,7 +4253,7 @@ const { class EachLimit extends AigleProxy { - constructor(collection, limit, iterator) { + constructor(collection, limit, iterator, set = setLimit) { super(); if (typeof limit === 'function') { iterator = limit; @@ -4185,11 +4271,11 @@ class EachLimit extends AigleProxy { this._iterate = undefined; this._callRest = undefined; if (collection === PENDING) { - this._set = setLimit; + this._set = set; this._iterate = this._callResolve; this._callResolve = execute; } else { - setLimit.call(this, collection); + set.call(this, collection); } } @@ -4307,7 +4393,7 @@ function eachLimit(collection, limit, iterator) { } -},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],14:[function(require,module,exports){ +},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],14:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -4318,7 +4404,7 @@ const { execute, setSeries } = require('./internal/collection'); class EachSeries extends AigleProxy { - constructor(collection, iterator) { + constructor(collection, iterator, set = setSeries) { super(); this._iterator = iterator; this._promise = new Aigle(INTERNAL); @@ -4330,11 +4416,11 @@ class EachSeries extends AigleProxy { this._result = undefined; this._iterate = undefined; if (collection === PENDING) { - this._set = setSeries; + this._set = set; this._iterate = this._callResolve; this._callResolve = execute; } else { - setSeries.call(this, collection); + set.call(this, collection); } } @@ -4413,7 +4499,7 @@ function eachSeries(collection, iterator) { return new EachSeries(collection, iterator)._execute(); } -},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],15:[function(require,module,exports){ +},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],15:[function(require,module,exports){ 'use strict'; const types = [ @@ -4551,7 +4637,7 @@ function every(collection, iterator) { return new Every(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],17:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],17:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); @@ -4726,17 +4812,12 @@ function everySeries(collection, iterator) { const { Each } = require('./each'); const { setShorthand } = require('./internal/collection'); -const { INTERNAL, PENDING, compactArray } = require('./internal/util'); +const { INTERNAL, compactArray } = require('./internal/util'); class Filter extends Each { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + super(collection, iterator, set); } } @@ -4766,6 +4847,12 @@ function callResolveObject(value, index) { } /** + * `Aigle.filter` has almost the same functionality as `Array#filter`. + * It iterates all elements of `collection` and executes `iterator` using each element on parallel. + * The `iterator` needs to return a promise or something. + * If a promise is returned, the function will wait until the promise is fulfilled. + * If the result is falsy, the element will be removed. + * All of them are finished, the function will return an array as a result. * @param {Array|Object} collection * @param {Function|Array|Object|string} iterator * @return {Aigle} Returns an Aigle instance @@ -4841,23 +4928,17 @@ function filter(collection, iterator) { return new Filter(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],20:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],20:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); const { setLimit } = require('./internal/collection'); -const { INTERNAL, PENDING, compactArray } = require('./internal/util'); +const { INTERNAL, compactArray } = require('./internal/util'); class FilterLimit extends EachLimit { constructor(collection, limit, iterator) { - super(collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + super(collection, limit, iterator, set); } } @@ -4889,6 +4970,8 @@ function callResolveObject(value, index) { } /** + * `Aigle.filterLimit` is almost the as [`Aigle.filter`](https://suguru03.github.io/aigle/docs/Aigle.html#filter) and + * [`Aigle.filterSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#filterSeries), but it will work with concurrency. * @param {Array|Object} collection * @param {integer} [limit=8] * @param {Function} iterator @@ -4951,23 +5034,17 @@ function filterLimit(collection, limit, iterator) { return new FilterLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],21:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],21:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); const { setSeries } = require('./internal/collection'); -const { INTERNAL, PENDING, compactArray } = require('./internal/util'); +const { INTERNAL, compactArray } = require('./internal/util'); class FilterSeries extends EachSeries { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + super(collection, iterator, set); } } @@ -4999,6 +5076,7 @@ function callResolveObject(value, index) { } /** + * `Aigle.filterSeries` is almost the as [`Aigle.filter`](https://suguru03.github.io/aigle/docs/Aigle.html#filter), but it will work in series. * @param {Array|Object} collection * @param {Function} iterator * @return {Aigle} Returns an Aigle instance @@ -5038,22 +5116,16 @@ function filterSeries(collection, iterator) { return new FilterSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],22:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],22:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); -const { PENDING } = require('./internal/util'); const { setShorthand } = require('./internal/collection'); class Find extends Each { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + super(collection, iterator, set); } } @@ -5084,6 +5156,11 @@ function callResolveObject(value, index) { } /** + * `Aigle.find` has almost the same functionality as `Array#find`. + * It iterates all elements of `collection` and executes `iterator` using each element on parallel. + * The `iterator` needs to return a promise or something. + * If a promise is returned, the function will wait until the promise is fulfilled. + * If the result is truthly, the element will be returned as a result. * @param {Array|Object} collection * @param {Function|Array|Object|string} iterator * @return {Aigle} Returns an Aigle instance @@ -5172,143 +5249,412 @@ function find(collection, iterator) { return new Find(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],23:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],23:[function(require,module,exports){ 'use strict'; -const { EachLimit } = require('./eachLimit'); -const { PENDING } = require('./internal/util'); -const { setLimit } = require('./internal/collection'); +const { Each } = require('./each'); +const { setShorthand } = require('./internal/collection'); -class FindLimit extends EachLimit { +class FindIndex extends Each { - constructor(collection, limit, iterator) { - super(collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + constructor(collection, iterator) { + super(collection, iterator, set); + this._result = -1; + } + + _callResolve(value, index) { + if (value) { + this._size = 0; + this._promise._resolve(index); + } else if (--this._rest === 0) { + this._promise._resolve(-1); } } } -module.exports = { findLimit, FindLimit }; +module.exports = { findIndex, FindIndex }; function set(collection) { - setLimit.call(this, collection); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + setShorthand.call(this, collection); + if (this._keys !== undefined) { + this._rest = 0; + } return this; } -function callResolveArray(value, index) { - if (value) { - this._callRest = 0; - this._promise._resolve(this._coll[index]); - } else if (--this._rest === 0) { - this._promise._resolve(); - } else if (this._callRest-- > 0) { - this._iterate(); - } +/** + * @param {Array|Object} collection + * @param {Function|Array|Object|string} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findIndex(collection, iterator) { + return new FindIndex(collection, iterator)._execute(); } -function callResolveObject(value, index) { - if (value) { - this._callRest = 0; - this._promise._resolve(this._coll[this._keys[index]]); - } else if (--this._rest === 0) { - this._promise._resolve(); - } else if (this._callRest-- > 0) { - this._iterate(); +},{"./each":12,"./internal/collection":35}],24:[function(require,module,exports){ +'use strict'; + +const { EachLimit } = require('./eachLimit'); +const { setLimit } = require('./internal/collection'); + +class FindIndexLimit extends EachLimit { + + constructor(collection, limit, iterator) { + super(collection, limit, iterator, set); + this._result = -1; + } + + _callResolve(value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(index); + } else if (--this._rest === 0) { + this._promise._resolve(-1); + } else if (this._callRest-- > 0) { + this._iterate(); + } } } +module.exports = { findIndexLimit, FindIndexLimit }; + +function set(collection) { + setLimit.call(this, collection); + if (this._keys !== undefined) { + this._rest = 0; + } + return this; +} /** * @param {Array|Object} collection * @param {integer} [limit=8] * @param {Function} iterator * @return {Aigle} Returns an Aigle instance - * @example - * const order = []; - * const collection = [1, 5, 3, 4, 2]; - * const iterator = (num, index) => { - * return Aigle.delay(num * 10) - * .then(() => { - * order.push(num); - * return num % 2 === 0; - * }); - * }; - * Aigle.findLimit(collection, 2, iterator) - * .then(value => { - * console.log(value); // 2 - * console.log(order); // [1, 3, 5, 2]; - * }); - * - * @example - * const order = []; - * const collection = { a: 1, b: 5, c: 3, d: 4, e: 2 }; - * const iterator = (num, key) => { - * return Aigle.delay(num * 10) - * .then(() => { - * order.push(num); - * return num % 2 === 0; - * }); - * }; - * Aigle.findLimit(collection, 2, iterator) - * .then(value => { - * console.log(value); // 2 - * console.log(order); // [1, 3, 5, 2]; - * }); - * - * @example - * const order = []; - * const collection = [1, 5, 3, 4, 2]; - * const iterator = num => { - * return Aigle.delay(num * 10) - * .then(() => { - * order.push(num); - * return num % 2 === 0; - * }); - * }; - * Aigle.findLimit(collection, iterator) - * .then(value => { - * console.log(value); // 2 - * console.log(order); // [1, 2]; - * }); */ -function findLimit(collection, limit, iterator) { - return new FindLimit(collection, limit, iterator)._execute(); +function findIndexLimit(collection, limit, iterator) { + return new FindIndexLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],24:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],25:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); -const { PENDING } = require('./internal/util'); const { setSeries } = require('./internal/collection'); -class FindSeries extends EachSeries { +class FindIndexSeries extends EachSeries { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; + super(collection, iterator, set); + this._result = -1; + } + _callResolve(value, index) { + if (value) { + this._promise._resolve(index); + } else if (--this._rest === 0) { + this._promise._resolve(-1); } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + this._iterate(); } } } -module.exports = { findSeries, FindSeries }; +module.exports = { findIndexSeries, FindIndexSeries }; function set(collection) { setSeries.call(this, collection); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + if (this._keys !== undefined) { + this._rest = 0; + } return this; } -function callResolveArray(value, index) { - if (value) { - this._promise._resolve(this._coll[index]); +/** + * @param {Array|Object} collection + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findIndexSeries(collection, iterator) { + return new FindIndexSeries(collection, iterator)._execute(); +} + +},{"./eachSeries":14,"./internal/collection":35}],26:[function(require,module,exports){ +'use strict'; + +const { Each } = require('./each'); +const { setShorthand } = require('./internal/collection'); + +class FindKey extends Each { + + constructor(collection, iterator) { + super(collection, iterator, set); + } +} + +module.exports = { findKey, FindKey }; + +function set(collection) { + setShorthand.call(this, collection); + this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + return this; +} + +function callResolveArray(value, index) { + if (value) { + this._size = 0; + this._promise._resolve(`${index}`); + } else if (--this._rest === 0) { + this._promise._resolve(); + } +} + +function callResolveObject(value, index) { + if (value) { + this._size = 0; + this._promise._resolve(this._keys[index]); + } else if (--this._rest === 0) { + this._promise._resolve(); + } +} + +/** + * @param {Array|Object} collection + * @param {Function|Array|Object|string} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findKey(collection, iterator) { + return new FindKey(collection, iterator)._execute(); +} + +},{"./each":12,"./internal/collection":35}],27:[function(require,module,exports){ +'use strict'; + +const { EachLimit } = require('./eachLimit'); +const { setLimit } = require('./internal/collection'); + +class FindKeyLimit extends EachLimit { + + constructor(collection, limit, iterator) { + super(collection, limit, iterator, set); + } +} + +module.exports = { findKeyLimit, FindKeyLimit }; + +function set(collection) { + setLimit.call(this, collection); + this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + return this; +} + +function callResolveArray(value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(`${index}`); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else if (this._callRest-- > 0) { + this._iterate(); + } +} + +function callResolveObject(value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(this._keys[index]); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else if (this._callRest-- > 0) { + this._iterate(); + } +} + +/** + * @param {Array|Object} collection + * @param {integer} [limit=8] + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findKeyLimit(collection, limit, iterator) { + return new FindKeyLimit(collection, limit, iterator)._execute(); +} + +},{"./eachLimit":13,"./internal/collection":35}],28:[function(require,module,exports){ +'use strict'; + +const { EachSeries } = require('./eachSeries'); +const { setSeries } = require('./internal/collection'); + +class FindKeySeries extends EachSeries { + + constructor(collection, iterator) { + super(collection, iterator, set); + } +} + +module.exports = { findKeySeries, FindKeySeries }; + +function set(collection) { + setSeries.call(this, collection); + this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + return this; +} + +function callResolveArray(value, index) { + if (value) { + this._promise._resolve(`${index}`); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else { + this._iterate(); + } +} + +function callResolveObject(value, index) { + if (value) { + this._promise._resolve(this._keys[index]); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else { + this._iterate(); + } +} + +/** + * @param {Array|Object} collection + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + */ +function findKeySeries(collection, iterator) { + return new FindKeySeries(collection, iterator)._execute(); +} + +},{"./eachSeries":14,"./internal/collection":35}],29:[function(require,module,exports){ +'use strict'; + +const { EachLimit } = require('./eachLimit'); +const { setLimit } = require('./internal/collection'); + +class FindLimit extends EachLimit { + + constructor(collection, limit, iterator) { + super(collection, limit, iterator, set); + } +} + +module.exports = { findLimit, FindLimit }; + +function set(collection) { + setLimit.call(this, collection); + this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + return this; +} + +function callResolveArray(value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(this._coll[index]); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else if (this._callRest-- > 0) { + this._iterate(); + } +} + +function callResolveObject(value, index) { + if (value) { + this._callRest = 0; + this._promise._resolve(this._coll[this._keys[index]]); + } else if (--this._rest === 0) { + this._promise._resolve(); + } else if (this._callRest-- > 0) { + this._iterate(); + } +} + +/** + * `Aigle.findLimit` is almost the as [`Aigle.find`](https://suguru03.github.io/aigle/docs/Aigle.html#find) and + * [`Aigle.findSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#findSeries), but it will work with concurrency. + * @param {Array|Object} collection + * @param {integer} [limit=8] + * @param {Function} iterator + * @return {Aigle} Returns an Aigle instance + * @example + * const order = []; + * const collection = [1, 5, 3, 4, 2]; + * const iterator = (num, index) => { + * return Aigle.delay(num * 10) + * .then(() => { + * order.push(num); + * return num % 2 === 0; + * }); + * }; + * Aigle.findLimit(collection, 2, iterator) + * .then(value => { + * console.log(value); // 2 + * console.log(order); // [1, 3, 5, 2]; + * }); + * + * @example + * const order = []; + * const collection = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * const iterator = (num, key) => { + * return Aigle.delay(num * 10) + * .then(() => { + * order.push(num); + * return num % 2 === 0; + * }); + * }; + * Aigle.findLimit(collection, 2, iterator) + * .then(value => { + * console.log(value); // 2 + * console.log(order); // [1, 3, 5, 2]; + * }); + * + * @example + * const order = []; + * const collection = [1, 5, 3, 4, 2]; + * const iterator = num => { + * return Aigle.delay(num * 10) + * .then(() => { + * order.push(num); + * return num % 2 === 0; + * }); + * }; + * Aigle.findLimit(collection, iterator) + * .then(value => { + * console.log(value); // 2 + * console.log(order); // [1, 2]; + * }); + */ +function findLimit(collection, limit, iterator) { + return new FindLimit(collection, limit, iterator)._execute(); +} + +},{"./eachLimit":13,"./internal/collection":35}],30:[function(require,module,exports){ +'use strict'; + +const { EachSeries } = require('./eachSeries'); +const { setSeries } = require('./internal/collection'); + +class FindSeries extends EachSeries { + + constructor(collection, iterator) { + super(collection, iterator, set); + } +} + +module.exports = { findSeries, FindSeries }; + +function set(collection) { + setSeries.call(this, collection); + this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; + return this; +} + +function callResolveArray(value, index) { + if (value) { + this._promise._resolve(this._coll[index]); } else if (--this._rest === 0) { this._promise._resolve(); } else { @@ -5327,6 +5673,7 @@ function callResolveObject(value, index) { } /** + * `Aigle.findSeries` is almost the as [`Aigle.find`](https://suguru03.github.io/aigle/docs/Aigle.html#find), but it will work in series. * @param {Array|Object} collection * @param {Function} iterator * @return {Aigle} Returns an Aigle instance @@ -5382,23 +5729,17 @@ function findSeries(collection, iterator) { return new FindSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],25:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],31:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); -const { PENDING } = require('./internal/util'); const { setShorthand } = require('./internal/collection'); class GroupBy extends Each { constructor(collection, iterator) { - super(collection, iterator); + super(collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } } @@ -5504,23 +5845,17 @@ function groupBy(collection, iterator) { return new GroupBy(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],26:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],32:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); -const { PENDING } = require('./internal/util'); const { setLimit } = require('./internal/collection'); class GroupByLimit extends EachLimit { constructor(collection, limit, iterator) { - super(collection, limit, iterator); + super(collection, limit, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } } @@ -5621,23 +5956,17 @@ function groupByLimit(collection, limit, iterator) { return new GroupByLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],27:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],33:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); -const { PENDING } = require('./internal/util'); const { setSeries } = require('./internal/collection'); class GroupBySeries extends EachSeries { constructor(collection, iterator) { - super(collection, iterator); + super(collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } } @@ -5715,7 +6044,7 @@ function groupBySeries(collection, iterator) { return new GroupBySeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],28:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],34:[function(require,module,exports){ 'use strict'; const queue = Array(8); @@ -5753,7 +6082,7 @@ function invoke(promise) { module.exports = invoke; -},{}],29:[function(require,module,exports){ +},{}],35:[function(require,module,exports){ 'use strict'; const { call3, callProxyReciever } = require('./util'); @@ -5972,7 +6301,7 @@ function iterateObjectWithObject() { } } -},{"./util":31}],30:[function(require,module,exports){ +},{"./util":37}],36:[function(require,module,exports){ 'use strict'; class Queue { @@ -5989,7 +6318,7 @@ class Queue { module.exports = Queue; -},{}],31:[function(require,module,exports){ +},{}],37:[function(require,module,exports){ 'use strict'; const { AigleCore } = require('aigle-core'); @@ -6016,6 +6345,7 @@ module.exports = { promiseArrayEach, promiseObjectEach, compactArray, + concatArray, clone, sort }; @@ -6238,6 +6568,21 @@ function compactArray(array) { return result; } +function concatArray(array) { + let i = -1; + const l = array.length; + const result = []; + while (++i < l) { + const value = array[i]; + if (Array.isArray(value)) { + result.push(...value); + } else if (value !== undefined) { + result.push(value); + } + } + return result; +} + function clone(target) { return Array.isArray(target) ? cloneArray(target) : cloneObject(target); } @@ -6275,7 +6620,7 @@ function sort(array) { return array; } -},{"../../package.json":74,"aigle-core":71}],32:[function(require,module,exports){ +},{"../../package.json":80,"aigle-core":77}],38:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -6394,22 +6739,16 @@ function spread(proxy, array) { callProxyReciever(apply(_handler, array), proxy, INTERNAL); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],33:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],39:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); -const { PENDING } = require('./internal/util'); const { setShorthand } = require('./internal/collection'); class Map extends Each { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + super(collection, iterator, set); } _callResolve(value, index) { @@ -6429,6 +6768,11 @@ function set(collection) { } /** + * `Aigle.map` has almost the same functionality as `Array#map`. + * It iterates all elements of `collection` and executes `iterator` using each element on parallel. + * The `iterator` needs to return a promise or something. + * Then the result will be assigned to an array and the array order will be ensured. + * All of them are finished, the function will return an array as a result. * @param {Array|Object} collection * @param {Function|string} iterator * @return {Aigle} Returns an Aigle instance @@ -6479,22 +6823,16 @@ function map(collection, iterator) { return new Map(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],34:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],40:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); -const { PENDING } = require('./internal/util'); const { setLimit } = require('./internal/collection'); class MapLimit extends EachLimit { constructor(collection, limit, iterator) { - super(collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - } + super(collection, limit, iterator, set); } _callResolve(value, index) { @@ -6517,6 +6855,8 @@ function set(collection) { /** + * `Aigle.mapLimit` is almost the as [`Aigle.map`](https://suguru03.github.io/aigle/docs/Aigle.html#map) and + * [`Aigle.mapSeries`](https://suguru03.github.io/aigle/docs/Aigle.html#mapSeries), but it will work with concurrency. * @param {Array|Object} collection * @param {integer} [limit=8] * @param {Function} iterator @@ -6574,22 +6914,16 @@ function mapLimit(collection, limit, iterator) { } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],35:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],41:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); -const { PENDING } = require('./internal/util'); const { setSeries } = require('./internal/collection'); class MapSeries extends EachSeries { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - } + super(collection, iterator, set); } _callResolve(value, index) { @@ -6611,6 +6945,7 @@ function set(collection) { } /** + * `Aigle.mapSeries` is almost the as [`Aigle.map`](https://suguru03.github.io/aigle/docs/Aigle.html#map), but it will work in series. * @param {Array|Object} collection * @param {Function} iterator * @return {Aigle} Returns an Aigle instance @@ -6650,23 +6985,17 @@ function mapSeries(collection, iterator) { return new MapSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],36:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],42:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); -const { PENDING } = require('./internal/util'); const { setShorthand } = require('./internal/collection'); class MapValues extends Each { constructor(collection, iterator) { - super(collection, iterator); + super(collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } } @@ -6741,23 +7070,17 @@ function mapValues(collection, iterator) { return new MapValues(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],37:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],43:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); -const { PENDING } = require('./internal/util'); const { setLimit } = require('./internal/collection'); class MapValuesLimit extends EachLimit { constructor(collection, limit, iterator) { - super(collection, limit, iterator); + super(collection, limit, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } } @@ -6844,23 +7167,17 @@ function mapValuesLimit(collection, limit, iterator) { return new MapValuesLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],38:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],44:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); -const { PENDING } = require('./internal/util'); const { setSeries } = require('./internal/collection'); class MapValuesSeries extends EachSeries { constructor(collection, iterator) { - super(collection, iterator); + super(collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } } @@ -6930,23 +7247,17 @@ function mapValuesSeries(collection, iterator) { return new MapValuesSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],39:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],45:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); -const { PENDING } = require('./internal/util'); const { setShorthand } = require('./internal/collection'); class Omit extends Each { constructor(collection, iterator) { - super(collection, iterator); + super(collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } } @@ -7053,23 +7364,17 @@ function omit(collection, iterator) { return new Omit(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],40:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],46:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); -const { PENDING } = require('./internal/util'); const { setLimit } = require('./internal/collection'); class OmitLimit extends EachLimit { constructor(collection, limit, iterator) { - super(collection, limit, iterator); + super(collection, limit, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } } @@ -7161,7 +7466,7 @@ function omitLimit(collection, limit, iterator) { return new OmitLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],41:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],47:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); @@ -7252,7 +7557,7 @@ function omitSeries(collection, iterator) { return new OmitSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],42:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],48:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -7378,23 +7683,17 @@ function parallel(collection) { return new Parallel(collection)._execute(); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],43:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],49:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); -const { PENDING } = require('./internal/util'); const { setShorthand } = require('./internal/collection'); class Pick extends Each { constructor(collection, iterator) { - super(collection, iterator); + super(collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } } @@ -7501,23 +7800,17 @@ function pick(collection, iterator) { return new Pick(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],44:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],50:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); -const { PENDING } = require('./internal/util'); const { setLimit } = require('./internal/collection'); class PickLimit extends EachLimit { constructor(collection, limit, iterator) { - super(collection, limit, iterator); + super(collection, limit, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } } @@ -7609,23 +7902,17 @@ function pickLimit(collection, limit, iterator) { return new PickLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],45:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35}],51:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); -const { PENDING } = require('./internal/util'); const { setSeries } = require('./internal/collection'); class PickSeries extends EachSeries { constructor(collection, iterator) { - super(collection, iterator); + super(collection, iterator, set); this._result = {}; - if (collection === PENDING) { - this._set = set; - } else { - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } } } @@ -7700,7 +7987,7 @@ function pickSeries(collection, iterator) { return new PickSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],46:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35}],52:[function(require,module,exports){ 'use strict'; const { Aigle } = require('./aigle'); @@ -7823,7 +8110,7 @@ function makeFunction(fn, ctx) { } } -},{"./aigle":2,"./internal/util":31}],47:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37}],53:[function(require,module,exports){ 'use strict'; const promisify = require('./promisify'); @@ -7914,7 +8201,7 @@ function iterate(suffix, filter, obj, target, depth, memo) { } } -},{"./promisify":46}],48:[function(require,module,exports){ +},{"./promisify":52}],54:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -8003,7 +8290,7 @@ function props(object) { return new Props(object)._execute(); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],49:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],55:[function(require,module,exports){ 'use strict'; const { Parallel } = require('./parallel'); @@ -8044,7 +8331,7 @@ function race(collection) { return new Race(collection)._execute(); } -},{"./parallel":42}],50:[function(require,module,exports){ +},{"./parallel":48}],56:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -8159,22 +8446,17 @@ function reduce(collection, iterator, result) { return new Reduce(collection, iterator, result)._execute(); } -},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],51:[function(require,module,exports){ +},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],57:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); const { setShorthand } = require('./internal/collection'); -const { INTERNAL, PENDING, compactArray } = require('./internal/util'); +const { INTERNAL, compactArray } = require('./internal/util'); class Reject extends Each { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + super(collection, iterator, set); } } @@ -8289,23 +8571,17 @@ function reject(collection, iterator) { return new Reject(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],52:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],58:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); const { setLimit } = require('./internal/collection'); -const { INTERNAL, PENDING, compactArray } = require('./internal/util'); +const { INTERNAL, compactArray } = require('./internal/util'); class RejectLimit extends EachLimit { constructor(collection, limit, iterator) { - super(collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + super(collection, limit, iterator, set); } } @@ -8393,23 +8669,17 @@ function rejectLimit(collection, limit, iterator) { return new RejectLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],53:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],59:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); const { setSeries } = require('./internal/collection'); -const { INTERNAL, PENDING, compactArray } = require('./internal/util'); +const { INTERNAL, compactArray } = require('./internal/util'); class RejectSeries extends EachSeries { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + super(collection, iterator, set); } } @@ -8480,7 +8750,7 @@ function rejectSeries(collection, iterator) { return new RejectSeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],54:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],60:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -8553,23 +8823,17 @@ function retry(times, handler) { return new Retry(handler, times)._promise; } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],55:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],61:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); -const { PENDING } = require('./internal/util'); const { setShorthand } = require('./internal/collection'); class Some extends Each { constructor(collection, iterator) { - super(collection, iterator); + super(collection, iterator, setShorthand); this._result = false; - if (collection === PENDING) { - this._set = setShorthand; - } else { - setShorthand.call(this, collection); - } } _callResolve(value) { @@ -8672,7 +8936,7 @@ function some(collection, iterator) { return new Some(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],56:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35}],62:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); @@ -8754,7 +9018,7 @@ function someLimit(collection, limit, iterator) { return new SomeLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13}],57:[function(require,module,exports){ +},{"./eachLimit":13}],63:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries.js'); @@ -8835,22 +9099,17 @@ function someSeries(collection, iterator) { return new SomeSeries(collection, iterator)._execute(); } -},{"./eachSeries.js":14}],58:[function(require,module,exports){ +},{"./eachSeries.js":14}],64:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); -const { PENDING, sort } = require('./internal/util'); +const { sort } = require('./internal/util'); const { setShorthand } = require('./internal/collection'); class SortBy extends Each { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } + super(collection, iterator, set); } } @@ -8929,23 +9188,17 @@ function sortBy(collection, iterator) { return new SortBy(collection, iterator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],59:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],65:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); -const { PENDING, sort } = require('./internal/util'); +const { sort } = require('./internal/util'); const { setLimit } = require('./internal/collection'); class SortByLimit extends EachLimit { constructor(collection, limit, iterator) { - super(collection, limit, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + super(collection, limit, iterator, set); } } @@ -9033,23 +9286,17 @@ function sortByLimit(collection, limit, iterator) { return new SortByLimit(collection, limit, iterator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],60:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],66:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); -const { PENDING, sort } = require('./internal/util'); +const { sort } = require('./internal/util'); const { setSeries } = require('./internal/collection'); class SortBySeries extends EachSeries { constructor(collection, iterator) { - super(collection, iterator); - if (collection === PENDING) { - this._set = set; - } else { - this._result = Array(this._rest); - this._callResolve = this._keys === undefined ? callResolveArray : callResolveObject; - } + super(collection, iterator, set); } } @@ -9120,7 +9367,7 @@ function sortBySeries(collection, iterator) { return new SortBySeries(collection, iterator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],61:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],67:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -9156,7 +9403,7 @@ class Timeout extends AigleProxy { module.exports = Timeout; -},{"./aigle":2,"./error":15,"./internal/util":31,"aigle-core":71}],62:[function(require,module,exports){ +},{"./aigle":2,"./error":15,"./internal/util":37,"aigle-core":77}],68:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -9246,7 +9493,7 @@ function times(times, iterator) { return new Times(times, iterator)._execute(); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],63:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],69:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -9379,7 +9626,7 @@ function timesLimit(times, limit, iterator) { return new TimesLimit(times, limit, iterator)._execute(); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],64:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],70:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -9459,25 +9706,20 @@ function timesSeries(times, iterator) { return new TimesSeries(times, iterator)._execute(); } -},{"./aigle":2,"./internal/util":31,"./times":62,"aigle-core":71}],65:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"./times":68,"aigle-core":77}],71:[function(require,module,exports){ 'use strict'; const { Each } = require('./each'); const { setParallel } = require('./internal/collection'); -const { PENDING, call3, callProxyReciever, clone } = require('./internal/util'); +const { call3, callProxyReciever, clone } = require('./internal/util'); class Transform extends Each { constructor(collection, iterator, accumulator) { - super(collection, iterator); + super(collection, iterator, set); if (accumulator !== undefined) { this._result = accumulator; } - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } _callResolve(bool) { @@ -9582,12 +9824,12 @@ function transform(collection, iterator, accumulator) { return new Transform(collection, iterator, accumulator)._execute(); } -},{"./each":12,"./internal/collection":29,"./internal/util":31}],66:[function(require,module,exports){ +},{"./each":12,"./internal/collection":35,"./internal/util":37}],72:[function(require,module,exports){ 'use strict'; const { EachLimit } = require('./eachLimit'); const { setLimit } = require('./internal/collection'); -const { DEFAULT_LIMIT, PENDING, call3, callProxyReciever, clone } = require('./internal/util'); +const { DEFAULT_LIMIT, call3, callProxyReciever, clone } = require('./internal/util'); class TransformLimit extends EachLimit { @@ -9597,15 +9839,10 @@ class TransformLimit extends EachLimit { iterator = limit; limit = DEFAULT_LIMIT; } - super(collection, limit, iterator); + super(collection, limit, iterator, set); if (accumulator !== undefined) { this._result = accumulator; } - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } _callResolve(bool) { @@ -9723,25 +9960,20 @@ function transformLimit(collection, limit, iterator, accumulator) { return new TransformLimit(collection, limit, iterator, accumulator)._execute(); } -},{"./eachLimit":13,"./internal/collection":29,"./internal/util":31}],67:[function(require,module,exports){ +},{"./eachLimit":13,"./internal/collection":35,"./internal/util":37}],73:[function(require,module,exports){ 'use strict'; const { EachSeries } = require('./eachSeries'); const { setSeries } = require('./internal/collection'); -const { PENDING, call3, callProxyReciever, clone } = require('./internal/util'); +const { call3, callProxyReciever, clone } = require('./internal/util'); class TransformSeries extends EachSeries { constructor(collection, iterator, accumulator) { - super(collection, iterator); + super(collection, iterator, set); if (accumulator !== undefined) { this._result = accumulator; } - if (collection === PENDING) { - this._set = set; - } else { - set.call(this, collection); - } } _callResolve(bool) { @@ -9842,7 +10074,7 @@ function transformSeries(collection, iterator, accumulator) { return new TransformSeries(collection, iterator, accumulator)._execute(); } -},{"./eachSeries":14,"./internal/collection":29,"./internal/util":31}],68:[function(require,module,exports){ +},{"./eachSeries":14,"./internal/collection":35,"./internal/util":37}],74:[function(require,module,exports){ 'use strict'; const { AigleWhilst, WhilstTester } = require('./whilst'); @@ -9878,7 +10110,7 @@ function until(value, tester, iterator) { return new AigleWhilst(new UntilTester(tester), iterator)._iterate(value); } -},{"./whilst":70}],69:[function(require,module,exports){ +},{"./whilst":76}],75:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -9996,7 +10228,7 @@ function using() { return new Using(array, handler)._promise; } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],70:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],76:[function(require,module,exports){ 'use strict'; const { AigleProxy } = require('aigle-core'); @@ -10074,7 +10306,7 @@ function whilst(value, tester, iterator) { return new AigleWhilst(new WhilstTester(tester), iterator)._iterate(value); } -},{"./aigle":2,"./internal/util":31,"aigle-core":71}],71:[function(require,module,exports){ +},{"./aigle":2,"./internal/util":37,"aigle-core":77}],77:[function(require,module,exports){ 'use strict'; class AigleCore { @@ -10087,7 +10319,7 @@ class AigleProxy { module.exports = { AigleCore, AigleProxy }; -},{}],72:[function(require,module,exports){ +},{}],78:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -10273,7 +10505,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],73:[function(require,module,exports){ +},{}],79:[function(require,module,exports){ (function (process,global){ (function (global, undefined) { "use strict"; @@ -10463,14 +10695,15 @@ process.umask = function() { return 0; }; }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":72}],74:[function(require,module,exports){ +},{"_process":78}],80:[function(require,module,exports){ module.exports={ "name": "aigle", - "version": "1.4.2", + "version": "1.5.0", "description": "Aigle is an ideal Promise library, faster and more functional than other Promise libraries", "main": "index.js", "browser": "browser.js", "scripts": { + "bench": "node --expose_gc ./benchmark -d", "test": "DELAY=50 istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -R spec ./test --recursive && codecov" }, "keywords": [ @@ -10488,7 +10721,7 @@ module.exports={ "author": "Suguru Motegi", "license": "MIT", "devDependencies": { - "babili": "0.1.2", + "babili": "0.1.4", "benchmark": "^2.1.1", "bluebird": "^3.5.0", "browserify": "^14.1.0", diff --git a/dist/aigle.min.js b/dist/aigle.min.js index 5f65e203..edf3f6ff 100644 --- a/dist/aigle.min.js +++ b/dist/aigle.min.js @@ -1,2 +1,2 @@ -(function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var l;l="undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window,l.Promise=e()}})(function(){return function _(c,e,t){function l(i,s){if(!e[i]){if(!c[i]){var o="function"==typeof require&&require;if(!s&&o)return o(i,!0);if(r)return r(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var n=e[i]={exports:{}};c[i][0].call(n.exports,function(t){var e=c[i][1][t];return l(e?e:t)},n,n.exports,_,c,e,t)}return e[i].exports}for(var r="function"==typeof require&&require,i=0;i{void 0===l||(l=void 0,R(this,e))},(e)=>{void 0===l||(l=void 0,this._reject(e))})}catch(t){if(l===void 0)return;l=void 0,this._reject(t)}}function i(l){L&&Al(this);try{l((e)=>{void 0===l||(l=void 0,R(this,e))},(e)=>{void 0===l||(l=void 0,this._reject(e))},(e)=>{if("function"!=typeof e)throw new TypeError("onCancel must be function");void 0===l||(void 0===this._onCancelQueue&&(this._onCancelQueue=new m),this._onCancelQueue.push(e))})}catch(t){if(l===void 0)return;l=void 0,this._reject(t)}}function s(e,t){return(r)=>{for(let i=e.length;i--;)if(r instanceof e[i])return t(r);return h.e=r,h}}function _(e,l){return()=>{const{_resolved:t,_value:r}=e,i=x(l);if(i===h)return i;if(i instanceof n)switch(i._resolved){case 1:return i._value=r,i;case 2:return i;}const s=new S(y);return i&&i.then?1===t?i.then(()=>s._resolve(r),(e)=>s._reject(e)):i.then(()=>s._reject(r),(e)=>s._reject(e)):(s._resolved=t,s._value=r),s}}function o(e,l,t,r){return L&&Al(l,e),void 0===e._receiver?(0!==e._resolved&&p(e),e._receiver=l,e._onFulfilled=t,e._onRejected=r):(!e._receivers&&(e._receivers=new m),e._receivers.push({receiver:l,onFulfilled:t,onRejected:r})),l}function a(e,l){return L&&Al(l,e),0!==e._resolved&&p(e),e._receiver=l,l._promise}function c(e,l,t,r,i){if(L){L=!1;const s=c(e,l,t,r,i);return L=!0,Al(s,e),s}switch(e._resolved){case 0:const s=new l(d,t,r,i);return void 0===e._receiver?e._receiver=s:(!e._receivers&&(e._receivers=new m),e._receivers.push({receiver:s})),s._promise;case 1:return new l(e._value,t,r,i)._execute();case 2:return S.reject(e._value);}}const{AigleCore:n,AigleProxy:u}=e("aigle-core"),m=e("./internal/queue"),p=e("./internal/async"),{VERSION:v,INTERNAL:y,PENDING:d,errorObj:h,call0:x,callResolve:g,callReject:k,callReceiver:R}=e("./internal/util");let L=!1;class S extends n{constructor(e){super(),this._resolved=0,this._value=void 0,this._key=void 0,this._receiver=void 0,this._onFulfilled=void 0,this._onRejected=void 0,this._receivers=void 0;e===y||this._execute(e)}toString(){return"[object Promise]"}then(e,l){return o(this,new S(y),e,l)}catch(e){if(1dl(t,e,l))}doWhilst(e,l){return this.then((t)=>hl(t,e,l))}until(e,l){return this.then((t)=>xl(t,e,l))}doUntil(e,l){return this.then((t)=>gl(t,e,l))}times(e){return c(this,Ll,e)}timesSeries(e){return c(this,El,e)}timesLimit(e,l){return c(this,Nl,e,l)}disposer(e){return new Pl(this,e)}_resolve(e){0===this._resolved&&(this._resolved=1,this._value=e,void 0===this._receiver||this._callResolve())}_callResolve(){const{_receiver:e}=this;if(this._receiver=void 0,e instanceof u?e._callResolve(this._value,this._key):this._key===y?e._resolve(this._value):g(e,this._onFulfilled,this._value),!!this._receivers){const{_value:e,_key:l,_receivers:t}=this;this._receivers=void 0;let r=-1;const{array:i}=t;for(;++rt.prototype._resolve.call(this,e),this._ms),this}_reject(e){clearTimeout(this._timer),t.prototype._reject.call(this,e)}}l.exports={delay:function(e,l){return new i(e)._resolve(l)},Delay:i}},{"./aigle":2,"./internal/util":31}],10:[function(e,l){"use strict";const{DoWhilst:t}=e("./doWhilst"),{UntilTester:r}=e("./until");l.exports=function(e,l,i){return"function"!=typeof i&&(i=l,l=e,e=void 0),new t(new r(i),l)._iterate(e)}},{"./doWhilst":11,"./until":68}],11:[function(e,l){"use strict";const{AigleWhilst:t,WhilstTester:r}=e("./whilst");class i extends t{constructor(e,l){super(e,l)}_iterate(e){return this._next(e),this._promise}}l.exports={doWhilst:function(e,l,t){return"function"!=typeof t&&(t=l,l=e,e=void 0),new i(new r(t),l)._iterate(e)},DoWhilst:i}},{"./whilst":70}],12:[function(e,l){"use strict";const{AigleProxy:t}=e("aigle-core"),{Aigle:r}=e("./aigle"),{INTERNAL:i,PENDING:s}=e("./internal/util"),{execute:_,setParallel:o}=e("./internal/collection");class a extends t{constructor(e,l){super(),this._iterator=l,this._promise=new r(i),this._coll=void 0,this._rest=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,e===s?(this._set=o,this._iterate=this._callResolve,this._callResolve=_):o.call(this,e)}_execute(){return 0===this._rest?this._promise._resolve(this._result):this._iterate(),this._promise}_callResolve(e){(0==--this._rest||!1===e)&&this._promise._resolve()}_callReject(e){this._promise._reject(e)}}l.exports={each:function(e,l){return new a(e,l)._execute()},Each:a}},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],13:[function(e,l){"use strict";const{AigleProxy:t}=e("aigle-core"),{Aigle:r}=e("./aigle"),{DEFAULT_LIMIT:i,INTERNAL:s,PENDING:_}=e("./internal/util"),{execute:o,setLimit:a}=e("./internal/collection");class c extends t{constructor(e,l,t){super(),"function"==typeof l&&(t=l,l=i),this._iterator=t,this._promise=new r(s),this._index=0,this._limit=l,this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,this._callRest=void 0,e===_?(this._set=a,this._iterate=this._callResolve,this._callResolve=o):a.call(this,e)}_execute(){if(0===this._rest)this._promise._resolve(this._result);else for(;this._limit--;)this._iterate();return this._promise}_callResolve(e){!1===e?(this._callRest=0,this._promise._resolve()):0==--this._rest?this._promise._resolve():0{l?e._reject(l):e._resolve(t)}}function r(e,r){function l(i){const o=new s(_),a=t(o);let c=arguments.length;switch(c){case 0:e[r](a);break;case 1:e[r](i,a);break;default:const l=Array(c);for(;c--;)l[c]=arguments[c];l[l.length]=a,e[r].apply(e,l);}return o}return l.__isPromisified__=!0,l}function i(e,r){function l(i){const o=new s(_),a=t(o);let c=arguments.length;switch(c){case 0:e.call(r||this,a);break;case 1:e.call(r||this,i,a);break;default:const l=Array(c);for(;c--;)l[c]=arguments[c];l[l.length]=a,e.apply(r||this,l);}return o}return l.__isPromisified__=!0,l}const{Aigle:s}=e("./aigle"),{INTERNAL:_}=e("./internal/util");l.exports=function(e,l){switch(typeof e){case"object":switch(typeof l){case"string":case"number":return e[l].__isPromisified__?e[l]:r(e,l);default:throw new TypeError("Second argument is invalid");}case"function":if(e.__isPromisified__)return e;const t=l&&l.context!==void 0?l.context:void 0;return i(e,t);default:throw new TypeError("Type of first argument is not function");}}},{"./aigle":2,"./internal/util":31}],47:[function(e,l){"use strict";function t(e){return /^_/.test(e)}function r(e,l,t,r,_,o){const a={};switch(typeof t){case"function":if(_){const l=`${r}${e}`;if(!_[l])_[l]=s(t);else if(!_[l].__isPromisified__)throw new TypeError(`Cannot promisify an API that has normal methods with '${e}'-suffix`)}i(e,l,t,t,o,a),i(e,l,t.prototype,t.prototype,o,a);break;case"object":i(e,l,t,t,o,a),i(e,l,Object.getPrototypeOf(t),t,o,a);}}function i(e,t,i,s,n,u){if(0!=n--&&i&&o!==i&&a!==i&&c!==i&&!Object.isFrozen(i)){const o=Object.getOwnPropertyNames(i);for(let a=o.length;a--;){const l=o[a];if(!0===_[l]||!0===u[l]||t(l))continue;const c=Object.getOwnPropertyDescriptor(i,l);!c||c.set||c.get||(u[l]=!0,r(e,t,i[l],l,s,n))}}}const s=e("./promisify"),_={constructor:!0,arity:!0,length:!0,name:!0,arguments:!0,caller:!0,callee:!0,prototype:!0,__isPromisified__:!0};l.exports=function(e,l){const{suffix:i="Async",filter:s=t,depth:_=2}=l||{};return r(i,s,e,void 0,void 0,_),e};const o=Function.prototype,a=Object.prototype,c=Array.prototype},{"./promisify":46}],48:[function(e,l){"use strict";function t(e){const l=Object.keys(e);return this._rest=l.length,this._coll=e,this._keys=l,this._callResolve=this._execute,r.call(this),this}function r(){return 0===this._rest?this._promise._resolve(this._result):c(this),this._promise}function i(e){return new n(e)._execute()}const{AigleProxy:s}=e("aigle-core"),{Aigle:_}=e("./aigle"),{INTERNAL:o,PENDING:a,promiseObjectEach:c}=e("./internal/util");class n extends s{constructor(e){if(super(),this._promise=new _(o),this._result={},e===a)this._rest=void 0,this._coll=void 0,this._keys=void 0,this._execute=this._callResolve,this._callResolve=t;else{const l=Object.keys(e);this._rest=l.length,this._coll=e,this._keys=l,this._execute=r}}_callResolve(e,l){this._result[l]=e,0==--this._rest&&this._promise._resolve(this._result)}_callReject(e){this._promise._reject(e)}}l.exports={props:i,Props:n},l.exports={props:i,Props:n}},{"./aigle":2,"./internal/util":31,"aigle-core":71}],49:[function(e,l){"use strict";const{Parallel:t}=e("./parallel");class r extends t{constructor(e){super(e),this._result=void 0}_callResolve(e){this._promise._resolve(e)}}l.exports={race:function(e){return new r(e)._execute()},Race:r}},{"./parallel":42}],50:[function(e,l){"use strict";function t(e){return n.call(this,e),void 0===this._keys?(this._iterate=r,this._execute=s):(this._iterate=i,this._execute=_),this}function r(e,l){v(p(this._iterator,l,this._coll[e],e),this,e)}function i(e,l){const t=this._keys[e];v(p(this._iterator,l,this._coll[t],t),this,e)}function s(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._result?this._callResolve(this._coll[0],0):this._iterate(0,this._result),this._promise}function _(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._result?this._callResolve(this._coll[this._keys[0]],0):this._iterate(0,this._result),this._promise}const{AigleProxy:o}=e("aigle-core"),{Aigle:a}=e("./aigle"),{execute:c,setSeries:n}=e("./internal/collection"),{INTERNAL:u,PENDING:m,call3:p,callProxyReciever:v}=e("./internal/util");class y extends o{constructor(e,l,r){super(),this._result=r,this._iterator=l,this._promise=new a(u),this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._iterate=void 0,e===m?(this._set=t,this._iterate=this._callResolve,this._callResolve=c):t.call(this,e)}_callResolve(e,l){0==--this._rest?this._promise._resolve(e):this._iterate(++l,e)}_callReject(e){this._promise._reject(e)}}l.exports={reduce:function(e,l,t){return new y(e,l,t)._execute()},Reduce:y}},{"./aigle":2,"./internal/collection":29,"./internal/util":31,"aigle-core":71}],51:[function(e,l){"use strict";function t(e){return _.call(this,e),this._result=Array(this._rest),this._callResolve=void 0===this._keys?r:i,this}function r(e,l){this._result[l]=e?o:this._coll[l],0==--this._rest&&this._promise._resolve(c(this._result))}function i(e,l){this._result[l]=e?o:this._coll[this._keys[l]],0==--this._rest&&this._promise._resolve(c(this._result))}const{Each:s}=e("./each"),{setShorthand:_}=e("./internal/collection"),{INTERNAL:o,PENDING:a,compactArray:c}=e("./internal/util");class n extends s{constructor(e,l){super(e,l),e===a?this._set=t:t.call(this,e)}}l.exports={reject:function(e,l){return new n(e,l)._execute()},Reject:n}},{"./each":12,"./internal/collection":29,"./internal/util":31}],52:[function(e,l){"use strict";function t(e){return _.call(this,e),this._result=Array(this._rest),this._callResolve=void 0===this._keys?r:i,this}function r(e,l){this._result[l]=e?o:this._coll[l],0==--this._rest?this._promise._resolve(c(this._result)):0{l?this._callReject(l):this._callReject(new i("operation timed out"))},e)}_callResolve(e){clearTimeout(this._timer),this._promise._resolve(e)}_callReject(e){clearTimeout(this._timer),this._promise._reject(e)}}},{"./aigle":2,"./error":15,"./internal/util":31,"aigle-core":71}],62:[function(e,l){"use strict";function t(e){e=+e,1<=e?(this._rest=e,this._result=Array(e)):(this._rest=0,this._result=[])}function r(e){this._callResolve=this._rest,t.call(this,e),this._execute()}const{AigleProxy:i}=e("aigle-core"),{Aigle:s}=e("./aigle"),{INTERNAL:_,PENDING:o,defaultIterator:a,call1:c,callProxyReciever:n}=e("./internal/util");class u extends i{constructor(e,l){super(),this._promise=new s(_),this._iterator="function"==typeof l?l:a,this._rest=void 0,this._result=void 0,e===o?(this._rest=this._callResolve,this._callResolve=r):t.call(this,e)}_execute(){if(1<=this._rest){const{_rest:e,_iterator:l}=this;for(let t=-1;++tthis._dispose());case 1:return _(this._handler,this._promise._value);}}}class n extends t{constructor(e,l){super();const t=e.length;this._promise=new r(i),this._rest=t,this._disposed=t,this._array=e,this._error=void 0,this._result=Array(t),this._handler=l;for(let l=-1;++l{void 0===l||(l=void 0,S(this,e))},(e)=>{void 0===l||(l=void 0,this._reject(e))})}catch(t){if(l===void 0)return;l=void 0,this._reject(t)}}function i(l){k&&Kl(this);try{l((e)=>{void 0===l||(l=void 0,S(this,e))},(e)=>{void 0===l||(l=void 0,this._reject(e))},(e)=>{if("function"!=typeof e)throw new TypeError("onCancel must be function");void 0===l||(void 0===this._onCancelQueue&&(this._onCancelQueue=new m),this._onCancelQueue.push(e))})}catch(t){if(l===void 0)return;l=void 0,this._reject(t)}}function s(e,t){return(r)=>{for(let i=e.length;i--;)if(r instanceof e[i])return t(r);return x.e=r,x}}function _(e,l){return()=>{const{_resolved:t,_value:r}=e,i=h(l);if(i===x)return i;if(i instanceof n)switch(i._resolved){case 1:return i._value=r,i;case 2:return i;}const s=new R(v);return i&&i.then?1===t?i.then(()=>s._resolve(r),(e)=>s._reject(e)):i.then(()=>s._reject(r),(e)=>s._reject(e)):(s._resolved=t,s._value=r),s}}function o(e,l,t,r){return k&&Kl(l,e),void 0===e._receiver?(0!==e._resolved&&p(e),e._receiver=l,e._onFulfilled=t,e._onRejected=r):(!e._receivers&&(e._receivers=new m),e._receivers.push({receiver:l,onFulfilled:t,onRejected:r})),l}function a(e,l){return k&&Kl(l,e),0!==e._resolved&&p(e),e._receiver=l,l._promise}function c(e,l,t,r,i){if(k){k=!1;const s=c(e,l,t,r,i);return k=!0,Kl(s,e),s}switch(e._resolved){case 0:const s=new l(y,t,r,i);return void 0===e._receiver?e._receiver=s:(!e._receivers&&(e._receivers=new m),e._receivers.push({receiver:s})),s._promise;case 1:return new l(e._value,t,r,i)._execute();case 2:return R.reject(e._value);}}const{AigleCore:n,AigleProxy:u}=e("aigle-core"),m=e("./internal/queue"),p=e("./internal/async"),{VERSION:d,INTERNAL:v,PENDING:y,errorObj:x,call0:h,callResolve:g,callReject:L,callReceiver:S}=e("./internal/util");let k=!1;class R extends n{constructor(e){super(),this._resolved=0,this._value=void 0,this._key=void 0,this._receiver=void 0,this._onFulfilled=void 0,this._onRejected=void 0,this._receivers=void 0;e===v||this._execute(e)}toString(){return"[object Promise]"}then(e,l){return o(this,new R(v),e,l)}catch(e){if(1Nl(t,e,l))}doWhilst(e,l){return this.then((t)=>Il(t,e,l))}until(e,l){return this.then((t)=>Pl(t,e,l))}doUntil(e,l){return this.then((t)=>Tl(t,e,l))}times(e){return c(this,Fl,e)}timesSeries(e){return c(this,Ml,e)}timesLimit(e,l){return c(this,Ol,e,l)}disposer(e){return new Cl(this,e)}_resolve(e){0===this._resolved&&(this._resolved=1,this._value=e,void 0===this._receiver||this._callResolve())}_callResolve(){const{_receiver:e}=this;if(this._receiver=void 0,e instanceof u?e._callResolve(this._value,this._key):this._key===v?e._resolve(this._value):g(e,this._onFulfilled,this._value),!!this._receivers){const{_value:e,_key:l,_receivers:t}=this;this._receivers=void 0;let r=-1;const{array:i}=t;for(;++rt.prototype._resolve.call(this,e),this._ms),this}_reject(e){clearTimeout(this._timer),t.prototype._reject.call(this,e)}}l.exports={delay:function(e,l){return new i(e)._resolve(l)},Delay:i}},{"./aigle":2,"./internal/util":37}],10:[function(e,l){"use strict";const{DoWhilst:t}=e("./doWhilst"),{UntilTester:r}=e("./until");l.exports=function(e,l,i){return"function"!=typeof i&&(i=l,l=e,e=void 0),new t(new r(i),l)._iterate(e)}},{"./doWhilst":11,"./until":74}],11:[function(e,l){"use strict";const{AigleWhilst:t,WhilstTester:r}=e("./whilst");class i extends t{constructor(e,l){super(e,l)}_iterate(e){return this._next(e),this._promise}}l.exports={doWhilst:function(e,l,t){return"function"!=typeof t&&(t=l,l=e,e=void 0),new i(new r(t),l)._iterate(e)},DoWhilst:i}},{"./whilst":76}],12:[function(e,l){"use strict";const{AigleProxy:t}=e("aigle-core"),{Aigle:r}=e("./aigle"),{INTERNAL:i,PENDING:s}=e("./internal/util"),{execute:_,setParallel:o}=e("./internal/collection");class a extends t{constructor(e,l,t=o){super(),this._iterator=l,this._promise=new r(i),this._coll=void 0,this._size=void 0,this._rest=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,e===s?(this._set=t,this._iterate=this._callResolve,this._callResolve=_):t.call(this,e)}_execute(){return 0===this._rest?this._promise._resolve(this._result):this._iterate(),this._promise}_callResolve(e){(0==--this._rest||!1===e)&&this._promise._resolve()}_callReject(e){this._promise._reject(e)}}l.exports={each:function(e,l){return new a(e,l)._execute()},Each:a}},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],13:[function(e,l){"use strict";const{AigleProxy:t}=e("aigle-core"),{Aigle:r}=e("./aigle"),{DEFAULT_LIMIT:i,INTERNAL:s,PENDING:_}=e("./internal/util"),{execute:o,setLimit:a}=e("./internal/collection");class c extends t{constructor(e,l,t,c=a){super(),"function"==typeof l&&(t=l,l=i),this._iterator=t,this._promise=new r(s),this._index=0,this._limit=l,this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._result=void 0,this._iterate=void 0,this._callRest=void 0,e===_?(this._set=c,this._iterate=this._callResolve,this._callResolve=o):c.call(this,e)}_execute(){if(0===this._rest)this._promise._resolve(this._result);else for(;this._limit--;)this._iterate();return this._promise}_callResolve(e){!1===e?(this._callRest=0,this._promise._resolve()):0==--this._rest?this._promise._resolve():0{l?e._reject(l):e._resolve(t)}}function r(e,r){function l(i){const o=new s(_),a=t(o);let c=arguments.length;switch(c){case 0:e[r](a);break;case 1:e[r](i,a);break;default:const l=Array(c);for(;c--;)l[c]=arguments[c];l[l.length]=a,e[r].apply(e,l);}return o}return l.__isPromisified__=!0,l}function i(e,r){function l(i){const o=new s(_),a=t(o);let c=arguments.length;switch(c){case 0:e.call(r||this,a);break;case 1:e.call(r||this,i,a);break;default:const l=Array(c);for(;c--;)l[c]=arguments[c];l[l.length]=a,e.apply(r||this,l);}return o}return l.__isPromisified__=!0,l}const{Aigle:s}=e("./aigle"),{INTERNAL:_}=e("./internal/util");l.exports=function(e,l){switch(typeof e){case"object":switch(typeof l){case"string":case"number":return e[l].__isPromisified__?e[l]:r(e,l);default:throw new TypeError("Second argument is invalid");}case"function":if(e.__isPromisified__)return e;const t=l&&l.context!==void 0?l.context:void 0;return i(e,t);default:throw new TypeError("Type of first argument is not function");}}},{"./aigle":2,"./internal/util":37}],53:[function(e,l){"use strict";function t(e){return /^_/.test(e)}function r(e,l,t,r,_,o){const a={};switch(typeof t){case"function":if(_){const l=`${r}${e}`;if(!_[l])_[l]=s(t);else if(!_[l].__isPromisified__)throw new TypeError(`Cannot promisify an API that has normal methods with '${e}'-suffix`)}i(e,l,t,t,o,a),i(e,l,t.prototype,t.prototype,o,a);break;case"object":i(e,l,t,t,o,a),i(e,l,Object.getPrototypeOf(t),t,o,a);}}function i(e,t,i,s,n,u){if(0!=n--&&i&&o!==i&&a!==i&&c!==i&&!Object.isFrozen(i)){const o=Object.getOwnPropertyNames(i);for(let a=o.length;a--;){const l=o[a];if(!0===_[l]||!0===u[l]||t(l))continue;const c=Object.getOwnPropertyDescriptor(i,l);!c||c.set||c.get||(u[l]=!0,r(e,t,i[l],l,s,n))}}}const s=e("./promisify"),_={constructor:!0,arity:!0,length:!0,name:!0,arguments:!0,caller:!0,callee:!0,prototype:!0,__isPromisified__:!0};l.exports=function(e,l){const{suffix:i="Async",filter:s=t,depth:_=2}=l||{};return r(i,s,e,void 0,void 0,_),e};const o=Function.prototype,a=Object.prototype,c=Array.prototype},{"./promisify":52}],54:[function(e,l){"use strict";function t(e){const l=Object.keys(e);return this._rest=l.length,this._coll=e,this._keys=l,this._callResolve=this._execute,r.call(this),this}function r(){return 0===this._rest?this._promise._resolve(this._result):c(this),this._promise}function i(e){return new n(e)._execute()}const{AigleProxy:s}=e("aigle-core"),{Aigle:_}=e("./aigle"),{INTERNAL:o,PENDING:a,promiseObjectEach:c}=e("./internal/util");class n extends s{constructor(e){if(super(),this._promise=new _(o),this._result={},e===a)this._rest=void 0,this._coll=void 0,this._keys=void 0,this._execute=this._callResolve,this._callResolve=t;else{const l=Object.keys(e);this._rest=l.length,this._coll=e,this._keys=l,this._execute=r}}_callResolve(e,l){this._result[l]=e,0==--this._rest&&this._promise._resolve(this._result)}_callReject(e){this._promise._reject(e)}}l.exports={props:i,Props:n},l.exports={props:i,Props:n}},{"./aigle":2,"./internal/util":37,"aigle-core":77}],55:[function(e,l){"use strict";const{Parallel:t}=e("./parallel");class r extends t{constructor(e){super(e),this._result=void 0}_callResolve(e){this._promise._resolve(e)}}l.exports={race:function(e){return new r(e)._execute()},Race:r}},{"./parallel":48}],56:[function(e,l){"use strict";function t(e){return n.call(this,e),void 0===this._keys?(this._iterate=r,this._execute=s):(this._iterate=i,this._execute=_),this}function r(e,l){d(p(this._iterator,l,this._coll[e],e),this,e)}function i(e,l){const t=this._keys[e];d(p(this._iterator,l,this._coll[t],t),this,e)}function s(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._result?this._callResolve(this._coll[0],0):this._iterate(0,this._result),this._promise}function _(){return 0===this._rest?this._promise._resolve(this._result):void 0===this._result?this._callResolve(this._coll[this._keys[0]],0):this._iterate(0,this._result),this._promise}const{AigleProxy:o}=e("aigle-core"),{Aigle:a}=e("./aigle"),{execute:c,setSeries:n}=e("./internal/collection"),{INTERNAL:u,PENDING:m,call3:p,callProxyReciever:d}=e("./internal/util");class v extends o{constructor(e,l,r){super(),this._result=r,this._iterator=l,this._promise=new a(u),this._coll=void 0,this._rest=void 0,this._size=void 0,this._keys=void 0,this._iterate=void 0,e===m?(this._set=t,this._iterate=this._callResolve,this._callResolve=c):t.call(this,e)}_callResolve(e,l){0==--this._rest?this._promise._resolve(e):this._iterate(++l,e)}_callReject(e){this._promise._reject(e)}}l.exports={reduce:function(e,l,t){return new v(e,l,t)._execute()},Reduce:v}},{"./aigle":2,"./internal/collection":35,"./internal/util":37,"aigle-core":77}],57:[function(e,l){"use strict";function t(e){return _.call(this,e),this._result=Array(this._rest),this._callResolve=void 0===this._keys?r:i,this}function r(e,l){this._result[l]=e?o:this._coll[l],0==--this._rest&&this._promise._resolve(a(this._result))}function i(e,l){this._result[l]=e?o:this._coll[this._keys[l]],0==--this._rest&&this._promise._resolve(a(this._result))}const{Each:s}=e("./each"),{setShorthand:_}=e("./internal/collection"),{INTERNAL:o,compactArray:a}=e("./internal/util");class c extends s{constructor(e,l){super(e,l,t)}}l.exports={reject:function(e,l){return new c(e,l)._execute()},Reject:c}},{"./each":12,"./internal/collection":35,"./internal/util":37}],58:[function(e,l){"use strict";function t(e){return _.call(this,e),this._result=Array(this._rest),this._callResolve=void 0===this._keys?r:i,this}function r(e,l){this._result[l]=e?o:this._coll[l],0==--this._rest?this._promise._resolve(a(this._result)):0{l?this._callReject(l):this._callReject(new i("operation timed out"))},e)}_callResolve(e){clearTimeout(this._timer),this._promise._resolve(e)}_callReject(e){clearTimeout(this._timer),this._promise._reject(e)}}},{"./aigle":2,"./error":15,"./internal/util":37,"aigle-core":77}],68:[function(e,l){"use strict";function t(e){e=+e,1<=e?(this._rest=e,this._result=Array(e)):(this._rest=0,this._result=[])}function r(e){this._callResolve=this._rest,t.call(this,e),this._execute()}const{AigleProxy:i}=e("aigle-core"),{Aigle:s}=e("./aigle"),{INTERNAL:_,PENDING:o,defaultIterator:a,call1:c,callProxyReciever:n}=e("./internal/util");class u extends i{constructor(e,l){super(),this._promise=new s(_),this._iterator="function"==typeof l?l:a,this._rest=void 0,this._result=void 0,e===o?(this._rest=this._callResolve,this._callResolve=r):t.call(this,e)}_execute(){if(1<=this._rest){const{_rest:e,_iterator:l}=this;for(let t=-1;++tthis._dispose());case 1:return _(this._handler,this._promise._value);}}}class n extends t{constructor(e,l){super();const t=e.length;this._promise=new r(i),this._rest=t,this._disposed=t,this._array=e,this._error=void 0,this._result=Array(t),this._handler=l;for(let l=-1;++l