0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

🎉 Add transducer version of mapm data helper.

This commit is contained in:
Andrey Antukh 2021-03-15 08:38:32 +01:00
parent f7d0383919
commit 2de1c92ee8

View file

@ -146,8 +146,10 @@
(defn mapm
"Map over the values of a map"
[mfn coll]
(into {} (map (fn [[key val]] [key (mfn key val)]) coll)))
([mfn]
(map (fn [[key val]] [key (mfn key val)])))
([mfn coll]
(into {} (mapm mfn) coll)))
(defn filterm
"Filter values of a map that satisfy a predicate"