import { asyncIterable } from '../utils/asyncIterable' ; export function map < TElement , TResult > ( source , transform ) { return asyncIterable ( async function * ( ) { let index = 0 ; for await ( const element of source ) { yield await transform ( element , index ++ ) ; } } ) ; }