import type { Fn } from "@thi.ng/api" ; import { isIterable } from "@thi.ng/checks/is-iterable" ; import type { Transducer } from "./api.js" ; import { cat } from "./cat.js" ; import { comp } from "./comp.js" ; import { iterator } from "./iterator.js" ; import { map } from "./map.js" ; /**
 * Transducer. Similar to  {@link (map:1)} , but expects the given mapping
 * function `fn` to return an iterable result (or `null`) and then emits
 * each value of the result individually downstream. `null` or
 * `undefined` result values will be skipped / omitted.
 *
 *  example param fn export function mapcat < A , B > ( fn ) ; export function mapcat < A , B > ( fn , src ) ; export function mapcat < A , B > ( fn , src ? ) { return isIterable ( src ) ? iterator ( mapcat ( fn ) , src ) : comp ( map ( fn ) , cat ( ) ) ; }