basant307/AI_Governance_Project
048
1'use strict';2 3Object.defineProperty(exports, "__esModule", {4 value: true5});6exports.default = groupBySeries;7 8var _groupByLimit = require('./groupByLimit.js');9 10var _groupByLimit2 = _interopRequireDefault(_groupByLimit);11 12function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }13 14/**15 * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.16 *17 * @name groupBySeries18 * @static19 * @memberOf module:Collections20 * @method21 * @see [async.groupBy]{@link module:Collections.groupBy}22 * @category Collection23 * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.24 * @param {AsyncFunction} iteratee - An async function to apply to each item in25 * `coll`.26 * The iteratee should complete with a `key` to group the value under.27 * Invoked with (value, callback).28 * @param {Function} [callback] - A callback which is called when all `iteratee`29 * functions have finished, or an error occurs. Result is an `Object` whose30 * properties are arrays of values which returned the corresponding key.31 * @returns {Promise} a promise, if no callback is passed32 */33function groupBySeries(coll, iteratee, callback) {34 return (0, _groupByLimit2.default)(coll, 1, iteratee, callback);35}36module.exports = exports.default;