UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

15 lines (13 loc) 271 B
export function filterAsync(predicate) { return async list => { const willReturn = [] let index = 0 for (const x of list) { if (await predicate(x, index)) { willReturn.push(list[index]) } index++ } return willReturn } }