@lucid-softworks/is-async-iterable
v0.1.0
Published
A structural type guard for asynchronous iterables.
Downloads
43
Maintainers
Readme
@lucid-softworks/is-async-iterable
Check for a callable Symbol.asyncIterator method and narrow values to
AsyncIterable<unknown>.
import { isAsyncIterable } from "@lucid-softworks/is-async-iterable";
if (isAsyncIterable(value)) {
for await (const item of value) {
consume(item);
}
}