validator/string
Functions
pub fn is_email(
error: a,
) -> fn(String) -> Result(String, #(a, List(a)))
Validate if a string is an email.
This checks if a string follows a simple pattern _@_
.
pub fn is_float(
error: a,
) -> fn(String) -> Result(Float, #(a, List(a)))
Validate if a string parses to an Float. Returns the Float if so.
pub fn is_int(
error: a,
) -> fn(String) -> Result(Int, #(a, List(a)))
Validate if a string parses to an Int. Returns the Int if so.
pub fn is_not_empty(
error: a,
) -> fn(String) -> Result(String, #(a, List(a)))
Validate if a string is not empty
pub fn max_length(
error: a,
max: Int,
) -> fn(String) -> Result(String, #(a, List(a)))
Validate the max length of a string
pub fn min_length(
error: a,
min: Int,
) -> fn(String) -> Result(String, #(a, List(a)))
Validate the min length of a string