Liking cljdoc? Tell your friends :D

discljord-utils.util


clojurise-json-keyclj

(clojurise-json-key k)

Converts JSON string keys (e.g. "fullName") to Clojure keyword keys (e.g. :full-name).

Converts JSON string keys (e.g. "fullName") to Clojure keyword keys (e.g. :full-name).
sourceraw docstring

exitclj

(exit)
(exit status-code)
(exit status-code message)

Exits the program after printing the given message, and returns the given status code.

Exits the program after printing the given message, and returns the given status code.
sourceraw docstring

getrnclj

(getrn m k nf)

Like get, but also replaces nil values found in the map with the default value.

Like get, but also replaces nil values found in the map with the default value.
sourceraw docstring

human-readable-date-diffclj

(human-readable-date-diff i1 i2)

Returns a string containing the human readable difference between two instants e.g. "4d 2h 37m 12.379s"

Returns a string containing the human readable difference between two instants e.g. "4d 2h 37m 12.379s"
sourceraw docstring

human-readable-sizeclj

(human-readable-size size)

Returns a string containing a rounded human readable size of the given number of bytes e.g. 1024 -> "1KB", 1234567890 -> "1.15GB"

Returns a string containing a rounded human readable size of the given number of bytes e.g. 1024 -> "1KB", 1234567890 -> "1.15GB"
sourceraw docstring

in-tzcljmacro

(in-tz tz & body)

Executes body (assumed to include java-time logic) within the given tzdata timezone (e.g. "Americas/Los_Angeles").

Executes body (assumed to include java-time logic) within the given tzdata timezone (e.g. "Americas/Los_Angeles").
sourceraw docstring

log-exceptionclj

(log-exception e)
(log-exception e msg)

Logs the given exception and (optional) message at ERROR level.

Logs the given exception and (optional) message at ERROR level.
sourceraw docstring

mapfonkclj

(mapfonk f m)

Returns a new map where f has been applied to all of the keys of m.

Returns a new map where f has been applied to all of the keys of m.
sourceraw docstring

mapfonvclj

(mapfonv f m)

Returns a new map where f has been applied to all of the values of m.

Returns a new map where f has been applied to all of the values of m.
sourceraw docstring

nth-fibonacciclj

(nth-fibonacci n)

Returns the nth fibonacci.

Returns the nth fibonacci.
sourceraw docstring

parse-intclj

(parse-int x)

Parses a value (a string or numeric) into a Clojure integer (Java Long or BigInteger), returning nil if parsing failed. Note: redundant in Clojure v1.11+.

Parses a value (a string or numeric) into a Clojure integer (Java Long or BigInteger), returning nil if parsing failed.  Note: redundant in Clojure v1.11+.
sourceraw docstring

replace-allclj

(replace-all string replacements)

Takes a sequence of replacements, and applies all of them to the given string, in the order provided. Each replacement in the sequence is a pair of values to be passed to clojure.string/replace (the 2nd and 3rd arguments).

Takes a sequence of replacements, and applies all of them to the given string, in the order provided.  Each replacement in the sequence is a pair of values to be passed to clojure.string/replace (the 2nd and 3rd arguments).
sourceraw docstring

to-asciiclj

(to-ascii s)

Converts the given string to ASCII, mapping a small number of Unicode characters (whitespace, hyphens, single & double quotes) to their ASCII equivalents and stripping the rest.

Converts the given string to ASCII, mapping a small number of Unicode characters (whitespace, hyphens, single & double quotes) to their ASCII equivalents and stripping the rest.
sourceraw docstring

truncateclj

(truncate s len)

If s is longer than len, truncates it to len-1, trims any whitespace on the right, then adds the Unicode ellipsis (…) character to the end.

If s is longer than len, truncates it to len-1, trims any whitespace on the right, then adds the Unicode ellipsis (…) character to the end.
sourceraw docstring

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

× close