Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mapSeries.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _map2 = require('./internal/map');
  6. var _map3 = _interopRequireDefault(_map2);
  7. var _eachOfSeries = require('./eachOfSeries');
  8. var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);
  9. var _awaitify = require('./internal/awaitify');
  10. var _awaitify2 = _interopRequireDefault(_awaitify);
  11. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12. /**
  13. * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.
  14. *
  15. * @name mapSeries
  16. * @static
  17. * @memberOf module:Collections
  18. * @method
  19. * @see [async.map]{@link module:Collections.map}
  20. * @category Collection
  21. * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
  22. * @param {AsyncFunction} iteratee - An async function to apply to each item in
  23. * `coll`.
  24. * The iteratee should complete with the transformed item.
  25. * Invoked with (item, callback).
  26. * @param {Function} [callback] - A callback which is called when all `iteratee`
  27. * functions have finished, or an error occurs. Results is an array of the
  28. * transformed items from the `coll`. Invoked with (err, results).
  29. * @returns {Promise} a promise, if no callback is passed
  30. */
  31. function mapSeries(coll, iteratee, callback) {
  32. return (0, _map3.default)(_eachOfSeries2.default, coll, iteratee, callback);
  33. }
  34. exports.default = (0, _awaitify2.default)(mapSeries, 3);
  35. module.exports = exports['default'];