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.

some.js 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _createTester = require('./internal/createTester');
  6. var _createTester2 = _interopRequireDefault(_createTester);
  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 `true` if at least one element in the `coll` satisfies an async test.
  14. * If any iteratee call returns `true`, the main `callback` is immediately
  15. * called.
  16. *
  17. * @name some
  18. * @static
  19. * @memberOf module:Collections
  20. * @method
  21. * @alias any
  22. * @category Collection
  23. * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
  24. * @param {AsyncFunction} iteratee - An async truth test to apply to each item
  25. * in the collections in parallel.
  26. * The iteratee should complete with a boolean `result` value.
  27. * Invoked with (item, callback).
  28. * @param {Function} [callback] - A callback which is called as soon as any
  29. * iteratee returns `true`, or after all the iteratee functions have finished.
  30. * Result will be either `true` or `false` depending on the values of the async
  31. * tests. Invoked with (err, result).
  32. * @returns {Promise} a promise, if no callback provided
  33. * @example
  34. *
  35. * async.some(['file1','file2','file3'], function(filePath, callback) {
  36. * fs.access(filePath, function(err) {
  37. * callback(null, !err)
  38. * });
  39. * }, function(err, result) {
  40. * // if result is true then at least one of the files exists
  41. * });
  42. */
  43. function some(coll, iteratee, callback) {
  44. return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback);
  45. }
  46. exports.default = (0, _awaitify2.default)(some, 3);
  47. module.exports = exports['default'];