Added the underscore node_module.
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
All checks were successful
Auto Maintenance Cycle / pre-commit Autoupdate (push) Successful in 39s
This commit is contained in:
15
node_modules/underscore/modules/_createPredicateIndexFinder.js
generated
vendored
Normal file
15
node_modules/underscore/modules/_createPredicateIndexFinder.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import cb from './_cb.js';
|
||||
import getLength from './_getLength.js';
|
||||
|
||||
// Internal function to generate `_.findIndex` and `_.findLastIndex`.
|
||||
export default function createPredicateIndexFinder(dir) {
|
||||
return function(array, predicate, context) {
|
||||
predicate = cb(predicate, context);
|
||||
var length = getLength(array);
|
||||
var index = dir > 0 ? 0 : length - 1;
|
||||
for (; index >= 0 && index < length; index += dir) {
|
||||
if (predicate(array[index], index, array)) return index;
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user