UNPKG

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