- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
16 lines
509 B
JavaScript
16 lines
509 B
JavaScript
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;
|
|
};
|
|
}
|