mirror of
https://github.com/penpot/penpot.git
synced 2026-04-28 04:38:14 +00:00
🎉 Add transducer version of mapm data helper.
This commit is contained in:
parent
f7d0383919
commit
2de1c92ee8
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user