export const asyncFilter = async (arr: T[], predicate: (value: T, index: number, arr: T[]) => Promise) => { const results = await Promise.all(arr.map(predicate)); return arr.filter((_v, index) => results[index]); };