1 | var LazyWrapper = require('./_LazyWrapper'),
|
2 | LodashWrapper = require('./_LodashWrapper'),
|
3 | reverse = require('./reverse'),
|
4 | thru = require('./thru');
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | function wrapperReverse() {
|
27 | var value = this.__wrapped__;
|
28 | if (value instanceof LazyWrapper) {
|
29 | var wrapped = value;
|
30 | if (this.__actions__.length) {
|
31 | wrapped = new LazyWrapper(this);
|
32 | }
|
33 | wrapped = wrapped.reverse();
|
34 | wrapped.__actions__.push({
|
35 | 'func': thru,
|
36 | 'args': [reverse],
|
37 | 'thisArg': undefined
|
38 | });
|
39 | return new LodashWrapper(wrapped, this.__chain__);
|
40 | }
|
41 | return this.thru(reverse);
|
42 | }
|
43 |
|
44 | module.exports = wrapperReverse;
|