_xdrop.js 574 B

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