Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterable docs #1236

Merged
merged 2 commits into from
Jul 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/applyEach.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import map from './map';
* @memberOf module:ControlFlow
* @method
* @category Control Flow
* @param {Array|Object} fns - A collection of asynchronous functions to all
* @param {Array|Iterable|Object} fns - A collection of asynchronous functions to all
* call with the same arguments
* @param {...*} [args] - any number of separate arguments to pass to the
* function.
Expand Down
2 changes: 1 addition & 1 deletion lib/applyEachSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import mapSeries from './mapSeries';
* @method
* @see [async.applyEach]{@link module:ControlFlow.applyEach}
* @category Control Flow
* @param {Array|Object} fns - A collection of asynchronous functions to all
* @param {Array|Iterable|Object} fns - A collection of asynchronous functions to all
* call with the same arguments
* @param {...*} [args] - any number of separate arguments to pass to the
* function.
Expand Down
2 changes: 1 addition & 1 deletion lib/concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import doParallel from './internal/doParallel';
* @memberOf module:Collections
* @method
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A function to apply to each item in `coll`.
* The iteratee is passed a `callback(err, results)` which must be called once
* it has completed with an error (which can be `null`) and an array of results.
Expand Down
2 changes: 1 addition & 1 deletion lib/concatSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import doSeries from './internal/doSeries';
* @method
* @see [async.concat]{@link module:Collections.concat}
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A function to apply to each item in `coll`.
* The iteratee is passed a `callback(err, results)` which must be called once
* it has completed with an error (which can be `null`) and an array of results.
Expand Down
2 changes: 1 addition & 1 deletion lib/detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import findGetResult from './internal/findGetResult';
* @method
* @alias find
* @category Collections
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in `coll`.
* The iteratee is passed a `callback(err, truthValue)` which must be called
* with a boolean argument once it has completed. Invoked with (item, callback).
Expand Down
2 changes: 1 addition & 1 deletion lib/detectLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import findGetResult from './internal/findGetResult';
* @see [async.detect]{@link module:Collections.detect}
* @alias findLimit
* @category Collections
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {Function} iteratee - A truth test to apply to each item in `coll`.
* The iteratee is passed a `callback(err, truthValue)` which must be called
Expand Down
2 changes: 1 addition & 1 deletion lib/detectSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import findGetResult from './internal/findGetResult';
* @see [async.detect]{@link module:Collections.detect}
* @alias findSeries
* @category Collections
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in `coll`.
* The iteratee is passed a `callback(err, truthValue)` which must be called
* with a boolean argument once it has completed. Invoked with (item, callback).
Expand Down
2 changes: 1 addition & 1 deletion lib/each.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import doLimit from './internal/doLimit';
* @method
* @alias forEach
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A function to apply to each item
* in `coll`. The iteratee is passed a `callback(err)` which must be called once
* it has completed. If no error has occurred, the `callback` should be run
Expand Down
2 changes: 1 addition & 1 deletion lib/eachLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import withoutIndex from './internal/withoutIndex';
* @see [async.each]{@link module:Collections.each}
* @alias forEachLimit
* @category Collection
* @param {Array|Object} coll - A colleciton to iterate over.
* @param {Array|Iterable|Object} coll - A colleciton to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {Function} iteratee - A function to apply to each item in `coll`. The
* iteratee is passed a `callback(err)` which must be called once it has
Expand Down
2 changes: 1 addition & 1 deletion lib/eachOf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import doLimit from './internal/doLimit';
* @alias forEachOf
* @category Collection
* @see [async.each]{@link module:Collections.each}
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A function to apply to each
* item in `coll`. The `key` is the item's key, or index in the case of an
* array. The iteratee is passed a `callback(err)` which must be called once it
Expand Down
2 changes: 1 addition & 1 deletion lib/eachOfLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import _eachOfLimit from './internal/eachOfLimit';
* @see [async.eachOf]{@link module:Collections.eachOf}
* @alias forEachOfLimit
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {Function} iteratee - A function to apply to each
* item in `coll`. The `key` is the item's key, or index in the case of an
Expand Down
2 changes: 1 addition & 1 deletion lib/eachOfSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import doLimit from './internal/doLimit';
* @see [async.eachOf]{@link module:Collections.eachOf}
* @alias forEachOfSeries
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A function to apply to each item in `coll`. The
* `key` is the item's key, or index in the case of an array. The iteratee is
* passed a `callback(err)` which must be called once it has completed. If no
Expand Down
2 changes: 1 addition & 1 deletion lib/eachSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import doLimit from './internal/doLimit';
* @see [async.each]{@link module:Collections.each}
* @alias forEachSeries
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A function to apply to each
* item in `coll`. The iteratee is passed a `callback(err)` which must be called
* once it has completed. If no error has occurred, the `callback` should be run
Expand Down
2 changes: 1 addition & 1 deletion lib/every.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import doLimit from './internal/doLimit';
* @method
* @alias all
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in the
* collection in parallel. The iteratee is passed a `callback(err, truthValue)`
* which must be called with a boolean argument once it has completed. Invoked
Expand Down
2 changes: 1 addition & 1 deletion lib/everyLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import notId from './internal/notId';
* @see [async.every]{@link module:Collections.every}
* @alias allLimit
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {Function} iteratee - A truth test to apply to each item in the
* collection in parallel. The iteratee is passed a `callback(err, truthValue)`
Expand Down
2 changes: 1 addition & 1 deletion lib/everySeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import doLimit from './internal/doLimit';
* @see [async.every]{@link module:Collections.every}
* @alias allSeries
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in the
* collection in parallel. The iteratee is passed a `callback(err, truthValue)`
* which must be called with a boolean argument once it has completed. Invoked
Expand Down
2 changes: 1 addition & 1 deletion lib/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import doLimit from './internal/doLimit';
* @method
* @alias select
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in `coll`.
* The `iteratee` is passed a `callback(err, truthValue)`, which must be called
* with a boolean argument once it has completed. Invoked with (item, callback).
Expand Down
2 changes: 1 addition & 1 deletion lib/filterLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import doParallelLimit from './internal/doParallelLimit';
* @see [async.filter]{@link module:Collections.filter}
* @alias selectLimit
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {Function} iteratee - A truth test to apply to each item in `coll`.
* The `iteratee` is passed a `callback(err, truthValue)`, which must be called
Expand Down
2 changes: 1 addition & 1 deletion lib/filterSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import doLimit from './internal/doLimit';
* @see [async.filter]{@link module:Collections.filter}
* @alias selectSeries
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in `coll`.
* The `iteratee` is passed a `callback(err, truthValue)`, which must be called
* with a boolean argument once it has completed. Invoked with (item, callback).
Expand Down
2 changes: 1 addition & 1 deletion lib/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import doLimit from './internal/doLimit';
* @memberOf module:Collections
* @method
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A function to apply to each item in `coll`.
* The iteratee is passed a `callback(err, transformed)` which must be called
* once it has completed with an error (which can be `null`) and a
Expand Down
2 changes: 1 addition & 1 deletion lib/mapLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import map from './internal/map';
* @method
* @see [async.map]{@link module:Collections.map}
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {Function} iteratee - A function to apply to each item in `coll`.
* The iteratee is passed a `callback(err, transformed)` which must be called
Expand Down
2 changes: 1 addition & 1 deletion lib/mapSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import doLimit from './internal/doLimit';
* @method
* @see [async.map]{@link module:Collections.map}
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A function to apply to each item in `coll`.
* The iteratee is passed a `callback(err, transformed)` which must be called
* once it has completed with an error (which can be `null`) and a
Expand Down
2 changes: 1 addition & 1 deletion lib/parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import doLimit from './internal/doLimit';
* @memberOf module:ControlFlow
* @method
* @category Control Flow
* @param {Array|Object} tasks - A collection containing functions to run.
* @param {Array|Iterable|Object} tasks - A collection containing functions to run.
* Each function is passed a `callback(err, result)` which it must call on
* completion with an error `err` (which can be `null`) and an optional `result`
* value.
Expand Down
2 changes: 1 addition & 1 deletion lib/reduce.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import once from './internal/once';
* @alias inject
* @alias foldl
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {*} memo - The initial state of the reduction.
* @param {Function} iteratee - A function applied to each item in the
* array to produce the next step in the reduction. The `iteratee` is passed a
Expand Down
8 changes: 4 additions & 4 deletions lib/reduceRight.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import reduce from './reduce';
var slice = Array.prototype.slice;

/**
* Same as [`reduce`]{@link module:Collections.reduce}, only operates on `coll` in reverse order.
* Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.
*
* @name reduceRight
* @static
Expand All @@ -12,7 +12,7 @@ var slice = Array.prototype.slice;
* @see [async.reduce]{@link module:Collections.reduce}
* @alias foldr
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array} array - A collection to iterate over.
* @param {*} memo - The initial state of the reduction.
* @param {Function} iteratee - A function applied to each item in the
* array to produce the next step in the reduction. The `iteratee` is passed a
Expand All @@ -24,7 +24,7 @@ var slice = Array.prototype.slice;
* `iteratee` functions have finished. Result is the reduced value. Invoked with
* (err, result).
*/
export default function reduceRight (coll, memo, iteratee, callback) {
var reversed = slice.call(coll).reverse();
export default function reduceRight (array, memo, iteratee, callback) {
var reversed = slice.call(array).reverse();
reduce(reversed, memo, iteratee, callback);
}
2 changes: 1 addition & 1 deletion lib/reject.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import doLimit from './internal/doLimit';
* @method
* @see [async.filter]{@link module:Collections.filter}
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in `coll`.
* The `iteratee` is passed a `callback(err, truthValue)`, which must be called
* with a boolean argument once it has completed. Invoked with (item, callback).
Expand Down
2 changes: 1 addition & 1 deletion lib/rejectLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import doParallelLimit from './internal/doParallelLimit';
* @method
* @see [async.reject]{@link module:Collections.reject}
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {Function} iteratee - A truth test to apply to each item in `coll`.
* The `iteratee` is passed a `callback(err, truthValue)`, which must be called
Expand Down
2 changes: 1 addition & 1 deletion lib/rejectSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import doLimit from './internal/doLimit';
* @method
* @see [async.reject]{@link module:Collections.reject}
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in `coll`.
* The `iteratee` is passed a `callback(err, truthValue)`, which must be called
* with a boolean argument once it has completed. Invoked with (item, callback).
Expand Down
2 changes: 1 addition & 1 deletion lib/series.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import eachOfSeries from './eachOfSeries';
* @memberOf module:ControlFlow
* @method
* @category Control Flow
* @param {Array|Object} tasks - A collection containing functions to run, each
* @param {Array|Iterable|Object} tasks - A collection containing functions to run, each
* function is passed a `callback(err, result)` it must call on completion with
* an error `err` (which can be `null`) and an optional `result` value.
* @param {Function} [callback] - An optional callback to run once all the
Expand Down
2 changes: 1 addition & 1 deletion lib/some.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import doLimit from './internal/doLimit';
* @method
* @alias any
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in the array
* in parallel. The iteratee is passed a `callback(err, truthValue)` which must
* be called with a boolean argument once it has completed. Invoked with
Expand Down
2 changes: 1 addition & 1 deletion lib/someLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import identity from 'lodash/identity';
* @see [async.some]{@link module:Collections.some}
* @alias anyLimit
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {Function} iteratee - A truth test to apply to each item in the array
* in parallel. The iteratee is passed a `callback(err, truthValue)` which must
Expand Down
2 changes: 1 addition & 1 deletion lib/someSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import doLimit from './internal/doLimit';
* @see [async.some]{@link module:Collections.some}
* @alias anySeries
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A truth test to apply to each item in the array
* in parallel. The iteratee is passed a `callback(err, truthValue)` which must
* be called with a boolean argument once it has completed. Invoked with
Expand Down
2 changes: 1 addition & 1 deletion lib/sortBy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import map from './map';
* @memberOf module:Collections
* @method
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {Function} iteratee - A function to apply to each item in `coll`.
* The iteratee is passed a `callback(err, sortValue)` which must be called once
* it has completed with an error (which can be `null`) and a value to use as
Expand Down
2 changes: 1 addition & 1 deletion lib/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import once from './internal/once';
* @memberOf module:Collections
* @method
* @category Collection
* @param {Array|Object} coll - A collection to iterate over.
* @param {Array|Iterable|Object} coll - A collection to iterate over.
* @param {*} [accumulator] - The initial state of the transform. If omitted,
* it will default to an empty Object or Array, depending on the type of `coll`
* @param {Function} iteratee - A function applied to each item in the
Expand Down