A collection of handy functions to utilize the specs in this library.
A collection of handy functions to utilize the specs in this library.
(coerce spec data)
Coerce data
to a given spec
while eliminating non-conforming keys and values.
Coerce `data` to a given `spec` while eliminating non-conforming keys and values.
(conform spec data)
Conform data
to a given spec
while eliminating non-conforming keys and values.
Conform `data` to a given `spec` while eliminating non-conforming keys and values.
(encode spec data)
Encode the data
described by spec
into a string.
Encode the `data` described by `spec` into a string.
(explain spec data)
Explain why data
does not conform to spec
as a human readable string.
Explain why `data` does not conform to `spec` as a human readable string.
(explain-data spec data)
Explain why data
does not conform to spec
with a map of information.
Explain why `data` does not conform to `spec` with a map of information.
(get-spec k)
Returns spec registered for keyword/symbol/var k, or nil.
Returns spec registered for keyword/symbol/var k, or nil.
(invalid? spec data)
Returns false when data
conforms to spec
, and true otherwise.
Returns false when `data` conforms to `spec`, and true otherwise.
(valid? spec data)
Returns true when data
conforms to spec
, and false otherwise.
Returns true when `data` conforms to `spec`, and false otherwise.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close