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.
15 * @returns {Object} Returns the new `lodash` wrapper instance.
18 * var array = [1, 2, 3];
20 * _(array).reverse().value()
26 function wrapperReverse() {
27 var value = this.__wrapped__;
28 if (value instanceof LazyWrapper) {
30 if (this.__actions__.length) {
31 wrapped = new LazyWrapper(this);
33 wrapped = wrapped.reverse();
34 wrapped.__actions__.push({
39 return new LodashWrapper(wrapped, this.__chain__);
41 return this.thru(reverse);
44 module.exports = wrapperReverse;