We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4833d14 commit 101390cCopy full SHA for 101390c
index.ts
@@ -429,15 +429,13 @@ export async function asyncEqualOnce<T>(
429
): Promise<boolean> {
430
const ait = asyncIterator(a);
431
const bit = asyncIterator(b);
432
- let aElement = await ait.next();
433
- let bElement = await bit.next();
+ let [aElement, bElement] = await Promise.all([ait.next(), bit.next()] as const);
434
while (
435
aElement.done !== true &&
436
bElement.done !== true &&
437
(await elementsEqual(aElement.value, bElement.value))
438
) {
439
- aElement = await ait.next();
440
- bElement = await bit.next();
+ [aElement, bElement] = await Promise.all([ait.next(), bit.next()] as const);
441
}
442
return aElement.done === true && bElement.done === true;
443
0 commit comments