import { IParallelEnumerable } from "../../types" ; import { typeDataToArray } from "./_typeDataToArray" ; param source param selector returns export const toObject = async < TSource , TKey extends keyof any > ( source , selector ) : Promise < Record < TKey , TSource > > => { const dataFunc = source . dataFunc ; const values = await typeDataToArray ( dataFunc ) ; const map = { } ; for ( const value of values ) { map [ selector ( value ) ] = value ; } return map as Record < TKey , TSource > ; } ;