Liking cljdoc? Tell your friends :D

b2w-commons-collections.map

Map helpers.

Map helpers.

assoc-all

(assoc-all map keys value)

Assocs all keys of a given list with the provided value. E.g.:

(assoc-all {} [:a :b] 1)

Will produce: {:a 1 :b 1}

Assocs all keys of a given list with the provided value.
E.g.:

(assoc-all {} [:a :b] 1)

Will produce:
{:a 1 :b 1}
raw docstring

assoc-all-if

(assoc-all-if map condition keys value)

Assocs all keys with the provided value if the given condition is true.

Assocs all keys with the provided value if the
given condition is true.
raw docstring

assoc-if

(assoc-if map condition key value)

Assocs a key-value pair to the map if the given condition is true.

A condition function can be provided as condition, as the following example:

(assoc-if {:a 0} #(>= % 0) :b 3)

Will produce: {:a 0 :b 3}, since the given value 3 is >= 0.

Assocs a key-value pair to the map
if the given condition is true.

A condition function can be provided as condition,
as the following example:

(assoc-if {:a 0} #(>= % 0) :b 3)

Will produce:
{:a 0 :b 3}, since the given value 3 is >= 0.
raw docstring

dissoc-all

(dissoc-all map keys)

Dissocs all keys of a given list. E.g.:

(dissoc-all {:a 1 :b 2} [:a])

Will produce: {:b 2}

Dissocs all keys of a given list.
E.g.:

(dissoc-all {:a 1 :b 2} [:a])

Will produce:
{:b 2}
raw docstring

dissoc-all-if

(dissoc-all-if map condition keys)

Assocs all keys with the provided value if the given condition is true.

Assocs all keys with the provided value if the
given condition is true.
raw docstring

dissoc-if

(dissoc-if map condition key)

Dissocs a key-value pair from the map if the given condition is true.

A condition function can be provided as condition, as the following example:

(dissoc-if {:a 0 :b 1} #(<= % 0) :a)

Will produce: {:b 1}, since :a's value is <= 0.

Dissocs a key-value pair from the map
if the given condition is true.

A condition function can be provided as condition,
as the following example:

(dissoc-if {:a 0 :b 1} #(<= % 0) :a)

Will produce:
{:b 1}, since :a's value is <= 0.
raw docstring

merge-maps

(merge-maps map-a map-b)

Merges map-a replacing and appending values from map-b.

Merges map-a replacing and appending values from map-b.
raw docstring

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

× close