fix(app): don't use findLast

This commit is contained in:
adamelmore
2026-01-24 12:36:42 -06:00
parent d90b4c9ebd
commit 1080f37f9c
6 changed files with 24 additions and 9 deletions

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
}