-
-
Notifications
You must be signed in to change notification settings - Fork 910
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
fix: apply stricter typing to the v* signatures #831
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for the contribution.
Can you do me a favor and update the other methods that take an optional buf
argument as well? (v1.ts, v3.ts, v5.ts, and v7.ts)
Edit: ... and v6.ts, too. So basically "all the thingz!"
@robbtraister Thanks for the update. This looks good. FYI, I added this commit after realizing the overload types for v3 and v5 aren't really necessary. (Right? If I got that wrong, please let me know.) |
Calling Having said that, I only ever use |
Ah, right... thanks for catching that! |
The
v4
function is guaranteed to return a string unless thebuf
argument is provided. By modifying the signature to denote this parameter as required for theUint8Array
case, we get the benefit of a stricter return type ofstring
when simply callingv4()
.