Skip to content

isIterableEqualAsync

isIterableEqualAsync<T>(a, b, comparisonStrategy?, signal?): Promise<boolean>

Defined in: packages/core/src/iterable/async/is-iterable-equal.ts:27

Checks whether two iterables yield equal elements in the same order, and the same number of them.

The async counterpart of isIterableEqual. Both sides are advanced concurrently, so a round costs the slower source rather than their sum. Short-circuits on the first difference, closing whichever iterator has not ended.

Time complexity: O(n) worst case.

T

MaybeAsyncIterable<T>

The first iterable, sync or async.

MaybeAsyncIterable<T>

The second iterable, sync or async.

EqualityComparisonStrategy<T, T> = IS_ITERABLE_EQUAL_DEFAULT_COMPARISON_STRATEGY

The equality comparison strategy to use (default is “strict”). Resolved once, not re-dispatched per element.

AbortSignal

Aborts the comparison.

Promise<boolean>

true if both iterables yield the same elements in the same order.