UNPKG

@thi.ng/transducers

Version:

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

9 lines (8 loc) 196 B
import { NO_OP } from "@thi.ng/api/api"; import { reduce, reducer } from "./reduce.js"; function last(src) { return src ? reduce(last(), src) : reducer(NO_OP, (_, x) => x); } export { last };