import { fromAsync } from "../../async/static/fromAsync" ; import { IAsyncEnumerable } from "../../types" ; param first param second param resultSelector returns export const zipAsync = < TFirst , TSecond , TResult > ( first , second , resultSelector ) : IAsyncEnumerable < TResult > => { async function * generator ( ) { const firstIterator = first [ Symbol . iterator ] ( ) ; const secondIterator = second [ Symbol . iterator ] ( ) ; while ( true ) { const a = firstIterator . next ( ) ; const b = secondIterator . next ( ) ; if ( a . done && b . done ) { break ; } else { yield resultSelector ( a . value , b . value ) ; } } } return fromAsync ( generator ) ; } ;