UNPKG

@lou.codes/predicates

Version:
21 lines (20 loc) 581 B
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>;