fix(app): don't use findLast

This commit is contained in:
adamelmore
2026-01-24 12:36:42 -06:00
parent 18911fcf47
commit 2aac29593a
6 changed files with 24 additions and 9 deletions
+10
View File
@@ -0,0 +1,10 @@
export function findLast<T>(
items: readonly T[],
predicate: (item: T, index: number, items: readonly T[]) => boolean,
): T | undefined {
for (let i = items.length - 1; i >= 0; i -= 1) {
const item = items[i]
if (predicate(item, i, items)) return item
}
return undefined
}