The value returned from the iterator
The return type of your reducer function
If your iterator has a return type it must be the same as TIteratorValue, otherwise undefined
The type your iterator is expecting as what's passed to its next function. For generators this is the type returned after a yield.
The iterator you wish to map elements from
A function to use to map the elements iterator produces
const set = new Set([1, 2, 3, 4, 5]);
const mapped = mapIterator(set, (item) => item * 2);
console.log(Array.from(mapped)); // logs out [2, 4, 6, 8, 10]
Generated using TypeDoc
Given an IteratorArg and a mapping function, returns a new IterableIterator that yields values from the initial iterator but passed through the mapping function.