UNPKG

stop-iteration-iterator

Version:

Firefox 17-26 iterators throw a StopIteration object to indicate "done". This normalizes it.

7 lines (5 loc) 259 B
declare global { const StopIteration: (object & { readonly __brand__?: unique symbol }) | undefined; } declare function getStopIterationIterator<T>(origIterator: { next(): IteratorResult<T> }): Iterator<T, unknown, T>; export = getStopIterationIterator;