diction.util
->edn
(->edn s)
Convert JSON string `s` to map.
->json
(->json m)
Convert map `m` to JSON string.
->skewer
(->skewer s)
Convert `s` to skewer case.
->skewer-kw
(->skewer-kw x)
Converts `x` to skewer keyword.
->snake
(->snake s)
Convert `s` to snake case.
add-encoders-result
Adds JSON encodes default to `str` to not blow up EDN->JSON conversions.
apply-f-to-keys
added in 1.1
(apply-f-to-keys f m)
Recursively transforms all map keys from keywords to strings.
coin-toss?
(coin-toss?)
Equal chance for true or false.
default-label-replacements
Default label replacements, mostly acronyms and abbreviations.
force-in-range
(force-in-range min max v)
Force numeric value `v` in range with `min` and `max`.
generate-random-uuid
(generate-random-uuid)
Generates random UUID string.
joda?
(joda? x)
Determine if `x` is a Joda DateTime instance.
json-encode-to-string-classes
label-replacements
Atom for label replacement map.
label-replacements!
(label-replacements! lrs)
Sets the label replacements with `lrs` map.
`lrs` should have the string key with only the first letter capitalized
(`Id` no `id`), and the value the prettified word or abbreviation.
labelize-element
(labelize-element x)
Converts element name `x` to a label.
normalize-words
(normalize-words s)
Normalize each word in `s`.
polite-assoc
(polite-assoc m k v)
Politely associates in map `m` with key `k` the value `v` iff
both the key `k` and `v` are non-nil AND there is no existing value
in the map `m` located at key `k`.
polite-assoc-in
(polite-assoc-in m ks v)
Politely associates in map `m` with nested keys `ks` the value `v` iff
both the keys `ks` and `v` are non-nil AND there is no existing value
in the map `m` located at the keys `ks`.
polite-conj
(polite-conj v x & xs)
Politely conjoins element `x` to list `v` iff `x` is non-nil.
random-double
(random-double)
random-float
(random-float)
replace-labels
(replace-labels v)
Replace label `v` with replacement, otherwise pass through `v`.
replace-with
(replace-with rs v)
Returns value in replacement map `rs` if the key `v` exists
in `rs`. Otherwise, returns `v`.
rndm
Generates a random number.
safe-nth
(safe-nth c ndx)
Safe nth against collection `c` and index `ndx`. Returns `nil` if exception.
skewer-keys
Convert keys to skewer-case.
snake-keys
Convert keys to snake_case.
stack-assoc
(stack-assoc m k v)
Associates key `k` and value `v` to map `m`.
strict-double?
(strict-double? x)
Determines if `x` is a strict `double`.
strict-float?
(strict-float? x)
Determines if `x` is a strict `float`.
strict-int?
(strict-int? x)
Determines if `x` is a strict `int`.
strict-long?
(strict-long? x)
Determines if `x` is strict `long`.
vls?
(vls? x)
Determines if `x` is a vector, set, or list.
walk-apply-key-f
(walk-apply-key-f kf kv)
Apply key function `kv` to key-value pair `kv`. Used to walk map.