(->json m)
Convert map m
to JSON string.
Convert map `m` to JSON string.
(->skewer-kw x)
Converts x
to skewer keyword.
Converts `x` to skewer keyword.
Adds JSON encodes default to str
to not blow up EDN->JSON conversions.
Adds JSON encodes default to `str` to not blow up EDN->JSON conversions.
(apply-f-to-keys f m)
Recursively transforms all map keys from keywords to strings.
Recursively transforms all map keys from keywords to strings.
(coin-toss?)
Equal chance for true or false.
Equal chance for true or false.
Default label replacements, mostly acronyms and abbreviations.
Default label replacements, mostly acronyms and abbreviations.
(force-in-range min max v)
Force numeric value v
in range with min
and max
.
Force numeric value `v` in range with `min` and `max`.
(generate-random-uuid)
Generates random UUID string.
Generates random UUID string.
(joda? x)
Determine if x
is a Joda DateTime instance.
Determine if `x` is a Joda DateTime instance.
Atom for label replacement map.
Atom for label replacement map.
(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.
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 x)
Converts element name x
to a label.
Converts element name `x` to a label.
(normalize-words s)
Normalize each word in s
.
Normalize each word in `s`.
(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
.
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 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
.
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 v x & xs)
Politely conjoins element x
to list v
iff x
is non-nil.
Politely conjoins element `x` to list `v` iff `x` is non-nil.
(random-double)
Generates random double.
Generates random double.
(replace-labels v)
Replace label v
with replacement, otherwise pass through v
.
Replace label `v` with replacement, otherwise pass through `v`.
(replace-with rs v)
Returns value in replacement map rs
if the key v
exists
in rs
. Otherwise, returns v
.
Returns value in replacement map `rs` if the key `v` exists in `rs`. Otherwise, returns `v`.
(safe-nth c ndx)
Safe nth against collection c
and index ndx
. Returns nil
if exception.
Safe nth against collection `c` and index `ndx`. Returns `nil` if exception.
(stack-assoc m k v)
Associates key k
and value v
to map m
.
Associates key `k` and value `v` to map `m`.
(strict-double? x)
Determines if x
is a strict double
.
Determines if `x` is a strict `double`.
(strict-float? x)
Determines if x
is a strict float
.
Determines if `x` is a strict `float`.
(strict-int? x)
Determines if x
is a strict int
.
Determines if `x` is a strict `int`.
(strict-long? x)
Determines if x
is strict long
.
Determines if `x` is strict `long`.
(vls? x)
Determines if x
is a vector, set, or list.
Determines if `x` is a vector, set, or list.
(walk-apply-key-f kf kv)
Apply key function kv
to key-value pair kv
. Used to walk map.
Apply key function `kv` to key-value pair `kv`. Used to walk map.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close