$ npm install is-empty-iterableCheck if an
Iterableis 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.
$ npm install is-empty-iterable
import isEmptyIterable from 'is-empty-iterable';
isEmptyIterable([]);
//=> true
isEmptyIterable(new Set([1, 2]));
//=> false
Returns a boolean.
Type: Iterable