(call-if pred f)
Takes a single argument. If applying pred
to the argument yields a truthy value returns the
result of applying f
to the argument, otherwise returns the argument itself.
Takes a single argument. If applying `pred` to the argument yields a truthy value returns the result of applying `f` to the argument, otherwise returns the argument itself.
Given a file object returns a set containing the file itself and the transitive union of its parents. Note: The ancestry is derived exclusively by traversing the file values, i.e. does not matter whether or not the files thus traversed exist in an underlying file system.
Given a file object returns a set containing the file itself and the transitive union of its parents. Note: The ancestry is derived exclusively by traversing the *file values*, i.e. does not matter whether or not the files thus traversed exist in an underlying file system.
(json-str obj)
(json-str obj opt-map)
Returns a JSON-encoding String for the given Clojure object. Takes an optional date format string that Date objects will be encoded with.
The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'
Returns a JSON-encoding String for the given Clojure object. Takes an optional date format string that Date objects will be encoded with. The default date format (in UTC) is: yyyy-MM-dd'T'HH:mm:ss'Z'
(parse-json-str string)
(parse-json-str string key-fn)
(parse-json-str string key-fn array-coerce-fn)
Returns the Clojure object corresponding to the given JSON-encoded string. An optional key-fn argument can be either true (to coerce keys to keywords), false to leave them as strings, or a function to provide custom coercion.
The array-coerce-fn is an optional function taking the name of an array field, and returning the collection to be used for array values.
If the top-level object is an array, it will be parsed lazily (use `parse-strict' if strict parsing is required for top-level arrays.
Returns the Clojure object corresponding to the given JSON-encoded string. An optional key-fn argument can be either true (to coerce keys to keywords), false to leave them as strings, or a function to provide custom coercion. The array-coerce-fn is an optional function taking the name of an array field, and returning the collection to be used for array values. If the top-level object is an array, it will be parsed lazily (use `parse-strict' if strict parsing is required for top-level arrays.
(re-find+ regex-string s)
If regex
is a representing a correct regular expression, parsable by re-find
, returns the
result of applying re-find
to the result of applying str
to s
, otherwise returns nil
.
If `regex` is a representing a correct regular expression, parsable by `re-find`, returns the result of applying `re-find` to the result of applying `str` to `s`, otherwise returns `nil`.
(sanitize-string regex)
Given a string, returns the string with all characters not matching regex
removed.
Given a string, returns the string with all characters not matching `regex` removed.
(submap? submap supermap)
Returns true
if all keys in submap
map to equal values in supermap
, and false
otherwise.
Returns `true` if all keys in `submap` map to equal values in `supermap`, and `false` otherwise.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close