UNPKG

@thi.ng/transducers

Version:

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

12 lines (11 loc) 263 B
import { isNotStringAndIterable } from "@thi.ng/checks/is-not-string-iterable"; import { flattenWith } from "./flatten-with.js"; function flatten(src) { return flattenWith( (x) => isNotStringAndIterable(x) ? x : void 0, src ); } export { flatten };