Checks if the given value is an async iterable.

Syntax

TypeScript
import { isAsyncIterable } from '@opentf/std';

isAsyncIterable(val: unknown): val is AsyncIterable<unknown>

Parameters

  • val: The value to check.

Returns

true if the value is async iterable, false otherwise.

Examples

TypeScript
isAsyncIterable((async function* () {})()) //=> true
isAsyncIterable([]) //=> false
Last updated on
Edit this page