UNPKG

@thi.ng/transducers

Version:

Collection of ~170 lightweight, composable transducers, reducers, generators, iterators for functional data transformations

12 lines (11 loc) 320 B
import { map } from "./map.js"; import { permutations } from "./permutations.js"; import { range, Range } from "./range.js"; import { zip } from "./zip.js"; const rangeNd = (min, max) => permutations.apply( null, max ? [...map(([a, b]) => range(a, b), zip(min, max))] : [...map(range, min)] ); export { rangeNd };