/** * @public */ export async function* filter( it: AsyncIterableIterator, predicate: (value: T) => boolean | Promise, ) { for await (const chunk of it) { if (await predicate(chunk)) { yield chunk } } }