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:
574 bytes
|
Line | |
---|
1 | import _xfBase from "./_xfBase.js";
|
---|
2 |
|
---|
3 | var XDrop =
|
---|
4 | /*#__PURE__*/
|
---|
5 | function () {
|
---|
6 | function XDrop(n, xf) {
|
---|
7 | this.xf = xf;
|
---|
8 | this.n = n;
|
---|
9 | }
|
---|
10 |
|
---|
11 | XDrop.prototype['@@transducer/init'] = _xfBase.init;
|
---|
12 | XDrop.prototype['@@transducer/result'] = _xfBase.result;
|
---|
13 |
|
---|
14 | XDrop.prototype['@@transducer/step'] = function (result, input) {
|
---|
15 | if (this.n > 0) {
|
---|
16 | this.n -= 1;
|
---|
17 | return result;
|
---|
18 | }
|
---|
19 |
|
---|
20 | return this.xf['@@transducer/step'](result, input);
|
---|
21 | };
|
---|
22 |
|
---|
23 | return XDrop;
|
---|
24 | }();
|
---|
25 |
|
---|
26 | export default function _xdrop(n) {
|
---|
27 | return function (xf) {
|
---|
28 | return new XDrop(n, xf);
|
---|
29 | };
|
---|
30 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.