Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/dominikmifkovic/detoxss is gone (deleted or private); Software Heritage has not archived the repo; no fork with the same repo name found; no cached copy. Use another version.
General validation helpers for form input.
This module validates whether a value follows application-level rules such as being non-empty, having a specific length, matching a regular expression, or looking like an email address.
Validation is not the same as XSS protection. A valid value may still need sanitization or AST analysis before it is used in an output context.
Validation rule.
A rule receives a string and returns a list of validation errors. An empty list means that the value passed that rule.
Run a list of validation rules against a string.
The input is trimmed before validation. If all rules pass, the cleaned value is
returned as ValidatedInput.
Validate a simple email address.
This checks the general shape of an email address. It does not verify whether the address actually exists.
Validate a phone-like value.
The value may contain digits, spaces, plus signs, dashes, and parentheses.
Validate a username.
The username must be non-empty, have an allowed length, and contain only letters, digits, underscores, dots, or dashes.
Validate a password.
The password must be non-empty, have a minimum length, and contain a mixture of character classes.
Require a non-empty value.
Require a minimum string length.
Require a maximum string length.
Require the value to match a regular expression.
The description is used in the InvalidChars error when the value does not
match.
Create a validation rule from a regular expression and custom error.
Possible validation errors returned by the validation helpers.
These errors describe why a value did not pass a validation rule.