Function isAsyncIterable

  • Check if given value is AsyncIterable.

    Not to be confused with isAsynchronousIterable which checks for both AsyncIterable and Iterable.

    Example

    isAsyncIterable((async function * () { yield* [] })()); // true
    isAsyncIterable([]); // false
    isAsyncIterable({}); // false

    Type Parameters

    • Item

    Parameters

    • input: unknown

      Value to check.

    Returns input is {
        [asyncIterator]() => AsyncIterator<Item, any, undefined>;
    }

    true when is an AsyncIterable, false otherwise.