import { StrictEqualityComparer } from "../../shared" ; import { IAsyncEnumerable , IEqualityComparer } from "../../types" ; import { BasicAsyncEnumerable } from "../BasicAsyncEnumerable" ; param first param second param comparer returns export const except = < TSource > ( first , second , comparer = StrictEqualityComparer ) : IAsyncEnumerable < TSource > => { async function * iterator ( ) { const secondArray = [ ] ; for await ( const x of second ) { secondArray . push ( x ) ; } for await ( const firstItem of first ) { let exists = false ; for ( let j = 0 ; j < secondArray . length ; j ++ ) { const secondItem = secondArray [ j ] ; if ( comparer ( firstItem , secondItem ) === true ) { exists = true ; break ; } } if ( exists === false ) { yield firstItem ; } } } return new BasicAsyncEnumerable ( iterator ) ; } ;