MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / baseWhile

Function baseWhile

lib/web/jshint.js:4298–4306  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 4

dropRightWhileFunction · 0.85
dropWhileFunction · 0.85
takeRightWhileFunction · 0.85
takeWhileFunction · 0.85

Calls 1

baseSliceFunction · 0.85

Tested by

no test coverage detected