UNPKG

@thi.ng/grid-iterators

Version:

2D grid and shape iterators w/ multiple orderings

10 lines (9 loc) 265 B
import { repeatedly2d } from "@thi.ng/transducers/repeatedly2d"; import { __opts } from "./utils.js"; const columns2d = (opts) => { const { cols, rows, tx } = __opts(opts); return repeatedly2d((y, x) => tx(x, y), rows | 0, cols | 0); }; export { columns2d };