param source param selector returns export const toObjectAsync = async < TSource , TKey extends keyof any > ( source , selector ) : Promise < Record < TKey , TSource > > => { const map = { } ; for ( const value of source ) { map [ await selector ( value ) ] = value ; } return map as Record < TKey , TSource > ; } ;