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.

filterLimit.js 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _filter2 = require('./internal/filter');
  6. var _filter3 = _interopRequireDefault(_filter2);
  7. var _eachOfLimit = require('./internal/eachOfLimit');
  8. var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);
  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 [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a
  14. * time.
  15. *
  16. * @name filterLimit
  17. * @static
  18. * @memberOf module:Collections
  19. * @method
  20. * @see [async.filter]{@link module:Collections.filter}
  21. * @alias selectLimit
  22. * @category Collection
  23. * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
  24. * @param {number} limit - The maximum number of async operations at a time.
  25. * @param {Function} iteratee - A truth test to apply to each item in `coll`.
  26. * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
  27. * with a boolean argument once it has completed. Invoked with (item, callback).
  28. * @param {Function} [callback] - A callback which is called after all the
  29. * `iteratee` functions have finished. Invoked with (err, results).
  30. * @returns {Promise} a promise, if no callback provided
  31. */
  32. function filterLimit(coll, limit, iteratee, callback) {
  33. return (0, _filter3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback);
  34. }
  35. exports.default = (0, _awaitify2.default)(filterLimit, 4);
  36. module.exports = exports['default'];