### Known presets
(asDecodedEdnFile filename)
Decodes the contents of a file as a JSON object.
Decodes the contents of a file as a JSON object.
(asDecodedEdnValue s)
Decodes the value as an EDN structure.
Decodes the value as an EDN structure.
(asDecodedJsonFile filename)
Decodes the contents of a file as a JSON object.
Decodes the contents of a file as a JSON object.
(asDecodedJsonValue s)
Decodes the value as a JSON object.
Decodes the value as a JSON object.
(asDecodedYamlFile filename)
Decodes the contents of a file as a JSON object.
Decodes the contents of a file as a JSON object.
(asDecodedYamlValue s)
Decodes the value as a YAML object.
Decodes the value as a YAML object.
(asLinesString filename)
Reads a text file and returns it as a collection of lines.
Reads a text file and returns it as a collection of lines.
(asSet st v)
Sets of options are dark black magic. They are also darn useful.
A set can be composed of all-keywords or all-strings.
Values are matched ignoring case, and the correct one is returned in the case and type it appears in the set. The default value, if present, is returned as-is, even if not a member of the set.
Keywords are accepted with our without trailing :
.
On missing values, the closest matches are searched and printed.
For example, on a set #{:a :b :c}, A
a
:A
and :a
all match :a
.
Defaults for a set are all values, with no colons, separated by a pipe.
Sets of options are dark black magic. They are also darn useful. A set can be composed of all-keywords or all-strings. Values are matched ignoring case, and the correct one is returned in the case and type it appears in the set. The default value, if present, is returned as-is, even if not a member of the set. Keywords are accepted with our without trailing `:`. On missing values, the closest matches are searched and printed. For example, on a set #{:a :b :c}, `A` `a` `:A` and `:a` all match `:a`. Defaults for a set are all values, with no colons, separated by a pipe.
(asSingleString filename)
Turns a filename into a single string.
If argument is a String, it tries to resolve it first as a URI, then as a local file name. URIs with a 'file' protocol are converted to local file names.
Turns a filename into a single string. If argument is a String, it tries to resolve it first as a URI, then as a local file name. URIs with a 'file' protocol are converted to local file names.
(parseFlag flagStr)
Converts a flag string to a boolean. Comparison is case-insensitive.
Converts a flag string to a boolean. Comparison is case-insensitive.
(set-find-didyoumean st v)
Finds candidates after normalization. Return original candidates.
Finds candidates after normalization. Return original candidates.
(set-find-didyoumean-str st v)
Returns ' Did you mean A or B?' or '' if no candidates.
Returns ' Did you mean A or B?' or '' if no candidates.
(set-find-value st v)
Finds a string value in a set of options. To do this, we first create a map of {normalized original} Returns valFound or nil.
Finds a string value in a set of options. To do this, we first create a map of {normalized original} Returns valFound or nil.
(set-help-values st)
Given a set, return allowed options as string
Given a set, return allowed options as string
(set-normalize-map st)
Builds a normalized map that has as key the normalized value, and value the original one.
Builds a normalized map that has as key the normalized value, and value the original one.
(set-normalized-entry v)
A normalized set entry is a lowercase string
without trailing :
.
A normalized set entry is a lowercase string without trailing `:`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close