CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
eachSeries.js44 linesDownload Raw Back to async
1'use strict';2 3Object.defineProperty(exports, "__esModule", {4    value: true5});6 7var _eachLimit = require('./eachLimit.js');8 9var _eachLimit2 = _interopRequireDefault(_eachLimit);10 11var _awaitify = require('./internal/awaitify.js');12 13var _awaitify2 = _interopRequireDefault(_awaitify);14 15function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }16 17/**18 * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.19 *20 * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item21 * in series and therefore the iteratee functions will complete in order.22 23 * @name eachSeries24 * @static25 * @memberOf module:Collections26 * @method27 * @see [async.each]{@link module:Collections.each}28 * @alias forEachSeries29 * @category Collection30 * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.31 * @param {AsyncFunction} iteratee - An async function to apply to each32 * item in `coll`.33 * The array index is not passed to the iteratee.34 * If you need the index, use `eachOfSeries`.35 * Invoked with (item, callback).36 * @param {Function} [callback] - A callback which is called when all37 * `iteratee` functions have finished, or an error occurs. Invoked with (err).38 * @returns {Promise} a promise, if a callback is omitted39 */40function eachSeries(coll, iteratee, callback) {41    return (0, _eachLimit2.default)(coll, 1, iteratee, callback);42}43exports.default = (0, _awaitify2.default)(eachSeries, 3);44module.exports = exports.default;
basant307/AI_Governance_Project · CoolFace