iteragain
Version:
Javascript Iterable/Iterator/Generator-function utilities.
9 lines • 562 B
TypeScript
import type { IteratorOrIterable, Predicate } from './types';
/**
* Finds the index of the first value that passes a truthy vale to `predicate`, then returns it. Only consumes the
* iterator's values up to the found value, then stops. So if it's not found, then the iterator is exhausted.
*/
export declare function findIndex<T>(arg: IteratorOrIterable<T>, predicate: Predicate<T>): number;
export declare function findIndex<T>(predicate: Predicate<T>): (arg: IteratorOrIterable<T>) => number;
export default findIndex;
//# sourceMappingURL=findIndex.d.ts.map