Skip to content

Validators

Class containing various field validators.

constructor

  • new Validators

defaultMessage

  • defaultMessage

email

Validator to check if a value is a valid email address.

enum

Validator to check if a value exists in a given enum.

in

Validator to check if a value is one of the specified values.

max

Validator to check if a value is less than or equal to a maximum value.

maxLength

Validator to check if a string's length is less than or equal to a maximum length.

min

Validator to check if a value is greater than or equal to a minimum value.

minLength

Validator to check if a string's length is greater than or equal to a minimum length.

notNull

Validator to check if a value is not null.

regex

Validator to check if a value matches a given regular expression.

relationExists

Validator to check if a related value exists in the database.

required

Validator to check if a value is required (not null or empty).

unique

Validator to ensure a value is unique in the database.

uniqueOnBackend

  • uniqueOnBackend

url

Validator to check if a value is a valid URL.

MIT Licensed | Made by the Remult team with ❤️