1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- var LazyWrapper = require('./_LazyWrapper'),
- LodashWrapper = require('./_LodashWrapper'),
- reverse = require('./reverse'),
- thru = require('./thru');
- function wrapperReverse() {
- var value = this.__wrapped__;
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({
- 'func': thru,
- 'args': [reverse],
- 'thisArg': undefined
- });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(reverse);
- }
- module.exports = wrapperReverse;
|