mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Cleanup join, pop, shift chaining setup code.
This commit is contained in:
12
lodash.js
12
lodash.js
@@ -9631,13 +9631,13 @@
|
||||
arrayEach(['join', 'pop', 'shift'], function(methodName) {
|
||||
var func = arrayProto[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
var chainAll = this.__chain__;
|
||||
if (!chainAll) {
|
||||
return func.apply(this.value(), arguments);
|
||||
var args = arguments;
|
||||
if (!this.__chain__) {
|
||||
return func.apply(this.value(), args);
|
||||
}
|
||||
var result = new lodashWrapper(this.__wrapped__, chainAll, baseSlice(this.__queue__));
|
||||
result.__queue__.push([func, null, arguments]);
|
||||
return result;
|
||||
return this.tap(function(value) {
|
||||
return func.apply(value, args);
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user