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