import { IAsyncEnumerable } from "../../types" ; import { BasicAsyncEnumerable } from "../BasicAsyncEnumerable" ; param source param action returns export const each = < TSource > ( source , action ) : IAsyncEnumerable < TSource > => { async function * iterator ( ) { for await ( const value of source ) { action ( value ) ; yield value ; } } return new BasicAsyncEnumerable ( iterator ) ; } ;