* The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`, * and `_.takeWhile` without support for callback shorthands and `this` binding. * * @private * @param {Array} array The array to query. * @param {Function} predicate The function invoked per
(array, predicate, isDrop, fromRight)
| 4296 | * @returns {Array} Returns the slice of `array`. |
| 4297 | */ |
| 4298 | function baseWhile(array, predicate, isDrop, fromRight) { |
| 4299 | var length = array.length, |
| 4300 | index = fromRight ? length : -1; |
| 4301 | |
| 4302 | while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} |
| 4303 | return isDrop |
| 4304 | ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) |
| 4305 | : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); |
| 4306 | } |
| 4307 | |
| 4308 | /** |
| 4309 | * The base implementation of `wrapperValue` which returns the result of |
no test coverage detected