Liking cljdoc? Tell your friends :D

clj-util.maps


assoc-ifclj

(assoc-if m p k v)
source

copy-assocclj

(copy-assoc m k vs)
source

rename-keyclj

(rename-key m old new)
source

smart-updateclj

(smart-update m path f)

Like update, but can handle arrays as well. If the value at any point in path is an array, will map over the array, continuing the path. Example: (smart-update {:a [{:b [{:c 10} {:c 20} {:d 100}]}]} [:a :b :c] inc) would result in {:a [{:b [{:c 11} {:c 21} {:d 100}]}]}.

Like update, but can handle arrays as well.
If the value at any point in path is an array, will
map over the array, continuing the path.
Example: (smart-update {:a [{:b [{:c 10} {:c 20} {:d 100}]}]} [:a :b :c] inc)
would result in {:a [{:b [{:c 11} {:c 21} {:d 100}]}]}.
sourceraw docstring

update-allclj

(update-all m f)

Update all top-level keys of m with f.

Update all top-level keys of m with f.
sourceraw docstring

update-existingclj

(update-existing m k f & args)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close