Utilities extending clj.specs with missing bits (some of which will come with alpha2), like metadata, docstring support
Utilities extending clj.specs with missing bits (some of which will come with alpha2), like metadata, docstring support
(def spec-key spec)
(def spec-key doc-string spec)
(def spec-key metadata spec)
(def spec-key metadata doc-string spec)
Same as clojure.spec/def
but take an optional docstring
, attr-map
.
;; just a doctring:
(exoscale.specs/def ::foo "this is a foo" string?)
;; add metadata (exoscale.specs/def ::foo "this is a foo" {:something :interesting} string?)
It's also identical to clojure.spec/def
with no options (as convenience):
(exoscale.specs/def ::foo string?)
It returns the spec key, just like clojure.spec/def
Same as `clojure.spec/def` but take an optional `docstring`, `attr-map`. ;; just a doctring: (exoscale.specs/def ::foo "this is a foo" string?) ;; add metadata (exoscale.specs/def ::foo "this is a foo" {:something :interesting} string?) It's also identical to `clojure.spec/def` with no options (as convenience): (exoscale.specs/def ::foo string?) It returns the spec key, just like `clojure.spec/def`
(keys & {:keys [closed?] :as args})
Like clojure.spec.alpha/keys but allow to pass a :closed?
parameter
to make the spec strict on allowed keys.
Like clojure.spec.alpha/keys but allow to pass a `:closed?` parameter to make the spec strict on allowed keys.
(meta k)
Like clojure.core/meta but for registered specs.
Like clojure.core/meta but for registered specs.
(select-keys x spec)
Selects a set of keys from a map from it's spec. Works with s/keys, s/merge, s/multi-spec.
Selects a set of keys from a map from it's spec. Works with s/keys, s/merge, s/multi-spec.
(unregister-meta! k)
Unregister meta data for a spec
Unregister meta data for a spec
(vary-meta! k f & args)
Like clojure.core/vary-meta but for registered specs, mutates the meta in place, return the keyword spec
Like clojure.core/vary-meta but for registered specs, mutates the meta in place, return the keyword spec
(with-doc k doc)
Add doc metadata on a registered spec
Add doc metadata on a registered spec
(with-meta! k m)
Like clojure.core/with-meta but for registered specs, mutates the meta in place, return the keyword spec
Like clojure.core/with-meta but for registered specs, mutates the meta in place, return the keyword spec
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close