iteragain
Version:
Javascript Iterable/Iterator/Generator-function utilities.
9 lines • 644 B
TypeScript
import type { IterSource, IteratorOrIterable, Tuple } from './types';
/**
* Returns a 2 length tuple containing the head of the input `iterator` and a new iterator containing the same
* values as `iterator`.
*/
export declare function spy<T extends IteratorOrIterable<unknown>, TAhead extends number = 1>(ahead?: TAhead): (arg: T) => [Tuple<IterSource<T>, TAhead>, IterableIterator<IterSource<T>>];
export declare function spy<T extends IteratorOrIterable<unknown>, TAhead extends number = 1>(iterator: T, ahead?: TAhead): [Tuple<IterSource<T>, TAhead>, IterableIterator<IterSource<T>>];
export default spy;
//# sourceMappingURL=spy.d.ts.map