Sha256: 8d25d09663040086d16864b180ed9b04fa02c0d19b6a0d9ff97cd49a8d8be818

Contents?: true

Size: 933 Bytes

Versions: 303

Compression:

Stored size: 933 Bytes

Contents

var baseSlice = require('./_baseSlice');

/**
 * 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] Specify dropping elements instead of taking them.
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {Array} Returns the slice of `array`.
 */
function baseWhile(array, predicate, isDrop, fromRight) {
  var length = array.length,
      index = fromRight ? length : -1;

  while ((fromRight ? index-- : ++index < length) &&
    predicate(array[index], index, array)) {}

  return isDrop
    ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
    : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
}

module.exports = baseWhile;

Version data entries

303 entries across 279 versions & 33 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/lodash/_baseWhile.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/lodash/_baseWhile.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.60 node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.59 node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.58 node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.57 node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.56 node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.55 node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.54 node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.53 node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.52 node_modules/lodash/_baseWhile.js
trusty-cms-6.3.1 node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.51 node_modules/lodash/_baseWhile.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/_baseWhile.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/_baseWhile.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/_baseWhile.js
immosquare-cleaner-0.1.50 node_modules/lodash/_baseWhile.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/_baseWhile.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/_baseWhile.js