JSPM

is-empty-iterable

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2488
  • Score
    100M100P100Q137388F
  • License MIT

Check if an Iterable is empty

Package Exports

  • is-empty-iterable

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-empty-iterable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is-empty-iterable Build Status

Check if an Iterable is empty

More efficient than Array.from(iterable).length, as it only iterates the first item, which can make a big difference for dynamic iterators, like a Generator doing an expensive operation.

Install

$ npm install is-empty-iterable

Usage

const isEmptyIterable = require('is-empty-iterable');

isEmptyIterable([]);
//=> true

isEmptyIterable(new Set([1, 2]));
//=> false

API

isEmptyIterable(iterable)

Returns a boolean.

iterable

Type: Iterable

License

MIT © Sindre Sorhus