@lou.codes/predicates
Version:
🧐 Predicate util functions
21 lines (20 loc) • 581 B
TypeScript
import type { IsomorphicIterable } from "@lou.codes/types";
/**
* Check if given value is `IsomorphicIterable` (either `Iterable` or
* `AsyncIterable`).
*
* **Not to be confused with `isAsyncIterable` which only checks for
* `AsyncIterable`.**
*
* @category Iterables
* @example
* ```typescript
* isIterable([]); // true
* isIterable({}); // false
* ```
* @param input Value to check.
* @returns `true` when is an `IsomorphicIterable`, `false` otherwise.
*/
export declare const isIsomorphicIterable: <Item>(
input: unknown,
) => input is IsomorphicIterable<Item>;