MCPcopy Index your code
hub / github.com/deployd/deployd / baseWhile

Function baseWhile

test-app/public/sinon.js:14971–14981  ·  view source on GitHub ↗

* 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. * @para

(array, predicate, isDrop, fromRight)

Source from the content-addressed store, hash-verified

14969 * @returns {Array} Returns the slice of `array`.
14970 */
14971 function baseWhile(array, predicate, isDrop, fromRight) {
14972 var length = array.length,
14973 index = fromRight ? length : -1;
14974
14975 while ((fromRight ? index-- : ++index < length) &&
14976 predicate(array[index], index, array)) {}
14977
14978 return isDrop
14979 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
14980 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
14981 }
14982
14983 /**
14984 * 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