mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Bump to v3.10.0.
This commit is contained in:
@@ -24,15 +24,20 @@ import thru from './thru';
|
||||
*/
|
||||
function wrapperReverse() {
|
||||
var value = this.__wrapped__;
|
||||
|
||||
var interceptor = function(value) {
|
||||
return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
|
||||
};
|
||||
if (value instanceof LazyWrapper) {
|
||||
var wrapped = value;
|
||||
if (this.__actions__.length) {
|
||||
value = new LazyWrapper(this);
|
||||
wrapped = new LazyWrapper(this);
|
||||
}
|
||||
return new LodashWrapper(value.reverse(), this.__chain__);
|
||||
wrapped = wrapped.reverse();
|
||||
wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
|
||||
return new LodashWrapper(wrapped, this.__chain__);
|
||||
}
|
||||
return this.thru(function(value) {
|
||||
return value.reverse();
|
||||
});
|
||||
return this.thru(interceptor);
|
||||
}
|
||||
|
||||
export default wrapperReverse;
|
||||
|
||||
Reference in New Issue
Block a user