(conform spec value)(conform spec value conforming)Given a spec and a value, returns the possibly destructured value or ::s/invalid
Given a spec and a value, returns the possibly destructured value or ::s/invalid
(conform! spec value)(conform! spec value conforming)Given a spec and a value, returns the possibly destructured value or fails with ex-info with :type of ::conform. ex-data also contains :problems, :spec and :value. call s/unform on the result to get the actual conformed value.
Given a spec and a value, returns the possibly destructured value or fails with ex-info with :type of ::conform. ex-data also contains :problems, :spec and :value. call s/unform on the result to get the actual conformed value.
(create-spec {:keys [spec type form] :as m})Creates a Spec intance from a map containing the following keys:
:spec the wrapped spec predicate (mandatory)
:form source code of the spec predicate, if :spec is a spec,
:form is read with `s/form` out of it. For non-spec
preds, spec-tools.forms/resolve-form is called, if still
not available, spec-creation will fail.
:type optional type for the spec. if not set, will be auto-
resolved via spec-tools.forms/resolve-type (optional)
:reason reason to be added to problems with s/explain (optional)
:gen generator function for the spec (optional)
:name name of the spec (optional)
:description description of the spec (optional) :xx/yy any qualified keys can be added (optional)
Creates a Spec intance from a map containing the following keys:
:spec the wrapped spec predicate (mandatory)
:form source code of the spec predicate, if :spec is a spec,
:form is read with `s/form` out of it. For non-spec
preds, spec-tools.forms/resolve-form is called, if still
not available, spec-creation will fail.
:type optional type for the spec. if not set, will be auto-
resolved via spec-tools.forms/resolve-type (optional)
:reason reason to be added to problems with s/explain (optional)
:gen generator function for the spec (optional)
:name name of the spec (optional)
:description description of the spec (optional)
:xx/yy any qualified keys can be added (optional)(doc pred-or-info)(doc spec info)Creates a Spec instance with one or two arguments, setting the :type to nil (e.g. no dynamic conforming).
;; using type inference (doc integer?)
;; with explicit type (doc integer? {:name "it's a integer"})
;; map form (doc {:spec integer?, :name "it's a integer"}})
calls spec, see it for details.
Creates a Spec instance with one or two arguments,
setting the :type to nil (e.g. no dynamic conforming).
;; using type inference
(doc integer?)
;; with explicit type
(doc integer? {:name "it's a integer"})
;; map form
(doc {:spec integer?, :name "it's a integer"}})
calls `spec`, see it for details.(spec pred-or-info)(spec pred info)Creates a Spec instance with one or two arguments:
;; using type inference (spec integer?)
;; with explicit type (spec integer? {:type :long})
;; map form (spec {:spec integer?, :type :long})
calls create-spec, see it for details.
Creates a Spec instance with one or two arguments:
;; using type inference
(spec integer?)
;; with explicit type
(spec integer? {:type :long})
;; map form
(spec {:spec integer?, :type :long})
calls `create-spec`, see it for details.(spec-description spec)Returns a spec description.
Returns a spec description.
(spec-name spec)Returns a spec name. Like the private clojure.spec.alpha/spec-name
Returns a spec name. Like the private clojure.spec.alpha/spec-name
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |