export function takeAll(collection: Iterable): T[] { const res: T[] = []; for (const e of collection) { res.push(e); } return res; }