shared package (#22626)

This commit is contained in:
Dax 2026-04-15 10:26:20 -04:00 committed by GitHub
commit be9432a893
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
144 changed files with 246 additions and 242 deletions

View file

@ -1,10 +0,0 @@
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
}