UNPKG

iteragain

Version:

Javascript Iterable/Iterator/Generator-function utilities.

14 lines 594 B
import ProductIterator from './internal/ProductIterator'; import toIterator from './toIterator'; /** * Returns the cartesian product of the input `iterators`. * @param iterators Other iterators. * @param repeat Optional number of times to repeat the input `iterators`. * @see https://docs.python.org/3/library/itertools.html#itertools.product for more info, as it does the same. */ // TODO: Add currying support export function product(iterators, repeat = 1) { return new ProductIterator(iterators.map(toIterator), repeat); } export default product; //# sourceMappingURL=product.js.map