param source param predicate returns export const countAsync = async < TSource > ( source , predicate ) : Promise < number > => { let count = 0 ; for ( const value of source ) { if ( await predicate ( value ) === true ) { count ++ ; } } return count ; } ;