Remove arrays.findIndex

For #103454

This should be a direct map to the `.findIndex` mathod
This commit is contained in:
Matt Bierner
2020-09-09 22:03:31 -07:00
parent a9a7cf18f3
commit eba1cc8de3
13 changed files with 31 additions and 61 deletions

View File

@@ -182,16 +182,6 @@ export function uniqueFilter<T>(keyFn: (t: T) => string): (t: T) => boolean {
};
}
export function firstIndex<T>(array: T[], fn: (t: T) => boolean): number {
for (let i = 0; i < array.length; i++) {
if (fn(array[i])) {
return i;
}
}
return -1;
}
export function find<T>(array: T[], fn: (t: T) => boolean): T | undefined {
let result: T | undefined = undefined;