1 var LazyWrapper = require('./_LazyWrapper'),
2 LodashWrapper = require('./_LodashWrapper'),
3 reverse = require('./reverse'),
4 thru = require('./thru');
7 * This method is the wrapper version of `_.reverse`.
9 * **Note:** This method mutates the wrapped array.
14 * @returns {Object} Returns the new `lodash` wrapper instance.
17 * var array = [1, 2, 3];
19 * _(array).reverse().value()
25 function wrapperReverse() {
26 var value = this.__wrapped__;
27 if (value instanceof LazyWrapper) {
29 if (this.__actions__.length) {
30 wrapped = new LazyWrapper(this);
32 wrapped = wrapped.reverse();
33 wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined });
34 return new LodashWrapper(wrapped, this.__chain__);
36 return this.thru(reverse);
39 module.exports = wrapperReverse;