This package has been deprecated

Author message:

This package is no longer maintained

bianco.is-iterable

0.0.3 • Public • Published

bianco.is-iterable

Build Status

NPM version NPM downloads MIT License

Usage

import isIterable from 'bianco.is-iterable'
 
// An array should be iterable
const arr = [1, 2, 3]
isIterable(arr) // => true of course
 
// A generator should be iterable
const gen = (function *() {
  yield Math.random()
})()
isIterable(gen) // => true
 
// A DOM nodes list should be iterable
const lis = document.querySelectorAll('li')
isIterable(lis)  // => depends on the browser
 
// An object should not be iterable
const obj = { foo: 'foo', bar: 'bar' }
isIterable(obj) // => false
 

API

  • isIterable returns true if the object could be looped in a "for of" otherwise false

/bianco.is-iterable/

    Package Sidebar

    Install

    npm i bianco.is-iterable

    Weekly Downloads

    0

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    4.04 kB

    Total Files

    5

    Last publish

    Collaborators

    • gianlucaguarini
    • nilssolanki
    • nirazul