(all-regex? m)
Checks if all values of a map are regexes
Checks if all values of a map are regexes
(build-css-attrs attr-val)
Given a map of attribute-value pairs, build the latter portion of a CSS query that follows the tag.
Given a map of attribute-value pairs, build the latter portion of a CSS query that follows the tag.
(build-css-with-hierarchy v-of-attr-vals)
Given a vector of queries in hierarchical order, create a CSS query.
For example: [{:tag :div, :id "content"}, {:tag :a, :class "external"}]
would
produce the CSS query "div[id='content'] a[class='external']"
Given a vector of queries in hierarchical order, create a CSS query. For example: `[{:tag :div, :id "content"}, {:tag :a, :class "external"}]` would produce the CSS query "div[id='content'] a[class='external']"
(build-query attr-val)
(build-query attr-val output)
(build-query attr-val output prefix)
Given a map of attribute-value pairs, generate XPath or CSS based on output
. Optionally include a prefix
to specify whether this should be a :global
"top-level" query or a :local
, child query.
Given a map of attribute-value pairs, generate XPath or CSS based on `output`. Optionally include a `prefix` to specify whether this should be a `:global` "top-level" query or a `:local`, child query.
(build-xpath-attrs attr-val)
Given a map of attribute-value pairs, build the bracketed portion of an XPath query that follows the tag
Given a map of attribute-value pairs, build the bracketed portion of an XPath query that follows the tag
(build-xpath-with-hierarchy v-of-attr-vals)
Given a vector of queries in hierarchical order, create XPath.
For example: [{:tag :div, :id "content"}, {:tag :a, :class "external"}]
would
produce the XPath "//div[@id='content']//a[@class='external']
Given a vector of queries in hierarchical order, create XPath. For example: `[{:tag :div, :id "content"}, {:tag :a, :class "external"}]` would produce the XPath "//div[@id='content']//a[@class='external']
(camel-case-to-dashes s)
Convert Pascal-case to dashes. This takes into account edge cases like fooJSBar
and fooBarB
, where dashed versions will be foo-jS-bar
and foo-barB
respectively.
Convert Pascal-case to dashes. This takes into account edge cases like `fooJSBar` and `fooBarB`, where dashed versions will be `foo-jS-bar` and `foo-barB` respectively.
(clojure-keys m)
Recursively transforms all map keys from strings to keywords, converting Pascal-case to dash-separated.
Recursively transforms all map keys from strings to keywords, converting Pascal-case to dash-separated.
(contains-regex? m)
Checks if the values of a map contain a regex
Checks if the values of a map contain a regex
(dashes-to-camel-case s)
A simple conversion of -x
to X
for the given string.
A simple conversion of `-x` to `X` for the given string.
(elim-breaks s)
Eliminate line breaks; used for REPL printing
Eliminate line breaks; used for REPL printing
(filter-regex-entries m)
Given a map m
, return a map containing only entries whose values are regular expressions.
Given a map `m`, return a map containing only entries whose values are regular expressions.
(first-n-chars s)
(first-n-chars s n)
Get first n characters of s
, then add ellipsis
Get first n characters of `s`, then add ellipsis
(java-keys m)
Recursively transforms all map keys from keywords into strings, converting dash-separated to Pascal-case.
Recursively transforms all map keys from keywords into strings, converting dash-separated to Pascal-case.
(remove-regex-entries m)
Given a map m
, return a map containing only entries whose values are NOT regular expressions.
Given a map `m`, return a map containing only entries whose values are NOT regular expressions.
(when-attr obj & body)
Special when
macro for checking if an attribute isn't available or is an empty string
Special `when` macro for checking if an attribute isn't available or is an empty string
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close