General purpose utility fns that I seem to end up needing in every single project I write... Note: this namespace is not part of the public API of lice-comb and may change without notice.
General purpose utility fns that I seem to end up needing in every single project I write... Note: this namespace is not part of the public API of lice-comb and may change without notice.
(base62-decode s)
Decodes the given Base62/UTF-8 string.
Decodes the given Base62/UTF-8 string.
(base62-encode s)
Encodes the given string to Base62/UTF-8.
Encodes the given string to Base62/UTF-8.
(escape-re s)
Escapes the given string for use in a regex.
Escapes the given string for use in a regex.
Returns just the name component of the given file-like thing (String, File, ZipEntry, URI, URL), excluding any parents.
Returns just the name component of the given file-like thing (String, File, ZipEntry, URI, URL), excluding any parents.
Returns the full path and name of the given file-like thing (String, File, ZipEntry, URI, URL).
Returns the full path and name of the given file-like thing (String, File, ZipEntry, URI, URL).
(getenv var)
(getenv var default)
Obtain the given environment variable, returning default (or nil, if default is not provided) if it isn't set.
Obtain the given environment variable, returning default (or nil, if default is not provided) if it isn't set.
(is-digits? s)
Does the given string contains digits only?
Does the given string contains digits only?
(map-pad f & cs)
Like map, but when presented with multiple collections of different lengths, 'pads out' the missing elements with nil rather than terminating early.
Like map, but when presented with multiple collections of different lengths, 'pads out' the missing elements with nil rather than terminating early.
(mapfonv f m)
Returns a new map where f has been applied to all of the values of m.
Returns a new map where f has been applied to all of the values of m.
(nset coll)
nil preserving version of clojure.core/set
nil preserving version of clojure.core/set
(re-concat & res)
Concatenate all of the given regexes or strings into a single regex.
Concatenate all of the given regexes or strings into a single regex.
(readable-dir? d)
Is d (a String or File) a readable directory?
Is d (a String or File) a readable directory?
Is f (a String, File, InputStream, or Reader) a readable file?
Is f (a String, File, InputStream, or Reader) a readable file?
(simplify-uri uri)
Simplifies a URI (which can be a string, java.net.URL, or java.net.URI) if possible, returning a String. Returns nil if the input is nil or blank.
Simplifies a URI (which can be a string, java.net.URL, or java.net.URI) if possible, returning a String. Returns nil if the input is nil or blank.
(strim s)
nil safe version of clojure.string/trim
nil safe version of clojure.string/trim
(valid-http-uri? s)
Returns true if given string is a valid HTTP or HTTPS URI.
Returns true if given string is a valid HTTP or HTTPS URI.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close