UNPKG

@thi.ng/transducers

Version:

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

11 lines (10 loc) 324 B
import { isIterable } from "@thi.ng/checks/is-iterable"; import { deepTransform } from "./deep-transform.js"; import { iterator1 } from "./iterator.js"; import { map } from "./map.js"; function mapDeep(spec, src) { return isIterable(src) ? iterator1(mapDeep(spec), src) : map(deepTransform(spec)); } export { mapDeep };