source: trip-planner-front/node_modules/async/map.js@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.0 KB
Line 
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _doParallel = require('./internal/doParallel');
8
9var _doParallel2 = _interopRequireDefault(_doParallel);
10
11var _map = require('./internal/map');
12
13var _map2 = _interopRequireDefault(_map);
14
15function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
17/**
18 * Produces a new collection of values by mapping each value in `coll` through
19 * the `iteratee` function. The `iteratee` is called with an item from `coll`
20 * and a callback for when it has finished processing. Each of these callback
21 * takes 2 arguments: an `error`, and the transformed item from `coll`. If
22 * `iteratee` passes an error to its callback, the main `callback` (for the
23 * `map` function) is immediately called with the error.
24 *
25 * Note, that since this function applies the `iteratee` to each item in
26 * parallel, there is no guarantee that the `iteratee` functions will complete
27 * in order. However, the results array will be in the same order as the
28 * original `coll`.
29 *
30 * If `map` is passed an Object, the results will be an Array. The results
31 * will roughly be in the order of the original Objects' keys (but this can
32 * vary across JavaScript engines).
33 *
34 * @name map
35 * @static
36 * @memberOf module:Collections
37 * @method
38 * @category Collection
39 * @param {Array|Iterable|Object} coll - A collection to iterate over.
40 * @param {AsyncFunction} iteratee - An async function to apply to each item in
41 * `coll`.
42 * The iteratee should complete with the transformed item.
43 * Invoked with (item, callback).
44 * @param {Function} [callback] - A callback which is called when all `iteratee`
45 * functions have finished, or an error occurs. Results is an Array of the
46 * transformed items from the `coll`. Invoked with (err, results).
47 * @example
48 *
49 * async.map(['file1','file2','file3'], fs.stat, function(err, results) {
50 * // results is now an array of stats for each file
51 * });
52 */
53exports.default = (0, _doParallel2.default)(_map2.default);
54module.exports = exports['default'];
Note: See TracBrowser for help on using the repository browser.