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
immosquare-cleaner-0.1.41 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.40 node_modules/lodash/_baseFindIndex.js
sumomo-0.10.8 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.39 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.38 node_modules/lodash/_baseFindIndex.js
optimacms-0.1.61 spec/dummy/node_modules/lodash/_baseFindIndex.js
boring_generators-0.13.0 tmp/templates/app_template/node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.32 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.31 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.30 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.29 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.28 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.27 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.26 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.25 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.24 node_modules/lodash/_baseFindIndex.js
immosquare-cleaner-0.1.23 node_modules/lodash/_baseFindIndex.js
sumomo-0.10.4 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
sumomo-0.10.3 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js
sumomo-0.10.2 data/sumomo/api_modules/node_modules/lodash/_baseFindIndex.js