UNPKG

496 BJavaScriptView Raw
1import { comparer as defaultComparer } from '../util/comparer';
2export function sequenceEqual(source, other, comparer = defaultComparer) {
3 const it1 = source[Symbol.iterator]();
4 const it2 = other[Symbol.iterator]();
5 let next1;
6 let next2;
7 while (!(next1 = it1.next()).done) {
8 if (!(!(next2 = it2.next()).done && comparer(next1.value, next2.value))) {
9 return false;
10 }
11 }
12 return !!it2.next().done;
13}
14
15//# sourceMappingURL=sequenceequal.mjs.map