A simple validator of file extensions
If available in Hex, the package can be installed
by adding validator
to your list of dependencies in mix.exs
:
def deps do
[
{:validator, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/validator.
Basic console usage:
$ iex -S mix
iex> file = "lib/test/myfile.test.png"
...
iex> Path.extname(file)
".png"
Application/Validation usage:
$ iex -S mix
iex> Validator.valid?("filename.jpg")
... returns a boolean