gege251/elm-validator-pipeline/1.0.0

NOTE: the latest version is 3.0.0

Renamed to szg251/elm-validator-pipeline. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as gege251/elm-validator-pipeline still install under that name. 5 versions of 5 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/szg251/elm-validator-pipeline.

What we checked: The repo moved to github.com/szg251/elm-validator-pipeline. Rebuilt with git archive from commit 93a7e55340ab of https://github.com/szg251/elm-validator-pipeline (zip prefix gege251-elm-validator-pipeline-eb1bea2/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 3f0d6dbb0a8b260a844455be3735eae8620a4d2c.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/gege251/elm-validator-pipeline/zipball/1.0.0/

Validator.String

Validators for strings.

Validators

notEmpty : String -> Validator String String

Checks if a string is empty (white spaces allowed).

notBlank : String -> Validator String String

Checks if a string is empty (white spaces are not allowed).

isEmail : String -> Validator String String

Checks if a string is valid email. This validator works for most emails, but it is not 100%.

Regex is from: https://emailregex.com/

isPhoneJp : String -> Validator String String

Checks if a string is a valid Japanese phone number.

Note: I only added japanese regex, because that's what I use, but you can easily use your own regex, or send me a Pull Request.

isUrl : String -> Validator String String

Checks if a string is valid URL.

Regex is from: https://gist.github.com/dperini/729294

hasLetter : String -> Validator String String

Checks if a string contains at least one letter.

letterOnly : String -> Validator String String

Checks if a string only contains letters (white spaces are not allowed).

hasNumber : String -> Validator String String

Checks if a string contains at least one number.

numberOnly : String -> Validator String String

Checks if a string only contains numbers.

minLength : String -> Int -> Validator String String

Checks if a string is longer than or equal to a given value.

maxLength : String -> Int -> Validator String String

Checks if a string is shorter than or equal to a given value.

regexValidator : String -> Maybe Regex -> String -> Validated String

Custom string validator using a regular expression.

Casting validators

isInt : String -> String -> Validated Int

Checks if a string can be casted to an integer, and if so, it returns the value.

isFloat : String -> String -> Validated Float

Checks if a string can be casted to a float and if so, it returns the value.