Liking cljdoc? Tell your friends :D

expound.alpha

Generates human-readable errors for clojure.spec

Generates human-readable errors for `clojure.spec`

conformed-value

(conformed-value problems invalid-value)
source

custom-printer

(custom-printer opts)

Returns a printer.

Options:

  • :show-valid-values? - if false, replaces valid values with "..."
  • :value-str-fn - function to print bad values
  • :print-specs? - if true, display "Relevant specs" section. Otherwise, omit that section.
  • :theme - enables color theme. Possible values: :figwheel-theme, :none
Returns a printer.

Options:
 - `:show-valid-values?` - if `false`, replaces valid values with "..."
 - `:value-str-fn`       - function to print bad values
 - `:print-specs?`       - if `true`, display "Relevant specs" section. Otherwise, omit that section.
 - `:theme`               - enables color theme. Possible values: `:figwheel-theme`, `:none`
sourceraw docstring

defmacrodeprecated

(def k spec-form)
(def k spec-form error-message)

DEPRECATED: Prefer defmsg

Define a spec with an optional error-message.

Replaces clojure.spec.alpha/def but optionally takes a human-readable error-message (will only be used for predicates) e.g. "should be a string".

DEPRECATED: Prefer `defmsg` 

Define a spec with an optional `error-message`.

Replaces `clojure.spec.alpha/def` but optionally takes a human-readable `error-message` (will only be used for predicates) e.g. "should be a string".
sourceraw docstring

defmsg

(defmsg k error-message)

Associates the spec named k with error-message.

Associates the spec named `k` with `error-message`.
sourceraw docstring

error-message

(error-message k)

Given a spec named k, return its human-readable error message.

Given a spec named `k`, return its human-readable error message.
sourceraw docstring

explain-result

(explain-result check-result)

Given a result from clojure.spec.test.alpha/check, prints a summary of the result.

Given a result from `clojure.spec.test.alpha/check`, prints a summary of the result.
sourceraw docstring

explain-result-str

(explain-result-str check-result)

Given a result from clojure.spec.test.alpha/check, returns a string summarizing the result.

Given a result from `clojure.spec.test.alpha/check`, returns a string summarizing the result.
sourceraw docstring

explain-results

(explain-results check-results)

Given a sequence of results from clojure.spec.test.alpha/check, prints a summary of the results.

Given a sequence of results from `clojure.spec.test.alpha/check`, prints a summary of the results.
sourceraw docstring

explain-results-str

(explain-results-str check-results)

Given a sequence of results from clojure.spec.test.alpha/check, returns a string summarizing the results.

Given a sequence of results from `clojure.spec.test.alpha/check`, returns a string summarizing the results.
sourceraw docstring

expound

(expound spec form)

Given a spec and a form, either prints a success message or a human-readable error message.

Given a `spec` and a `form`, either prints a success message or a human-readable error message.
sourceraw docstring

expound-str

(expound-str spec form)

Given a spec and a form, either returns success message or a human-readable error message.

Given a `spec` and a `form`, either returns success message or a human-readable error message.
sourceraw docstring

printer

(printer explain-data)

Prints explain-data in a human-readable format.

Prints `explain-data` in a human-readable format.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close