Liking cljdoc? Tell your friends :D

dgknght.app-lib.validation


big-dec-not-less-than-zero?clj


date-time?clj


email?clj


error-messagesclj

(error-messages model)
(error-messages model path)

Returns the errors from the specified model. If given only a model, returns a map of all errors. If given a model and a key, returns the errors for the specified key from wihin the model.

Returns the errors from the specified model. If given only a model,
returns a map of all errors. If given a model and a key, returns the
errors for the specified key from wihin the model.
raw docstring

flat-error-messagesclj

(flat-error-messages model)

Returns a flat list of strings describing the error messages for the model instead of the map returned by error-messages

Returns a flat list of strings describing the error messages for the
model instead of the map returned by error-messages
raw docstring

has-error?clj

(has-error? model)
(has-error? model path)

Returns true if the specified model contains validation errors

Returns true if the specified model contains validation errors
raw docstring

length-between?clj

(length-between? min-length max-length value)

local-date?clj


local-time?clj


min-length?clj

(min-length? minimum value)

nilable-date-time?clj


nilable-local-date?clj


nilable-positive-integer?clj


nilable-positive-number?clj


non-empty-string?clj


not-longer-than?clj

(not-longer-than? max-length value)

positive-big-dec?clj


positive-integer?clj


positive-number?clj


reg-msgcljmacro

(reg-msg pred msg)

reg-path-resolverclj

(reg-path-resolver resolver)

reg-speccljmacro

(reg-spec pred {:keys [message path]})

spec-dataclj


valid?clj

(valid? model)

Returns false if the model has any validation errors

Returns false if the model has any validation errors
raw docstring

validateclj

(validate model spec)

Validates the specified model using the specified spec

Validates the specified model using the specified spec
raw docstring

with-validationcljmacro

(with-validation model spec & body)

Accepts a model and validation rules. If the model passes the rules, the specified body is executed and the result returned. If not, the invalid model, with validation errors, is returned.

Note that this rebinds the validated user object to the same binding used to call the macro.

Accepts a model and validation rules. If the model
passes the rules, the specified body is executed
and the result returned. If not, the invalid model,
with validation errors, is returned.

Note that this rebinds the validated user object
to the same binding used to call the macro.
raw docstring

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

× close