* The base implementation of methods like `_.dropWhile` and `_.takeWhile` * without support for iteratee shorthands. * * @private * @param {Array} array The array to query. * @param {Function} predicate The function invoked per iteration. * @param {boolean} [isDrop] Spe
(array, predicate, isDrop, fromRight)
| 4431 | * @returns {Array} Returns the slice of `array`. |
| 4432 | */ |
| 4433 | function baseWhile(array, predicate, isDrop, fromRight) { |
| 4434 | var length = array.length, |
| 4435 | index = fromRight ? length : -1; |
| 4436 | |
| 4437 | while ((fromRight ? index-- : ++index < length) && |
| 4438 | predicate(array[index], index, array)) {} |
| 4439 | |
| 4440 | return isDrop |
| 4441 | ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) |
| 4442 | : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); |
| 4443 | } |
| 4444 | |
| 4445 | /** |
| 4446 | * The base implementation of `wrapperValue` which returns the result of |
no test coverage detected