UNPKG

891 BJavaScriptView Raw
1var _curry2 =
2/*#__PURE__*/
3require("./_curry2");
4
5var _reduced =
6/*#__PURE__*/
7require("./_reduced");
8
9var _xfBase =
10/*#__PURE__*/
11require("./_xfBase");
12
13var XAny =
14/*#__PURE__*/
15function () {
16 function XAny(f, xf) {
17 this.xf = xf;
18 this.f = f;
19 this.any = false;
20 }
21
22 XAny.prototype['@@transducer/init'] = _xfBase.init;
23
24 XAny.prototype['@@transducer/result'] = function (result) {
25 if (!this.any) {
26 result = this.xf['@@transducer/step'](result, false);
27 }
28
29 return this.xf['@@transducer/result'](result);
30 };
31
32 XAny.prototype['@@transducer/step'] = function (result, input) {
33 if (this.f(input)) {
34 this.any = true;
35 result = _reduced(this.xf['@@transducer/step'](result, true));
36 }
37
38 return result;
39 };
40
41 return XAny;
42}();
43
44var _xany =
45/*#__PURE__*/
46_curry2(function _xany(f, xf) {
47 return new XAny(f, xf);
48});
49
50module.exports = _xany;
\No newline at end of file