@jasmith79/sequable
Version:
Library functions for working with generators
16 lines (15 loc) • 599 B
text/typescript
export type Sequable<T> = Iterator<T> | Iterable<T> | (() => Iterator<T>);
/**
* Converts the given Iterable or generator function to an Iterator, given
* an Iterator just returns it.
*
* @param iter The Iterable, Iterator, or generator function to convert.
*/
export declare function toIterator<T>(iter: Sequable<T>): Iterator<T>;
/**
* Converts the given Iterator or generator function to an Iterable, given
* an Iterable just returns it.
*
* @param iter The Iterable, Iterator, or generator function to convert.
*/
export declare function toIterable<T>(iter: Sequable<T>): Iterable<T>;