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:
parent
f7d0383919
commit
2de1c92ee8
1 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue