* Extracts the unwrapped value from its lazy wrapper. * * @private * @name value * @memberOf LazyWrapper * @returns {*} Returns the unwrapped value.
()
| 9487 | * @returns {*} Returns the unwrapped value. |
| 9488 | */ |
| 9489 | function lazyValue() { |
| 9490 | var array = this.__wrapped__.value(), |
| 9491 | dir = this.__dir__, |
| 9492 | isArr = isArray(array), |
| 9493 | isRight = dir < 0, |
| 9494 | arrLength = isArr ? array.length : 0, |
| 9495 | view = getView(0, arrLength, this.__views__), |
| 9496 | start = view.start, |
| 9497 | end = view.end, |
| 9498 | length = end - start, |
| 9499 | index = isRight ? end : (start - 1), |
| 9500 | iteratees = this.__iteratees__, |
| 9501 | iterLength = iteratees.length, |
| 9502 | resIndex = 0, |
| 9503 | takeCount = nativeMin(length, this.__takeCount__); |
| 9504 | |
| 9505 | if (!isArr || (!isRight && arrLength == length && takeCount == length)) { |
| 9506 | return baseWrapperValue(array, this.__actions__); |
| 9507 | } |
| 9508 | var result = []; |
| 9509 | |
| 9510 | outer: |
| 9511 | while (length-- && resIndex < takeCount) { |
| 9512 | index += dir; |
| 9513 | |
| 9514 | var iterIndex = -1, |
| 9515 | value = array[index]; |
| 9516 | |
| 9517 | while (++iterIndex < iterLength) { |
| 9518 | var data = iteratees[iterIndex], |
| 9519 | iteratee = data.iteratee, |
| 9520 | type = data.type, |
| 9521 | computed = iteratee(value); |
| 9522 | |
| 9523 | if (type == LAZY_MAP_FLAG) { |
| 9524 | value = computed; |
| 9525 | } else if (!computed) { |
| 9526 | if (type == LAZY_FILTER_FLAG) { |
| 9527 | continue outer; |
| 9528 | } else { |
| 9529 | break outer; |
| 9530 | } |
| 9531 | } |
| 9532 | } |
| 9533 | result[resIndex++] = value; |
| 9534 | } |
| 9535 | return result; |
| 9536 | } |
| 9537 | |
| 9538 | // Ensure `LazyWrapper` is an instance of `baseLodash`. |
| 9539 | LazyWrapper.prototype = baseCreate(baseLodash.prototype); |
nothing calls this directly
no test coverage detected