UNPKG

@thi.ng/grid-iterators

Version:

2D grid and shape iterators w/ multiple orderings

11 lines (10 loc) 274 B
import { asInt } from "@thi.ng/api/typedarray"; import { ident } from "./transforms.js"; const __opts = (opts) => { let { cols, rows = opts.cols, tx = ident } = opts; [cols, rows] = asInt(cols, rows); return { cols, rows, tx: tx(cols, rows) }; }; export { __opts };