sanity-clause.validator package

<< back to sanity-clause index

Some validation functions that can be used with fields to make sure data has certain properties.

Exported symbols:

Functions

not-empty

[source]

Checks that some value has been supplied. Note: this won't work well with boolean values because NIL is falsey.

uuid

[source]

Checks that a value is a string that resembles a uuid.

email

[source]

Checks that the input resembles an email.

str

[source]

Checks that value is a string. If specified, checks that min-length <= (length value) <= max-length.

int

[source]

Accepts a value as an integer or string. If value is a string, interpret it as a value with base- radix. If specified, make sure min <= value <= max.

hydrate-validators

[source]

Takes a list of validators in the form of keywords and turns them into living function references.

ensure-validator

[source]

Find a validator function by keyword-spec and return the function represented by the spec unless it's already a function.