import { StrictEqualityComparer } from "../../shared" ; import { IEqualityComparer } from "../../types" ; param first param second param comparer see { StrictEqualityComparer } returns export const sequenceEquals = < TSource > ( first , second , comparer = StrictEqualityComparer ) => { const firstIterator = first [ Symbol . iterator ] ( ) ; const secondIterator = second [ Symbol . iterator ] ( ) ; let firstResult = firstIterator . next ( ) ; let secondResult = secondIterator . next ( ) ; while ( ! firstResult . done && ! secondResult . done ) { if ( ! comparer ( firstResult . value , secondResult . value ) ) { return false ; } firstResult = firstIterator . next ( ) ; secondResult = secondIterator . next ( ) ; } return firstResult . done === true && secondResult . done === true ; } ;