main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
602 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | var _xfBase =
|
---|
| 2 | /*#__PURE__*/
|
---|
| 3 | require("./_xfBase.js");
|
---|
| 4 |
|
---|
| 5 | var XDrop =
|
---|
| 6 | /*#__PURE__*/
|
---|
| 7 | function () {
|
---|
| 8 | function XDrop(n, xf) {
|
---|
| 9 | this.xf = xf;
|
---|
| 10 | this.n = n;
|
---|
| 11 | }
|
---|
| 12 |
|
---|
| 13 | XDrop.prototype['@@transducer/init'] = _xfBase.init;
|
---|
| 14 | XDrop.prototype['@@transducer/result'] = _xfBase.result;
|
---|
| 15 |
|
---|
| 16 | XDrop.prototype['@@transducer/step'] = function (result, input) {
|
---|
| 17 | if (this.n > 0) {
|
---|
| 18 | this.n -= 1;
|
---|
| 19 | return result;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | return this.xf['@@transducer/step'](result, input);
|
---|
| 23 | };
|
---|
| 24 |
|
---|
| 25 | return XDrop;
|
---|
| 26 | }();
|
---|
| 27 |
|
---|
| 28 | function _xdrop(n) {
|
---|
| 29 | return function (xf) {
|
---|
| 30 | return new XDrop(n, xf);
|
---|
| 31 | };
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | module.exports = _xdrop; |
---|
Note:
See
TracBrowser
for help on using the repository browser.