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