Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs and add guards #29

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

whatyouhide
Copy link
Contributor

No description provided.

@@ -120,7 +120,7 @@ defmodule NimbleTOTP do

"""
@spec otpauth_uri(String.t(), String.t(), keyword()) :: String.t()
def otpauth_uri(label, secret, uri_params \\ []) do
def otpauth_uri(label, secret, uri_params \\ []) when is_binary(label) and is_binary(secret) do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guards here and below all follow the specs, so I think this is fine. I didn't add them to valid? as that seems to explicitly return false on every invalid input, regardless of what the spec says.

@josevalim josevalim merged commit d438671 into dashbitco:master Jun 12, 2024
1 of 2 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@whatyouhide whatyouhide deleted the al/docs-and-guards branch June 12, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants