export function* uniq(collection: Iterable) { const seen = new Set(); for (const v of collection) { if (!seen.has(v)) { seen.add(v); yield v; } } }