export async function min < TElement > ( source , compareFn ) { let result = undefined ; for await ( const element of source ) { if ( result === undefined || compareFn ( element , result ) < 0 ) { result = element ; } } return result ; }