1 | var _curry2 =
|
2 |
|
3 | require("./_curry2");
|
4 |
|
5 | var _reduced =
|
6 |
|
7 | require("./_reduced");
|
8 |
|
9 | var _xfBase =
|
10 |
|
11 | require("./_xfBase");
|
12 |
|
13 | var XAny =
|
14 |
|
15 | function () {
|
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 |
|
44 | var _xany =
|
45 |
|
46 | _curry2(function _xany(f, xf) {
|
47 | return new XAny(f, xf);
|
48 | });
|
49 |
|
50 | module.exports = _xany; |
\ | No newline at end of file |