reject.js 698 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = reject;
  6. var _filter = require('./filter.js');
  7. var _filter2 = _interopRequireDefault(_filter);
  8. var _wrapAsync = require('./wrapAsync.js');
  9. var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
  10. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11. function reject(eachfn, arr, _iteratee, callback) {
  12. const iteratee = (0, _wrapAsync2.default)(_iteratee);
  13. return (0, _filter2.default)(eachfn, arr, (value, cb) => {
  14. iteratee(value, (err, v) => {
  15. cb(err, !v);
  16. });
  17. }, callback);
  18. }
  19. module.exports = exports['default'];