1.2.0 • Published 2 years ago
check-iterable v1.2.0
Check Iterable
A toolbox to check if an object is iterable, an iterator or a generator, etc.
Install
Node.js
npm i check-iterableDeno
import * as CheckIterable from "https://deno.land/x/check_iterable/index.js";API
isIterable(obj: any): booleanChecks if the given object is an Iterable (implemented@@iterator).isAsyncIterable(obj: any): booleanChecks if the given object is an AsyncIterable (implemented@@asyncIterator).isIteratorLike(obj: any): booleanChecks if the given object is an IteratorLike (implementednext).isIterableIterator(obj: any): booleanChecks if the given object is an IterableIterator (implemented both@@iteratorandnext).isAsyncIterableIterator(obj: any): booleanChecks if the given object is an AsyncIterableIterator (implemented both@@asyncIteratorandnext).isGenerator(obj: any): booleanChecks if the given object is a Generator.isAsyncGenerator(obj: any): booleanChecks 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.