mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Ensure reverse returns a LodashWrapper instance when chaining.
This commit is contained in:
@@ -4982,12 +4982,10 @@
|
||||
* // => [3, 2, 1]
|
||||
*/
|
||||
function wrapperReverse() {
|
||||
var wrapped = this.__wrapped__;
|
||||
|
||||
if(wrapped instanceof LazyWrapper) {
|
||||
return wrapped.reverse();
|
||||
var value = this.__wrapped__;
|
||||
if (value instanceof LazyWrapper) {
|
||||
return new LodashWrapper(value.reverse());
|
||||
}
|
||||
|
||||
return this.thru(function(value) {
|
||||
return value.reverse();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user