(array-of element-validator)(chain & validators)Composes a sequence of validators into a validator which applies each validator in turn. The resulting validator returns invalid on any intermediate invalid result and does not call any subsequent validators in the chain.
Composes a sequence of validators into a validator which applies each validator in turn. The resulting validator returns invalid on any intermediate invalid result and does not call any subsequent validators in the chain.
(default-if-invalid validator default)Returns a validator which returns the given default if the inner validator returns invalid
Returns a validator which returns the given default if the inner validator returns invalid
(eq expected)(expect-type expected-type)(ignore-invalid validator)(invalid? x)(kvp key-validator value-validator)(kvps kvp-specs)Takes a collection of kvp specs which validate a map and return a key-value pair (or invalid). Combines results for all kvps into a map.
Takes a collection of kvp specs which validate a map and return a key-value pair (or invalid). Combines results for all kvps into a map.
(make-error {:keys [path] :as context} msg)(make-warning {:keys [path] :as context} msg value)(map-of key-validator value-validator)(mapping m)Returns a validator which expects its input to be one of the keys in the map m. Returns the value associated with the matching key in m if found, otherwise invalid.
Returns a validator which expects its input to be one of the keys in the map m. Returns the value associated with the matching key in m if found, otherwise invalid.
(nullable validator)Wraps a validator into one which allows explicit null values.
Wraps a validator into one which allows explicit null values.
(one-of values)Returns a validator which expects its input to be one of the given values. Returns the matching value if found, otherwise invalid.
Returns a validator which expects its input to be one of the given values. Returns the matching value if found, otherwise invalid.
(optional-key k value-validator)(optional-key k value-validator default)(required-key k value-validator)(strict validator)(try-parse-with f)Returns a validator which tries to parse the incoming value with the function f. Returns invalid if f throws an exception.
Returns a validator which tries to parse the incoming value with the function f. Returns invalid if f throws an exception.
(type-eq expected)Validator that an object's @type property is the expected value
Validator that an object's @type property is the expected value
(type-error-message permitted-types actual-type)(valid? x)(variant tag-validators)(warn-with value)(where pred desc)Returns a validator which applies the predicate pred to the input value. Returns the value if pred returns true, otherwise invalid. Desc should be a string describing pred.
Returns a validator which applies the predicate pred to the input value. Returns the value if pred returns true, otherwise invalid. Desc should be a string describing pred.
(with-error-handler validator error-fn)Returns a validator which invokes the inner validator with the given error function.
Returns a validator which invokes the inner validator with the given error function.
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 |