(->int value)
Coerce a given value
as integer. If the value
is not a number, returns nil
.
Coerce a given `value` as integer. If the `value` is not a number, returns `nil`.
(->uuid value)
Coerce a given value
as java.util.UUID
. When the value
is not a valid UUID, it returns nil
.
In ClojureScript there is not UUID class/function (not even in Google Closure Library). Thus in ClojureScript
it returns just string
value for non-blank value
.
Coerce a given `value` as `java.util.UUID`. When the `value` is not a valid UUID, it returns `nil`. In ClojureScript there is not UUID class/function (not even in Google Closure Library). Thus in ClojureScript it returns just `string` value for non-blank `value`.
(case+ e & clauses)
Same as case, but evaluates dispatch values, needed for referring to class and defined constants as well as java.util.Enum instances.
Inspirated by: https://github.com/damballa/abracad/blob/master/src/clojure/abracad/avro/util.clj
Same as case, but evaluates dispatch values, needed for referring to class and defined constants as well as java.util.Enum instances. Inspirated by: https://github.com/damballa/abracad/blob/master/src/clojure/abracad/avro/util.clj
(if-let* bindings then)
(if-let* bindings then else)
Taken from https://clojuredocs.org/clojure.core/if-let. It's if-let with multiple bindings. It allows to flatten and simplify some code nesting, for instance: From (if-let [some-x (x)] (if-let [some-y (y)] (if-let [some-z (z)] :found :not-found) :not-found) :not-found) into (if-let* [some-x (x) some-y (y) some-z (z)] :found :not-found)
It doesn't work in ClojureScript.
Taken from https://clojuredocs.org/clojure.core/if-let. It's if-let with multiple bindings. It allows to flatten and simplify some code nesting, for instance: From (if-let [some-x (x)] (if-let [some-y (y)] (if-let [some-z (z)] :found :not-found) :not-found) :not-found) into (if-let* [some-x (x) some-y (y) some-z (z)] :found :not-found) It doesn't work in ClojureScript.
Lower cases first character of a given value
. It's safe, when the value
is nil
or empty string
returns nil
,
otherwise string.
Lower cases first character of a given `value`. It's safe, when the `value` is `nil` or empty `string` returns `nil`, otherwise `string.`
(non-blank input)
Return a given input
when it isn't nil
. Otherwise nil
is returned. It's useful for some->
macros.
Return a given `input` when it isn't `nil`. Otherwise `nil` is returned. It's useful for `some->` macros.
(update-keys f m)
(update-keys f x m)
(update-keys f x y m)
(update-keys f x y z m)
(update-keys f x y z more m)
Applies a given function f
on every key in a given associative structure m
, where f
is a function
that will take a key-name and any supplied args and return new value.
Applies a given function `f` on every key in a given associative structure `m`, where `f` is a function that will take a key-name and any supplied args and return new value.
(update-vals f coll)
Applies a given function f
on every value in a given coll
.
Applies a given function `f` on every value in a given `coll`.
Upper cases first character of a given value
. It's safe, when the value
is nil
or empty string
returns nil
,
otherwise string.
Upper cases first character of a given `value`. It's safe, when the `value` is `nil` or empty `string` returns `nil`, otherwise `string.`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close