source: node_modules/ramda/src/internal/_xany.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: 838 bytes
Line 
1var _reduced =
2/*#__PURE__*/
3require("./_reduced.js");
4
5var _xfBase =
6/*#__PURE__*/
7require("./_xfBase.js");
8
9var XAny =
10/*#__PURE__*/
11function () {
12 function XAny(f, xf) {
13 this.xf = xf;
14 this.f = f;
15 this.any = false;
16 }
17
18 XAny.prototype['@@transducer/init'] = _xfBase.init;
19
20 XAny.prototype['@@transducer/result'] = function (result) {
21 if (!this.any) {
22 result = this.xf['@@transducer/step'](result, false);
23 }
24
25 return this.xf['@@transducer/result'](result);
26 };
27
28 XAny.prototype['@@transducer/step'] = function (result, input) {
29 if (this.f(input)) {
30 this.any = true;
31 result = _reduced(this.xf['@@transducer/step'](result, true));
32 }
33
34 return result;
35 };
36
37 return XAny;
38}();
39
40function _xany(f) {
41 return function (xf) {
42 return new XAny(f, xf);
43 };
44}
45
46module.exports = _xany;
Note: See TracBrowser for help on using the repository browser.