Skip to content

Elixir Validation library with +25 fully tested rules. (+30 coming up soon!)

License

Notifications You must be signed in to change notification settings

elixir-validation/validation

Repository files navigation

Elixir Validation


Build Status Build status Coverage Status Inline docs Hex Version hex.pm downloads HitCount License

Easy. Simple. Powerful. 💪

Elixir Validation library with +25 fully tested rules. (+30 coming up soon!)

⚠️⚠️ ️ Library under development! Roadmap: upcoming new rules. ⚠️⚠️

Demo

# 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... 

Install

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+

Documentation

To more information, please access the full documention.

Rules

+25 fully tested rules such as:

Roadmap: +30 coming up soon!

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

Contribution

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.

Inspiration

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.

License

MIT LicenseMatheus Gontijo

About

Elixir Validation library with +25 fully tested rules. (+30 coming up soon!)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages