Liking cljdoc? Tell your friends :D

e85th.commons.ext

Fns applicable to both jvm and js

Fns applicable to both jvm and js
raw docstring

as-collclj/s

(as-coll x)
source

as-vectorclj/s

(as-vector x)
source

assoc-in+clj/s

(assoc-in+ m & path-vals)

Similar to assoc-in except can specify multiple kv pairs

Similar to assoc-in except can specify multiple kv pairs
sourceraw docstring

assoc-someclj/s

(assoc-some m k v)
(assoc-some m k v & kvs)

Associate a key k to map m if v is not nil.

Associate a key `k` to map `m` if `v` is not nil.
sourceraw docstring

camel-case-keysclj/s

(camel-case-keys m)

Camel case all keys in map m.

Camel case all keys in map m.
sourceraw docstring

camel-case-keywordclj/s

(camel-case-keyword x)

Namespace is omitted in returned value.

Namespace is omitted in returned value.
sourceraw docstring

conform-mapclj/s

(conform-map map kmap)

select-keys on map with keys from kmap and renamed keys to be from kmap.

select-keys on map with keys from kmap and renamed keys to be from kmap.
sourceraw docstring

deep-mergeclj/s

(deep-merge a b)
Deep merge a data structure. Taken from http://stackoverflow.com/questions/17327733/merge-two-complex-data-structures
sourceraw docstring

dissoc-inclj/s

(dissoc-in m [k & ks :as keys])

Dissociates an entry from a nested associative structure returning a new nested structure. keys is a sequence of keys. Any empty maps that result will not be present in the new structure.

Dissociates an entry from a nested associative structure returning a new
nested structure. keys is a sequence of keys. Any empty maps that result
will not be present in the new structure.
sourceraw docstring

elide-pathsclj/s

(elide-paths elision-value coll & paths)
source

elide-paths*clj/s

(elide-paths* coll & paths)

paths is a collection of vectors that can be used to navigate a collection. Each path must be a non empty vector otherwise that path is skipped.

paths is a collection of vectors that can be used to
navigate a collection. Each path must be a non empty
vector otherwise that path is skipped.
sourceraw docstring

elide-valsclj/s

(elide-vals key-set m)
(elide-vals elision-value key-set m)

Walks the map eliding the values whose key appears in key-set.

Walks the map eliding the values whose key appears in key-set.
sourceraw docstring

elidedclj/s

source

filter-keysclj/s

(filter-keys pred m)

Apply pred a one arity function to each map key and include the map entry if pred returns truthy.

Apply `pred` a one arity function to each map key and
include the map entry if `pred` returns truthy.
sourceraw docstring

filter-kvclj/s

(filter-kv pred m)

Apply pred a two arity function to each map entry and include the map entry if pred returns truthy.

Apply `pred` a two arity function to each map entry
and include the map entry if `pred` returns truthy.
sourceraw docstring

filter-valsclj/s

(filter-vals pred m)

Apply pred a one arity function to each map val and include the map entry if pred returns truthy.

Apply `pred` a one arity function to each map val and
include the map entry if `pred` returns truthy.
sourceraw docstring

group-by+clj/s

(group-by+ key-fn val-fn xs)
(group-by+ key-fn val-fn val-agg-fn xs)

Similar to group by, but allows applying val-fn to each item in the grouped by list of each key. Can also apply val-agg-fn to the result of mapping val-fn. All input fns are 1 arity. If val-fn and val-agg-fn were the identity fn then this behaves the same as group-by.

Similar to group by, but allows applying val-fn to each item in the grouped by list of each key.
Can also apply val-agg-fn to the result of mapping val-fn. All input fns are 1 arity.
If val-fn and val-agg-fn were the identity fn then this behaves the same as group-by.
sourceraw docstring

intersect-withclj/s

(intersect-with f map-1 map-2)

Returns a map whose keys exist in boty map-1 and map-2. f is a 2 arity function that is invoked wht the value from map-1 and map-2 respectively for each matching key.

Returns a map whose keys exist in boty map-1 and map-2. f is a 2 arity function
that is invoked wht the value from map-1 and map-2 respectively for each matching key.
sourceraw docstring

key=clj/s

(key= k v)

Returns a predicate that takes a map as an argument. The predicate applies k to the map and does an equality check against v.

Returns a predicate that takes a map as an argument.
The predicate applies k to the map and does an equality check against v.
sourceraw docstring

keyword->symbolclj/s

(keyword->symbol k)
source

lisp-case-keysclj/s

(lisp-case-keys m)

Lisp case all keys in map m.

Lisp case all keys in map m.
sourceraw docstring

lisp-case-keywordclj/s

(lisp-case-keyword x)

Turns :helloHow to :hello-how Namespace is omitted in returned value.

Turns :helloHow to :hello-how
Namespace is omitted in returned value.
sourceraw docstring

map-keysclj/s

(map-keys f m)

Applies a function f to each key in map m. This is shallow, it does not walk m.

Applies a function `f` to each key in map `m`.
This is shallow, it does not walk `m`.
sourceraw docstring

map-kvclj/s

(map-kv f m)

Apply f a two arity function to each map entry in m.

Apply `f` a two arity function to each
map entry in `m`.
sourceraw docstring

map-valsclj/s

(map-vals f m)

Applies a function f to each value in map m. This is shallow, it does not walk m.

Applies a function `f` to each value in map `m`.
This is shallow, it does not walk `m`.
sourceraw docstring

not-blank?clj/s

Opposite of str/blank

Opposite of str/blank
sourceraw docstring

parse-boolclj/s

(parse-bool x)
(parse-bool x true-set)
source

parse-doubleclj/s

(parse-double s)
(parse-double s default)
source

parse-floatclj/s

(parse-float s)
(parse-float s default)
source

parse-intclj/s

(parse-int s)
(parse-int s default)
source

parse-longclj/s

(parse-long s)
(parse-long s default)
source

parse-uuidclj/s

(parse-uuid s)
(parse-uuid s default)
source

prune-mapclj/s

(prune-map m)
(prune-map m pred)

Prunes the map according to pred

Prunes the map according to `pred`
sourceraw docstring

random-uuidclj/s

(random-uuid)

Generates a new uuid.

Generates a new uuid.
sourceraw docstring

remove-keysclj/s

(remove-keys pred m)
source

remove-kvclj/s

(remove-kv pred m)
source

remove-valsclj/s

(remove-vals pred m)
source

symbol->keywordclj/s

(symbol->keyword sym)
source

try-parseclj/s

(try-parse f s default)
source

unqualifyclj/s

(unqualify x)

Unqualifies a keyword or symbol. Given :hello/world => :world. Given 'hello/world returns 'world.

Unqualifies a keyword or symbol. Given :hello/world => :world.
Given 'hello/world returns 'world.
sourceraw docstring

walkclj/s

(walk kv-fn m)
(walk key-fn val-fn m)

Adapted from clojure.walk/keywordize-keys. Uses walk/postwalk and calls key-fn on each key and val-fn on each value for each map entry. The 2 arity version invokes kv-fn for each map entry. Recursively changes all keys and values as specified by kv-fn or key-fn and val-fn.

Adapted from clojure.walk/keywordize-keys. Uses `walk/postwalk`
and calls `key-fn` on each key and `val-fn` on each value
for each map entry.  The 2 arity version invokes `kv-fn`
for each map entry. Recursively changes all keys and values
as specified by `kv-fn` or `key-fn` and `val-fn`.
sourceraw docstring

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

× close