applyEach.js 786 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = function (eachfn) {
  6. return function applyEach(fns, ...callArgs) {
  7. const go = (0, _awaitify2.default)(function (callback) {
  8. var that = this;
  9. return eachfn(fns, (fn, cb) => {
  10. (0, _wrapAsync2.default)(fn).apply(that, callArgs.concat(cb));
  11. }, callback);
  12. });
  13. return go;
  14. };
  15. };
  16. var _wrapAsync = require('./wrapAsync.js');
  17. var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
  18. var _awaitify = require('./awaitify.js');
  19. var _awaitify2 = _interopRequireDefault(_awaitify);
  20. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  21. module.exports = exports['default'];