Sha256: 07e9942a47eeb723eb9fa1bc0f7240f93ad9f52d702c0f37d7163670000350c1

Contents?: true

Size: 766 Bytes

Versions: 266

Compression:

Stored size: 766 Bytes

Contents

/**
 * The base implementation of `_.findIndex` and `_.findLastIndex` without
 * support for iteratee shorthands.
 *
 * @private
 * @param {Array} array The array to inspect.
 * @param {Function} predicate The function invoked per iteration.
 * @param {number} fromIndex The index to search from.
 * @param {boolean} [fromRight] Specify iterating from right to left.
 * @returns {number} Returns the index of the matched value, else `-1`.
 */
function baseFindIndex(array, predicate, fromIndex, fromRight) {
  var length = array.length,
      index = fromIndex + (fromRight ? 1 : -1);

  while ((fromRight ? index-- : ++index < length)) {
    if (predicate(array[index], index, array)) {
      return index;
    }
  }
  return -1;
}

module.exports = baseFindIndex;

Version data entries

266 entries across 264 versions & 30 rubygems

Version Path
ela-3.4.2 node_modules/lodash/_baseFindIndex.js
ela-3.4.0 node_modules/lodash/_baseFindIndex.js
ela-3.3.1 node_modules/lodash/_baseFindIndex.js
dragonfly_puppeteer-0.1.0 node_modules/lodash/_baseFindIndex.js
ela-3.3.0 node_modules/lodash/_baseFindIndex.js
ela-3.2.0 node_modules/lodash/_baseFindIndex.js
ela-3.1.1 node_modules/lodash/_baseFindIndex.js
ela-3.1.0 node_modules/lodash/_baseFindIndex.js
ela-3.0.0 node_modules/lodash/_baseFindIndex.js
ela-2.0.0 node_modules/lodash/_baseFindIndex.js
ela-1.1.0 node_modules/lodash/_baseFindIndex.js
sumomo-0.8.0 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
sumomo-0.7.3 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
sumomo-0.7.2 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
sumomo-0.7.1 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
sumomo-0.6.4 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
sumomo-0.6.3 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
sumomo-0.6.2 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
sumomo-0.6.1 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
affiliator-0.2.1 node_modules/lodash/_baseFindIndex.js