iteragain
Version:
Javascript Iterable/Iterator/Generator-function utilities.
11 lines • 514 B
TypeScript
import type { IteratorOrIterable } from './types';
/**
* Return a new iterator of pairs (tuples) of the values in the input one. The number of pairs will always be one fewer
* than the input. Will be empty if the input has fewer than two values.
* @example
* iter([1,2,3]).pairwise().toArray() // [[1,2], [2,3]]
* iter([1]).pairwise().toArray() // []
*/
export declare function pairwise<T>(arg: IteratorOrIterable<T>): IterableIterator<[T, T]>;
export default pairwise;
//# sourceMappingURL=pairwise.d.ts.map