Easy. Simple. Powerful. 💪
Elixir Validation library with +25 fully tested rules. (+30 coming up soon!)
⚠️ ⚠️ ️ Library under development! Roadmap: upcoming new rules.⚠️ ⚠️
# alias Validation, as: V
# valid data will return true
V.email?("hello@gmail.com")
V.uuid?("e4eaaaf2-d142-11e1-b3e4-080027620cdd")
V.credit_card?("4882743696073832")
V.mac_address?("12-77-0E-42-E4-65")
V.consonants?("bcdfgh")
V.country_code?("US")
# invalid data will return false
V.language_code?("qq") # could be something like "en", "pt" or "de"
V.vowel?("bcdf") # could be something like "aeiou"
V.yes?("nope") # could be something like "yes", "yeah", "yeap"
V.is_odd?(2) # could be something like 3 or 5...
To use Elixir Validation, please add to your mix.exs
and run mix deps.get
:
def deps do
[
{:validation, "~> 0.0.1-dev"}
]
end
Compatibility: Elixir 1.6+
To more information, please access the full documention.
- CreditCard (Visa, Master, other)
- CNPJ / CPF
- CountryCode / SubdivisionCode
- Vowel / Consonants
- MacAddress
- ... and many, many more right here!
Barcode, Iban, WordCount, Contains, Bic, CurrencySymbol, Isbn, Issn, Domain, Extension, Factor, Fibonacci, Finite, HexRgbColor, IdentityCard, Imei, Infinite, Ip, KeyNested, StartsWith, EndsWith, Length, Min, Max, NfeAccessKey, NoWhitespace, NotBlank, NotEmpty, Numeric, PerfectSquare, Pesel, Phone, PostalCode (us, uk, br...), PrimeNumber, Punct, Roman, Size, Slug, Space, Url, Version
Check out the list of awesome contributors.
- Do you want a new validation rule? Feel free to contribute by forking the project and making a pull request.
- Did you find a bug? Please report on issues proving high level of detail. Additionally, providing a failing test would help solve the issue.
We highly appreciate ❤️ the Respect\Validation project. Elixir Validation was completely based upon this incredible project. Kudos for all contributors. We can't thank you enough.