mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Bump to v3.4.0.
This commit is contained in:
@@ -3,8 +3,9 @@ import getView from './getView';
|
||||
import isArray from '../lang/isArray';
|
||||
|
||||
/** Used to indicate the type of lazy iteratees. */
|
||||
var LAZY_FILTER_FLAG = 0,
|
||||
LAZY_MAP_FLAG = 1;
|
||||
var LAZY_DROP_WHILE_FLAG = 0,
|
||||
LAZY_MAP_FLAG = 2,
|
||||
LAZY_TAKE_WHILE_FLAG = 3;
|
||||
|
||||
/* Native method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMin = Math.min;
|
||||
@@ -46,16 +47,22 @@ function lazyValue() {
|
||||
while (++iterIndex < iterLength) {
|
||||
var data = iteratees[iterIndex],
|
||||
iteratee = data.iteratee,
|
||||
computed = iteratee(value, index, array),
|
||||
type = data.type;
|
||||
|
||||
if (type != LAZY_DROP_WHILE_FLAG) {
|
||||
var computed = iteratee(value);
|
||||
} else {
|
||||
data.done = data.done && (isRight ? index < data.index : index > data.index);
|
||||
data.index = index;
|
||||
computed = data.done || (data.done = !iteratee(value));
|
||||
}
|
||||
if (type == LAZY_MAP_FLAG) {
|
||||
value = computed;
|
||||
} else if (!computed) {
|
||||
if (type == LAZY_FILTER_FLAG) {
|
||||
continue outer;
|
||||
} else {
|
||||
if (type == LAZY_TAKE_WHILE_FLAG) {
|
||||
break outer;
|
||||
} else {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user