-
-
Notifications
You must be signed in to change notification settings - Fork 0
async iterable
Nicholas Berlette edited this page Jun 19, 2025
·
1 revision
function isAsyncIterable<T>(it: unknown): it is AsyncIterable<T>;
Checks if a given value is an object with a Symbol.asyncIterator
method.
Name | Info |
---|---|
it |
The value to check. |
true
if the value is an AsyncIterable
, false
otherwise.
Iterables
import { isAsyncIterable } from "jsr:@nick/is/async-iterable";
const iter = (async function* () {
yield 1;
})();
console.log(isAsyncIterable(iter)); // true