Liking cljdoc? Tell your friends :D

automaton-core.utils.map

Utility for map data structure

Utility for map data structure
raw docstring

add-idsclj/s

(add-ids m)

Add the key to all map values (which are expected to be maps) Params:

  • m map
Add the key to all map values (which are expected to be maps)
Params:
* `m` map
raw docstring

apply-to-keysclj/s

(apply-to-keys maps f & ks)

Apply function f to each key in ks in the maps in maps Params:

  • f fn with three arguments. First is k the key currently update (one of ks), second is m the current value of the m while it is updated, third is v the current value of key k in map m
  • maps is a sequence of map
  • ks keys in the map to apply f to
Apply function `f` to each key in `ks` in the maps in `maps`
Params:
* `f` fn with three arguments. First is `k` the key currently update (one of `ks`), second is `m` the current value of the m while it is updated, third is `v` the current value of key `k` in map `m`
* `maps` is a sequence of map
* `ks` keys in the map to apply `f` to
raw docstring

crushclj/s

(crush m)

Crush the map

Crush the map
raw docstring

deep-mergeclj/s

(deep-merge & maps)

Deep merge nested maps. Last map has higher priority

This code comes from this gist

Deep merge nested maps.
Last map has higher priority

This code comes from this [gist](https://gist.github.com/danielpcox/c70a8aa2c36766200a95)
raw docstring

idx-ofclj/s

(idx-of v value)

Return the index of the first found value in the sequence

Return the index of the first found value in the sequence
raw docstring

idx-of-predclj/s

(idx-of-pred v pred)

Same as idx-of but with a predicate

Same as idx-of but with a predicate
raw docstring

map-differenceclj/s

(map-difference m1 m2)

map-util-hashmappify-valsclj/s

(map-util-hashmappify-vals m modify-type-fn)

Converts an ordinary Clojure map into a Clojure map with nested map values recursively translated into what modify-type-fn is returning. Based on walk/stringify-keys. When key or value is nil, the pair is removed, as the hashmap doesn't allow null keys/values.

Converts an ordinary Clojure map into a Clojure map with nested map
values recursively translated into what modify-type-fn is returning. Based
on walk/stringify-keys.
When key or value is nil, the pair is removed, as the hashmap doesn't allow null keys/values.
raw docstring

prefixify-childrenclj/s

(prefixify-children thing)

prefixify-mapclj/s

(prefixify-map prefix thing)

prefixify-vecclj/s

(prefixify-vec prefix thing)

remove-nil-submap-valsclj/s

(remove-nil-submap-vals m)

remove-nil-valsclj/s

(remove-nil-vals m)

replace-keysclj/s

(replace-keys m1 m2)

Replace keys in m2 with keys from m1. Similiar to merge but non-existen keys in first map won't be added. e.g. (replace-keys {:a 3 :b 2} {:a 1}) -> {:a 3}

Replace keys in `m2` with keys from `m1`. Similiar to merge but non-existen keys in first map won't be added. e.g. (replace-keys {:a 3 :b 2} {:a 1}) -> {:a 3}
raw docstring

update-kwclj/s

(update-kw m kws f)

Update the keywords kws in map m with function f

Update the keywords `kws` in map `m` with function `f`
raw docstring

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

× close