_xdropWhile.js 650 B

123456789101112131415161718192021222324252627282930313233
  1. import _xfBase from "./_xfBase.js";
  2. var XDropWhile =
  3. /*#__PURE__*/
  4. function () {
  5. function XDropWhile(f, xf) {
  6. this.xf = xf;
  7. this.f = f;
  8. }
  9. XDropWhile.prototype['@@transducer/init'] = _xfBase.init;
  10. XDropWhile.prototype['@@transducer/result'] = _xfBase.result;
  11. XDropWhile.prototype['@@transducer/step'] = function (result, input) {
  12. if (this.f) {
  13. if (this.f(input)) {
  14. return result;
  15. }
  16. this.f = null;
  17. }
  18. return this.xf['@@transducer/step'](result, input);
  19. };
  20. return XDropWhile;
  21. }();
  22. export default function _xdropWhile(f) {
  23. return function (xf) {
  24. return new XDropWhile(f, xf);
  25. };
  26. }