(add-map-key-prefix prefix-str m)
Assumes map keys are keywords
Assumes map keys are keywords
(add-prefix-to-map-keys m prefix-str keys-seq)
Changes map so that keys given in keys-seq are prefixed with prefix-str, assumes keys are keywords.
Changes map so that keys given in keys-seq are prefixed with prefix-str, assumes keys are keywords.
(all-not-nil? & args)
Expects args to be a sequence. Can't use (and) as (and) is a macro, https://clojuredocs.org/clojure.core/and
Expects args to be a sequence. Can't use (and) as (and) is a macro, https://clojuredocs.org/clojure.core/and
(convert-dash-keys->underscores m)
Replaces all map keys with - in them with _
Replaces all map keys with - in them with _
(distinct-by f)
(distinct-by f coll)
Basically (distinct), but you can pass it a function to compare by
Returns a lazy sequence of the elements of coll, removing any elements that return duplicate values when passed to a function f. From https://crossclj.info/fun/medley.core/distinct-by.html
Basically (distinct), but you can pass it a function to compare by Returns a lazy sequence of the elements of coll, removing any elements that return duplicate values when passed to a function f. From https://crossclj.info/fun/medley.core/distinct-by.html
(fn-helper in-fn in-var)
For use in threading macros -> and ->>, so that inline/lamba functions can be defined and called in the threading macro.
For use in threading macros -> and ->>, so that inline/lamba functions can be defined and called in the threading macro.
(get-keys-paths-in-map m)
Given a map, returns a vec of all the key-path vecs in the map. Only shows the full leaf paths, so no partial paths with more nodes underneath it. from http://stackoverflow.com/questions/21768802/how-can-i-get-the-nested-keys-of-a-map-in-clojure
Given a map, returns a vec of all the key-path vecs in the map. Only shows the full leaf paths, so no partial paths with more nodes underneath it. from http://stackoverflow.com/questions/21768802/how-can-i-get-the-nested-keys-of-a-map-in-clojure
(get-log-level-int log-level)
(get-ordered-map m ordered-keys-vec)
(get-utc-now)
Get unix timestamp for right now
Get unix timestamp for right now
(has-keys? m key_vec)
(if-helper check-var in-fn in-var)
For use in threading macros, if check-var is true, returns (in-fn in-var), otherwise in-var.
For use in threading macros, if check-var is true, returns (in-fn in-var), otherwise in-var.
(in? seq elm)
true if seq contains elem, else false
true if seq contains elem, else false
(is-blank-string? in-str)
(jas predicate & message)
Javascript Assert for a truth value only
Javascript Assert for a truth value only
(logl log-level in-str)
(logl* in-str)
(logl-npprint-vec log-level str-vec clj-obj-vec)
Prevents npprint from evaluating if there is no logging to be done, as pprint is extremely slow, and when flagged as not used in production via a :debug level, should not execute. Without this, with eager and not lazy evaluation, pprint will execute even if logging level is low.
Takes in 2 vecs, one for strings, and the other for clj-objs to npprint, interleaved together. e.g. ['abc: '] [clj-obj1] will give (str 'abc: ' (npprint clj-obj1))
Assumes length of str-vec is greater or equal than clj-obj-vec
Prevents npprint from evaluating if there is no logging to be done, as pprint is extremely slow, and when flagged as not used in production via a :debug level, should not execute. Without this, with eager and not lazy evaluation, pprint will execute even if logging level is low. Takes in 2 vecs, one for strings, and the other for clj-objs to npprint, interleaved together. e.g. ['abc: '] [clj-obj1] will give (str 'abc: ' (npprint clj-obj1)) Assumes length of str-vec is greater or equal than clj-obj-vec
(not-blank-str? in-str)
(npprint clj-obj)
convenience wrapper around pprint to string, mostly for keeping the pprint import in one place
convenience wrapper around pprint to string, mostly for keeping the pprint import in one place
(positions pred coll)
e.g. (def v ["one" "two" "three" "two"]) (positions #{"two"} v) ; -> (1 3) from http://stackoverflow.com/questions/4830900/how-do-i-find-the-index-of-an-item-in-a-vector
e.g. (def v ["one" "two" "three" "two"]) (positions #{"two"} v) ; -> (1 3) from http://stackoverflow.com/questions/4830900/how-do-i-find-the-index-of-an-item-in-a-vector
(print-vec-to-str print-type str-vec clj-obj-vec)
Inputs: [print-type :- (ps/pred (fn* [p1__13458#] (in? [:normal-str :npprint] p1__13458#))) str-vec clj-obj-vec]
Takes in 2 vecs, one for strings, and the other for clj-objs to npprint, interleaved together. e.g. ['abc: '] [clj-obj1] will give (str 'abc: ' (npprint clj-obj1))
Assumes length of str-vec is greater or equal than clj-obj-vec.
Either does plain old str on uses npprint.
Inputs: [print-type :- (ps/pred (fn* [p1__13458#] (in? [:normal-str :npprint] p1__13458#))) str-vec clj-obj-vec] Takes in 2 vecs, one for strings, and the other for clj-objs to npprint, interleaved together. e.g. ['abc: '] [clj-obj1] will give (str 'abc: ' (npprint clj-obj1)) Assumes length of str-vec is greater or equal than clj-obj-vec. Either does plain old str on uses npprint.
Inputs: [print-type :- (ps/pred (fn* [p1__16932#] (in? [:normal-str :npprint] p1__16932#))) str-vec clj-obj-vec]
Takes in 2 vecs, one for strings, and the other for clj-objs to npprint, interleaved together. e.g. ['abc: '] [clj-obj1] will give (str 'abc: ' (npprint clj-obj1))
Assumes length of str-vec is greater or equal than clj-obj-vec.
Either does plain old str on uses npprint.
Inputs: [print-type :- (ps/pred (fn* [p1__16932#] (in? [:normal-str :npprint] p1__16932#))) str-vec clj-obj-vec] Takes in 2 vecs, one for strings, and the other for clj-objs to npprint, interleaved together. e.g. ['abc: '] [clj-obj1] will give (str 'abc: ' (npprint clj-obj1)) Assumes length of str-vec is greater or equal than clj-obj-vec. Either does plain old str on uses npprint.
(reduce-indexed f coll)
(reduce-indexed f init coll)
(reduce-indexed f init i coll)
Reduce while adding an index as the second argument to the function function signature for inner function is [in-coll idx var] from https://crossclj.info/fun/mc.util/reduce-indexed.html, unable to find on clojars
Reduce while adding an index as the second argument to the function function signature for inner function is [in-coll idx var] from https://crossclj.info/fun/mc.util/reduce-indexed.html, unable to find on clojars
(rename-map-keys m in-regex replacement-str)
Assumes map keys are keywords
Assumes map keys are keywords
(repl-log in-str)
Needed so only in repl will this fire, otherwise will print out twice to console for everything
Needed so only in repl will this fire, otherwise will print out twice to console for everything
(select-keys-regex m regex)
Same as (select-keys), but does a regex search on the key names instead of by a straight list
Same as (select-keys), but does a regex search on the key names instead of by a straight list
(set-clj-log4j-logger logger-name-str)
(should-log? log-level)
Uses global var current-log-level
Uses global var current-log-level
(sp-table keys-vec vec-of-maps)
Wrapper around print-table so it'll work easily with logl.
Wrapper around print-table so it'll work easily with logl.
(underscores->- in-str)
Replace underscores with dashes
Replace underscores with dashes
(when-helper check-fn in-var)
For use in threading macros some-> and some->>, if check-fn passes, returns val, otherwise nil.
For use in threading macros some-> and some->>, if check-fn passes, returns val, otherwise nil.
(word-count* in-str)
Exactly as it sounds, counts the number of words in in-str
Exactly as it sounds, counts the number of words in in-str
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close