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