(->comparator val-fn)
Returns a comparator where values returning from a value function are compared against
Returns a comparator where values returning from a value function are compared against
Coerces a value into a UUID if possible, otherwise returns nil
Coerces a value into a UUID if possible, otherwise returns nil
(add-shutdown-hook & body)
Adds a shutdown hook using java.lang.Runtime.addShutdownHook. Returns the created Thread
Adds a shutdown hook using java.lang.Runtime.addShutdownHook. Returns the created Thread
(add-shutdown-hook-fn f)
Adds a shutdown hook using java.lang.Runtime.addShutdownHook. Takes a function f
, and returns the created Thread
Adds a shutdown hook using java.lang.Runtime.addShutdownHook. Takes a function `f`, and returns the created Thread
(and-fn pred & more)
Higher order and
.
Takes any number of predicates and returns a function that takes a value
and returns true if ALL individual predicates return true, else return false.
Higher order `and`. Takes any number of predicates and returns a function that takes a value and returns true if ALL individual predicates return true, else return false.
(any? pred coll)
Returns true if any item in coll returns true for pred, otherwise false
Returns true if any item in coll returns true for pred, otherwise false
(apply-when f v)
Invokes f when it's truthy
Invokes f when it's truthy
(assoc-some! tmap k v)
Assocs some value into a transitive map
Assocs some value into a transitive map
Similar to clojure.string/blank? but returns false if given a non-string
Similar to clojure.string/blank? but returns false if given a non-string
(call f v)
Calls the function f
with a value v
Calls the function `f` with a value `v`
Transforms ClojureScript to JavaScript. Converting keys to camelCase by default
Transforms ClojureScript to JavaScript. Converting keys to camelCase by default
(collify)
(collify v)
Puts value v
in a vector if it is not a collection. Returns nil
if no value
Puts value `v` in a vector if it is not a collection. Returns `nil` if no value
(compr)
(compr f)
(compr f g)
(compr f g & more)
Composes functions left to right, the opposite of comp
Composes functions left to right, the opposite of `comp`
(concat!)
(concat! tcoll)
(concat! tcoll seq)
(concat! tcoll seq & more)
Adds the values to the transient collection, returning tcoll. Concatenates of the elements in the supplied sequences
Adds the values to the transient collection, returning tcoll. Concatenates of the elements in the supplied sequences
(conj!)
(conj! tcoll)
(conj! tcoll val)
(conj! tcoll val & more)
Adds val to the transient collection, and return tcoll. The 'addition' may happen at different 'places' depending on the concrete type.
Adds val to the transient collection, and return tcoll. The 'addition' may happen at different 'places' depending on the concrete type.
(conj-some! tcoll v)
Adds a value to the transitive collection if some
Adds a value to the transitive collection if some
(d# a)
Derefs a value if it is derefable
Derefs a value if it is derefable
(diff existing updated)
(diff leaf-pred existing updated)
(diff leaf-pred comparator existing updated)
(diff leaf-pred comparator changed-merger existing updated)
Returns a map of paths which have changed :added, :changed, :removed, and :same
Returns a map of paths which have changed :added, :changed, :removed, and :same
(dissoc-in m path & paths)
Dissociates paths from a map. Any empty maps produced will be removed
Dissociates paths from a map. Any empty maps produced will be removed
(distinct-vals? m)
Returns true if all the map values are unique
Returns true if all the map values are unique
(empty->nil x)
Returns nil
if argument returns true
for (clojure.core/empty?)
Returns `nil` if argument returns `true` for `(clojure.core/empty?)`
(exception? x)
Returns true
if x is a Clojure Throwable or ClojureScript js/Error
Returns `true` if x is a Clojure Throwable or ClojureScript js/Error
(filter-by key-fn pred coll)
Filters a collection where a key matches a predicate e.g. (let [coll [{:id 1} {:id 2}] (filter-by :id (bp/p= 1) coll)) ; returns `({:id 1})
Filters a collection where a key matches a predicate e.g. (let [coll [{:id 1} {:id 2}] (filter-by :id (bp/p= 1) coll)) ; returns `({:id 1})
(filter-key= key-fn value coll)
Filters a collection where a key matches a value e.g. (let [coll [{:id 1} {:id 2}] (filter-key= :id 1 coll)) ; returns `({:id 1})
Filters a collection where a key matches a value e.g. (let [coll [{:id 1} {:id 2}] (filter-key= :id 1 coll)) ; returns `({:id 1})
(filter-nil-keys map)
Filters out all nil key values from a map
Filters out all nil key values from a map
(if-fn pred then)
(if-fn pred then else)
Higher-order if function.
Takes a predicate (pred
), calling then
or (optionally) else
based on the predicate.
Returns nil if no else
defined.
Higher-order if function. Takes a predicate (`pred`), calling `then` or (optionally) `else` based on the predicate. Returns nil if no `else` defined.
Java's Integer/MAX_VALUE for consistence use in Clojure(Script) projects
Java's Integer/MAX_VALUE for consistence use in Clojure(Script) projects
(java->clj j)
(java->clj j key-fn)
Transforms Java to Clojure. Converting keys to kebab-case keywords by default
Transforms Java to Clojure. Converting keys to kebab-case keywords by default
Transforms JavaScript to ClojureScript. Converting keys to kebab-case keywords by default
Transforms JavaScript to ClojureScript. Converting keys to kebab-case keywords by default
(kebab-case->Proper-Kebab-Case kebab-case-str)
(macro? sym)
True if the provided sym
is a macro
True if the provided `sym` is a macro
(map-leaves f coll)
(map-leaves f leaf-pred coll)
Traverses and applies the mapping function to each leaf of a data structure. The mapping function is given the path and value at that path
Traverses and applies the mapping function to each leaf of a data structure. The mapping function is given the path and value at that path
(mod num div)
Modulus of num and div supporting float and decimal values. Truncates toward negative infinity.
Modulus of num and div supporting float and decimal values. Truncates toward negative infinity.
(named? x)
Returns true if x
is named (can be passed to name
)
Returns true if `x` is named (can be passed to `name`)
(namespaced? named)
Returns true if the named
has a namespace
Returns true if the `named` has a namespace
(or-fn pred & more)
Higher order or
.
Takes any number of predicates and returns a function that takes a value
and returns true if ANY individual predicates return true, else return false.
Higher order `or`. Takes any number of predicates and returns a function that takes a value and returns true if ANY individual predicates return true, else return false.
A spectre recursive path navigator, that collects all paths to the occurrences of leaves that match the given predicate. Does not traverse deeper into the matched structures.
A spectre recursive path navigator, that collects all paths to the occurrences of leaves that match the given predicate. Does not traverse deeper into the matched structures.
(re-quote s)
Quotes the regex string
Quotes the regex string
(redact keys m)
(redact keys m redacted-value)
Deeply replaces value of all the keys
in m
with the redacted-value
Deeply replaces value of all the `keys` in `m` with the `redacted-value`
(reduce-leaves f coll)
(reduce-leaves f init coll)
(reduce-leaves f init leaf-pred coll)
Traverses and reduces a data structure where the reducing function is given an accumulator, vector path and value at that path
Traverses and reduces a data structure where the reducing function is given an accumulator, vector path and value at that path
(remove-nil-vals map)
Shallowly removes nil values from a map
Shallowly removes nil values from a map
(remove-prefix prefix s)
(remove-prefix prefix separator s)
Removes the prefix if the string starts with it otherwise ignores, is case sensitive
Removes the prefix if the string starts with it otherwise ignores, is case sensitive
(rename-keys! tmap kmap)
Returns the transient map with the keys in kmap renamed to the vals in kmap
Returns the transient map with the keys in kmap renamed to the vals in kmap
(round-to precision d)
Rounds a given value 'd' to the specified 'precision'
Rounds a given value 'd' to the specified 'precision'
(select-vals m ks)
Selects all values from a map using specified keys. Missing keys return nil
Selects all values from a map using specified keys. Missing keys return nil
(sorted? coll)
(sorted? comp coll)
True if a collection is sorted by means of a 2 or 3 way comparator
True if a collection is sorted by means of a 2 or 3 way comparator
(split-at-first value s)
Splits s at the first occurrence of value, returns nil when s is empty
Splits s at the first occurrence of value, returns nil when s is empty
(subs-inc match s)
Returns the substring of 's' up to and including the 'match' or nil
Returns the substring of 's' up to and including the 'match' or nil
(subs-to match s)
Returns the substring of 's' up until the 'match'
Returns the substring of 's' up until the 'match'
(throw-if-throwable ex)
Throw ex if it's an exception. Retains the message, data, and cause
Throw ex if it's an exception. Retains the message, data, and cause
(transform-keys f coll)
Recursively transforms all map keys in coll with f
Recursively transforms all map keys in coll with f
(translate-keys kmap map)
Updates map with the keys from kmap
Updates map with the keys from kmap
(true-string? s)
True if 's' is the string literal 'true'
True if 's' is the string literal 'true'
(update! tcoll k f)
(update! tcoll k f x)
(update! tcoll k f x y)
(update! tcoll k f x y z)
(update! tcoll k f x y z & more)
'Updates' a value in an transient associative structure, where k is a key and f is a function that will take the old value and any supplied args and return the new value, and returns a new structure. If the key does not exist, nil is passed as the old value.
'Updates' a value in an transient associative structure, where k is a key and f is a function that will take the old value and any supplied args and return the new value, and returns a new structure. If the key does not exist, nil is passed as the old value.
(update-some m k f & args)
Updates a key in a map with a function, only if the key is present and the result of f
is not nil.
Updates a key in a map with a function, only if the key is present and the result of `f` is not nil.
(update-some! tmap k f)
Replaces the value of a key in a transitive map if the result of the function is some
Replaces the value of a key in a transitive map if the result of the function is some
(uuid-str? s)
True if 's' is a string and matches the UUID format
True if 's' is a string and matches the UUID format
(xor)
(xor x)
(xor x y)
(xor x y & more)
Returns true
only if one argument is true
Returns `true` only if one argument is `true`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close