param source returns export const toSet = async < TSource > ( source ) : Promise < Set < TSource > > => { const set = new Set < TSource > ( ) ; for await ( const item of source ) { set . add ( item ) ; } return set ; } ;