Skip to main content
Module

x/isx/is_async_iterable.ts>isAsyncIterable

Collection of validation functions for JavaScript data
Latest
function isAsyncIterable
Deprecated
Deprecated

Use object/is_async_iterable instead.

import { isAsyncIterable } from "https://deno.land/x/isx@1.5.0/is_async_iterable.ts";

Whether the input is AsyncIterable or not.

Examples

Example 1

import { isAsyncIterable } from "https://deno.land/x/isx@$VERSION/is_async_iterable.ts"
import { assertEquals } from "https://deno.land/std/testing/asserts.ts"
assertEquals(
  isAsyncIterable({
    async *[Symbol.asyncIterator]() {
      yield "hello";
    },
  }),
  true,
);
assertEquals(isAsyncIterable(() => {}), false);

Parameters

input: unknown
  • Any input.

Returns

input is AsyncIterable<T>