Sha256: 07e9942a47eeb723eb9fa1bc0f7240f93ad9f52d702c0f37d7163670000350c1
Contents?: true
Size: 766 Bytes
Versions: 265
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
265 entries across 263 versions & 30 rubygems