Skip to content

Commit

Permalink
feat: make validate/2 typespec more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
wkirschbaum committed Aug 15, 2023
1 parent 4ea8176 commit 2bce1fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/za_id_number.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ defmodule ZaIdNumber do
Documentation for `ZaIdNumber`.
"""

@spec validate(binary, keyword) ::
{:ok, ZaIdNumber.Validator.result()} | {:error, binary()}
@doc """
ZaIdNumber validates and retrieves South African ID Number data
Expand Down
2 changes: 1 addition & 1 deletion lib/za_id_number/validator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule ZaIdNumber.Validator do

@type result :: %{
gender: :female | :male,
age: number(),
age: pos_integer(),
date_of_birth: Date.t(),
citizen_status: :born_citizen | :permanent_resident
}
Expand Down

0 comments on commit 2bce1fc

Please sign in to comment.