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:
691 bytes
|
Line | |
---|
1 | var _xfBase =
|
---|
2 | /*#__PURE__*/
|
---|
3 | require("./_xfBase.js");
|
---|
4 |
|
---|
5 | var XFindLast =
|
---|
6 | /*#__PURE__*/
|
---|
7 | function () {
|
---|
8 | function XFindLast(f, xf) {
|
---|
9 | this.xf = xf;
|
---|
10 | this.f = f;
|
---|
11 | }
|
---|
12 |
|
---|
13 | XFindLast.prototype['@@transducer/init'] = _xfBase.init;
|
---|
14 |
|
---|
15 | XFindLast.prototype['@@transducer/result'] = function (result) {
|
---|
16 | return this.xf['@@transducer/result'](this.xf['@@transducer/step'](result, this.last));
|
---|
17 | };
|
---|
18 |
|
---|
19 | XFindLast.prototype['@@transducer/step'] = function (result, input) {
|
---|
20 | if (this.f(input)) {
|
---|
21 | this.last = input;
|
---|
22 | }
|
---|
23 |
|
---|
24 | return result;
|
---|
25 | };
|
---|
26 |
|
---|
27 | return XFindLast;
|
---|
28 | }();
|
---|
29 |
|
---|
30 | function _xfindLast(f) {
|
---|
31 | return function (xf) {
|
---|
32 | return new XFindLast(f, xf);
|
---|
33 | };
|
---|
34 | }
|
---|
35 |
|
---|
36 | module.exports = _xfindLast; |
---|
Note:
See
TracBrowser
for help on using the repository browser.