export default async function* ( it: Iterable | AsyncIterable, pred: (val: T) => boolean | Promise ): AsyncGenerator { for await (const val of it) { if (await pred(val)) { yield val; } } }