mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Fix lazy sequence test fails.
This commit is contained in:
13
lodash.js
13
lodash.js
@@ -1876,7 +1876,7 @@
|
||||
resIndex = 0,
|
||||
takeCount = nativeMin(length, this.__takeCount__);
|
||||
|
||||
if (!isArr || (arrLength == length && takeCount == length)) {
|
||||
if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
|
||||
return baseWrapperValue(array, this.__actions__);
|
||||
}
|
||||
var result = [];
|
||||
@@ -16836,14 +16836,13 @@
|
||||
// Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
|
||||
arrayEach(['drop', 'take'], function(methodName, index) {
|
||||
LazyWrapper.prototype[methodName] = function(n) {
|
||||
var filtered = this.__filtered__;
|
||||
if (filtered && !index) {
|
||||
return new LazyWrapper(this);
|
||||
}
|
||||
n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
|
||||
|
||||
var result = this.clone();
|
||||
if (filtered) {
|
||||
var result = (this.__filtered__ && !index)
|
||||
? new LazyWrapper(this)
|
||||
: this.clone();
|
||||
|
||||
if (result.__filtered__) {
|
||||
result.__takeCount__ = nativeMin(n, result.__takeCount__);
|
||||
} else {
|
||||
result.__views__.push({
|
||||
|
||||
Reference in New Issue
Block a user