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.

flatMap.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _concatLimit = require('./concatLimit');
  6. var _concatLimit2 = _interopRequireDefault(_concatLimit);
  7. var _awaitify = require('./internal/awaitify');
  8. var _awaitify2 = _interopRequireDefault(_awaitify);
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. /**
  11. * Applies `iteratee` to each item in `coll`, concatenating the results. Returns
  12. * the concatenated list. The `iteratee`s are called in parallel, and the
  13. * results are concatenated as they return. The results array will be returned in
  14. * the original order of `coll` passed to the `iteratee` function.
  15. *
  16. * @name concat
  17. * @static
  18. * @memberOf module:Collections
  19. * @method
  20. * @category Collection
  21. * @alias flatMap
  22. * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
  23. * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,
  24. * which should use an array as its result. Invoked with (item, callback).
  25. * @param {Function} [callback] - A callback which is called after all the
  26. * `iteratee` functions have finished, or an error occurs. Results is an array
  27. * containing the concatenated results of the `iteratee` function. Invoked with
  28. * (err, results).
  29. * @returns A Promise, if no callback is passed
  30. * @example
  31. *
  32. * async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) {
  33. * // files is now a list of filenames that exist in the 3 directories
  34. * });
  35. */
  36. function concat(coll, iteratee, callback) {
  37. return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback);
  38. }
  39. exports.default = (0, _awaitify2.default)(concat, 3);
  40. module.exports = exports['default'];