source: node_modules/ramda/es/internal/_flatCat.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: 1.2 KB
Line 
1import _forceReduced from "./_forceReduced.js";
2import _isArrayLike from "./_isArrayLike.js";
3import _xArrayReduce from "./_xArrayReduce.js";
4import _xReduce from "./_xReduce.js";
5import _xfBase from "./_xfBase.js";
6var tInit = '@@transducer/init';
7var tStep = '@@transducer/step';
8var tResult = '@@transducer/result';
9
10var XPreservingReduced =
11/*#__PURE__*/
12function () {
13 function XPreservingReduced(xf) {
14 this.xf = xf;
15 }
16
17 XPreservingReduced.prototype[tInit] = _xfBase.init;
18 XPreservingReduced.prototype[tResult] = _xfBase.result;
19
20 XPreservingReduced.prototype[tStep] = function (result, input) {
21 var ret = this.xf[tStep](result, input);
22 return ret['@@transducer/reduced'] ? _forceReduced(ret) : ret;
23 };
24
25 return XPreservingReduced;
26}();
27
28var XFlatCat =
29/*#__PURE__*/
30function () {
31 function XFlatCat(xf) {
32 this.xf = new XPreservingReduced(xf);
33 }
34
35 XFlatCat.prototype[tInit] = _xfBase.init;
36 XFlatCat.prototype[tResult] = _xfBase.result;
37
38 XFlatCat.prototype[tStep] = function (result, input) {
39 return !_isArrayLike(input) ? _xArrayReduce(this.xf, result, [input]) : _xReduce(this.xf, result, input);
40 };
41
42 return XFlatCat;
43}();
44
45var _flatCat = function _xcat(xf) {
46 return new XFlatCat(xf);
47};
48
49export default _flatCat;
Note: See TracBrowser for help on using the repository browser.