UNPKG

@thi.ng/transducers

Version:

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

11 lines (10 loc) 191 B
import { reduce, reducer } from "./reduce.js"; function max(src) { return src ? reduce(max(), src) : reducer( () => -Infinity, (acc, x) => Math.max(acc, x) ); } export { max };