Allows overriding of specs in the registry within a local binding context.
(binding [sc/overrides {::my-key my-coerce-fn}] (sc/coerce ::my/spec data))
Allows overriding of specs in the registry within a local binding context. (binding [sc/*overrides* {::my-key my-coerce-fn}] (sc/coerce ::my/spec data))
(coerce! k x)
Like coerce, but will call s/assert on the result, making it throw an error if value doesn't comply after coercion.
Like coerce, but will call s/assert on the result, making it throw an error if value doesn't comply after coercion.
(coerce-structure x)
(coerce-structure x {:spec-coerce.core/keys [overrides op] :or {op coerce}})
Recursively coerce map values on a structure.
Recursively coerce map values on a structure.
(conform k x)
Like coerce, and will call s/conform on the result.
Like coerce, and will call s/conform on the result.
(def k coercion)
Given a namespace-qualified keyword, and a coerce function, makes an entry in the registry mapping k to the coerce function.
Given a namespace-qualified keyword, and a coerce function, makes an entry in the registry mapping k to the coerce function.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close