import { ErrorString , InvalidOperationException } from "../../shared" ; param source param selector throws returns export const minAsync = async < TSource > ( source , selector ) : Promise < number > => { let min = null ; for ( const item of source ) { min = Math . min ( min || Number . POSITIVE_INFINITY , await selector ( item ) ) ; } if ( min === null ) { throw new InvalidOperationException ( ErrorString . NoElements ) ; } else { return min ; } } ;