UNPKG

@qntm-code/utils

Version:

A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.

8 lines (7 loc) 227 B
/** * Allows you to filter an array asynchronously */ export async function asyncFilter(array, callback) { const results = await Promise.all(array.map(callback)); return array.filter((_v, index) => results[index]); }