soothe.core
def
(def kw-spec|sym-pred fn|message)
Define a message for a given spec or a predicate.
Arguments:
- either a keyword (spec) or a qualified symbol (for a predicate);
- either a string or 1-arg function that takes a problem map and returns a message.
def-many
(def-many key->messages)
Define multiple messages at once.
Takes a map of sym/keyword => message/function values.
explain
(explain spec value)
Prints the formatted output of explain-data.
explain-data
(explain-data spec value)
Like s/explain-data: takes a spec and a value
and returns a map with the problem list. Each problem
has clear message found by either a predicate or a spec.
explain-str
(explain-str spec value)
Like explain, but returns the captured output as a string.
undef
(undef kw-spec|sym-pred)
Undefine a message for the given sym/kw.
undef-all
(undef-all)
Undefine all the known messages.