source: node_modules/ramda/src/internal/_xall.js

main
Last change on this file 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 XAll =
10/*#__PURE__*/
11function () {
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
40function _xall(f) {
41 return function (xf) {
42 return new XAll(f, xf);
43 };
44}
45
46module.exports = _xall;
Note: See TracBrowser for help on using the repository browser.