mirror of
https://github.com/penpot/penpot.git
synced 2025-06-05 09:21:39 +02: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
|
(defn mapm
|
||||||
"Map over the values of a map"
|
"Map over the values of a map"
|
||||||
[mfn coll]
|
([mfn]
|
||||||
(into {} (map (fn [[key val]] [key (mfn key val)]) coll)))
|
(map (fn [[key val]] [key (mfn key val)])))
|
||||||
|
([mfn coll]
|
||||||
|
(into {} (mapm mfn) coll)))
|
||||||
|
|
||||||
(defn filterm
|
(defn filterm
|
||||||
"Filter values of a map that satisfy a predicate"
|
"Filter values of a map that satisfy a predicate"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue