ormlette_validate/valid

Types

pub type FieldValidator {
  FieldValidator(String, Validator(dynamic.Dynamic))
}

Constructors

  • FieldValidator(String, Validator(dynamic.Dynamic))
pub type Validator(input) {
  Validator(fn(input) -> Result(input, List(String)))
}

Constructors

  • Validator(fn(input) -> Result(input, List(String)))

Functions

pub fn has_min_length(min_length: Int) -> Validator(Dynamic)
pub fn is_boolean() -> Validator(Dynamic)
pub fn is_in_list(
  allowed_values: List(Dynamic),
) -> Validator(Dynamic)
pub fn is_negative() -> Validator(Dynamic)
pub fn is_not_empty() -> Validator(Dynamic)
pub fn is_number() -> Validator(Dynamic)
pub fn is_positive() -> Validator(Dynamic)
pub fn matches_regex(pattern: String) -> Validator(Dynamic)
pub fn max(num: Int) -> Validator(Dynamic)
pub fn min(num: Int) -> Validator(Dynamic)
pub fn validate(
  input: a,
  validators: List(Validator(a)),
) -> Result(a, List(String))
pub fn validate_dict(
  input: Dict(String, Dynamic),
  field_validators: List(FieldValidator),
) -> Result(Dict(String, Dynamic), List(String))
Search Document