@monstermann/fn
Version:
A utility library for TypeScript.
23 lines • 534 B
TypeScript
//#region src/function/isIterable.d.ts
/**
* `isIterable(value)`
*
* Checks if a value is iterable by testing for the presence of `Symbol.iterator`.
*
* ```ts
* isIterable([1, 2, 3]); // true
* isIterable("hello"); // true
* isIterable(42); // false
* ```
*
* ```ts
* pipe([1, 2, 3], isIterable()); // true
* pipe(42, isIterable()); // false
* ```
*/
declare const isIterable: {
(): (value: unknown) => value is Iterable<unknown>;
(value: unknown): value is Iterable<unknown>;
};
//#endregion
export { isIterable };