@lou.codes/predicates
Version:
🧐 Predicate util functions
20 lines (19 loc) • 569 B
TypeScript
/**
* Check if given value is `AsyncIterable`.
*
* **Not to be confused with `isAsynchronousIterable` which checks for both
* `AsyncIterable` and `Iterable`.**
*
* @category Iterables
* @example
* ```typescript
* isAsyncIterable((async function * () { yield* [] })()); // true
* isAsyncIterable([]); // false
* isAsyncIterable({}); // false
* ```
* @param input Value to check.
* @returns `true` when is an `AsyncIterable`, `false` otherwise.
*/
export declare const isAsyncIterable: <Item>(
input: unknown,
) => input is Readonly<AsyncIterable<Item>>;