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

feat(typescript): type algorithm property for sign options #377

Merged
merged 1 commit into from
Dec 6, 2020

Conversation

G-Rath
Copy link
Member

@G-Rath G-Rath commented Dec 6, 2020

I've done it like this because if you do just Algorithm TS won't let you pass it in as just a string - you'll have to always use the Algorithm enum.

While this isn't a bad thing (since the enum is exported), it'd be a change for TS users - this way you can pass both the enum and plain strings without being able to pass just any old string.

Another way around this would be to make Algorithm a const enum, but then that'd break people who are currently importing and using the enum since it would no longer exist at runtime.

These changes could be made later down the line if desired, such as if a major release is done.

@gr2m
Copy link
Contributor

gr2m commented Dec 6, 2020

If I understand correctly, this will improve the typing of the sign function? If that's the case, this is a (typescript) feature, not only a refactor.

@gr2m gr2m added Type: Feature New feature or request typescript Relevant to TypeScript users only labels Dec 6, 2020
@gr2m gr2m changed the title refactor(typescript): type algorithm property for sign options feat(typescript): type algorithm property for sign options Dec 6, 2020
@G-Rath G-Rath force-pushed the type-sign-algorithm branch from a6f44df to afa13ee Compare December 6, 2020 20:53
@G-Rath G-Rath force-pushed the type-sign-algorithm branch from afa13ee to f45389f Compare December 6, 2020 20:53
@gr2m gr2m merged commit 84f753b into octokit:master Dec 6, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2020

🎉 This PR is included in version 7.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@G-Rath G-Rath deleted the type-sign-algorithm branch December 7, 2020 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request typescript Relevant to TypeScript users only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants