Function
mapcat
(
lst: ImageEntry[],
fn: (chunk: ImageEntry) => ImageDiff[],
)
Source from the content-addressed store, hash-verified
| 43 | // Apply `fn` to every element in `lst` and then concatenate all the results |
| 44 | // http://clojuredocs.org/clojure_core/clojure.core/mapcat |
| 45 | function mapcat( |
| 46 | lst: ImageEntry[], |
| 47 | fn: (chunk: ImageEntry) => ImageDiff[], |
| 48 | ): ImageDiff[] { |
| 49 | return _.flatten(lst.map(fn), true /* only flatten one level */); |
| 50 | } |
| 51 | |
| 52 | // > ArrayDiff.diff([1,2,3], [2,3,4]); |
| 53 | // = [{ "value": [1], |
Tested by
no test coverage detected