A toolbox to check if an object is iterable, an iterator or a generator, etc.
npm install check-iterableA toolbox to check if an object is iterable, an iterator or a generator, etc.
``sh`
npm i check-iterable
`ts`
import * as CheckIterable from "https://deno.land/x/check_iterable/index.js";
- isIterable(obj: any): boolean Checks if the given object is an Iterable @@iterator
(implemented ).isAsyncIterable(obj: any): boolean
- Checks if the given object is an @@asyncIterator
AsyncIterable (implemented ).isIteratorLike(obj: any): boolean
- Checks if the given object is an next
IteratorLike (implemented ).isIterableIterator(obj: any): boolean
- Checks if the given object is an @@iterator
IterableIterator (implemented both and next).isAsyncIterableIterator(obj: any): boolean
- Checks if the given object is an@@asyncIterator
AsyncIterableIterator (implemented both and next).isGenerator(obj: any): boolean
- Checks if the given object is a Generator.isAsyncGenerator(obj: any): boolean` Checks if the given object is an
-
AsyncGenerator.
Note:
These functions are designed to test whether an object suits the specifications
suggested on MDN in sloppy mode, go to MDN for
more details.