param source returns export const toArray = async < TSource > ( source ) : Promise < TSource [ ] > => { const array = [ ] ; for await ( const item of source ) { array . push ( item ) ; } return array ; } ;