mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Reduce lazy wrapper for lazy first and last.
This commit is contained in:
@@ -10095,12 +10095,9 @@
|
|||||||
isLazy = value instanceof LazyWrapper;
|
isLazy = value instanceof LazyWrapper;
|
||||||
|
|
||||||
if (retUnwrapped && !chainAll) {
|
if (retUnwrapped && !chainAll) {
|
||||||
if (isLazy) {
|
return isLazy
|
||||||
return func.apply(value, args);
|
? func.call(value)
|
||||||
}
|
: lodash[methodName](this.value());
|
||||||
var otherArgs = [this.value()];
|
|
||||||
push.apply(otherArgs, args);
|
|
||||||
return lodash[methodName].apply(lodash, otherArgs);
|
|
||||||
}
|
}
|
||||||
if (isLazy || isArray(value)) {
|
if (isLazy || isArray(value)) {
|
||||||
var result = func.apply(isLazy ? value : new LazyWrapper(this), args);
|
var result = func.apply(isLazy ? value : new LazyWrapper(this), args);
|
||||||
|
|||||||
Reference in New Issue
Block a user