Sha256: a096e98d6c7cb1dbf059a4215c3bb56e466f5c242c8cc495078f4b1c65591734

Contents?: true

Size: 709 Bytes

Versions: 153

Compression:

Stored size: 709 Bytes

Contents

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

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

module.exports = baseFindIndex;

Version data entries

153 entries across 80 versions & 8 rubygems

Version Path
trusty-festivity-extension-2.3.30 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.29 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.29 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.28 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.28 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.27 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.27 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.26 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.26 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.25 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.25 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.24 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.24 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.23 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseFindIndex.js
trusty-festivity-extension-2.3.23 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseFindIndex.js
es6_tilt-0.1.2 test/dummy/app/assets/javascripts/node_modules/lodash/internal/baseFindIndex.js
es6_tilt-0.1.2 test/dummy/node_modules/lodash/internal/baseFindIndex.js
es6_tilt-0.1.1 test/dummy/node_modules/lodash/internal/baseFindIndex.js
es6_tilt-0.1.1 test/dummy/app/assets/javascripts/node_modules/lodash/internal/baseFindIndex.js
es6_tilt-0.1.0 test/dummy/app/assets/javascripts/node_modules/lodash/internal/baseFindIndex.js