source: node_modules/ramda/src/internal/_xfindLast.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 691 bytes
RevLine 
[d24f17c]1var _xfBase =
2/*#__PURE__*/
3require("./_xfBase.js");
4
5var XFindLast =
6/*#__PURE__*/
7function () {
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
30function _xfindLast(f) {
31 return function (xf) {
32 return new XFindLast(f, xf);
33 };
34}
35
36module.exports = _xfindLast;
Note: See TracBrowser for help on using the repository browser.