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.

select.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 _eachOf = require('./eachOf');
  8. var _eachOf2 = _interopRequireDefault(_eachOf);
  9. var _awaitify = require('./internal/awaitify');
  10. var _awaitify2 = _interopRequireDefault(_awaitify);
  11. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12. /**
  13. * Returns a new array of all the values in `coll` which pass an async truth
  14. * test. This operation is performed in parallel, but the results array will be
  15. * in the same order as the original.
  16. *
  17. * @name filter
  18. * @static
  19. * @memberOf module:Collections
  20. * @method
  21. * @alias select
  22. * @category Collection
  23. * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
  24. * @param {Function} iteratee - A truth test to apply to each item in `coll`.
  25. * The `iteratee` is passed a `callback(err, truthValue)`, which must be called
  26. * with a boolean argument once it has completed. Invoked with (item, callback).
  27. * @param {Function} [callback] - A callback which is called after all the
  28. * `iteratee` functions have finished. Invoked with (err, results).
  29. * @returns {Promise} a promise, if no callback provided
  30. * @example
  31. *
  32. * async.filter(['file1','file2','file3'], function(filePath, callback) {
  33. * fs.access(filePath, function(err) {
  34. * callback(null, !err)
  35. * });
  36. * }, function(err, results) {
  37. * // results now equals an array of the existing files
  38. * });
  39. */
  40. function filter(coll, iteratee, callback) {
  41. return (0, _filter3.default)(_eachOf2.default, coll, iteratee, callback);
  42. }
  43. exports.default = (0, _awaitify2.default)(filter, 3);
  44. module.exports = exports['default'];