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

types: Improve definition of SASLOptions by adding a SASLMechanism type #477

Merged
merged 3 commits into from
Aug 20, 2019

Conversation

ThisIsMissEm
Copy link

Previously if you tried to assign an environment variable to the mechanism option, then you'd get a typescript error of "cannot assign string to 'plain' | 'scram-sha-256' | 'scram-sha-512' | 'aws'" and the only workaround was to declare a type which copied the string union.

…nism type

Previously if you tried to assign an environment variable to the mechanism option, then you'd get a typescript error of "cannot assign string to 'plain' | 'scram-sha-256' | 'scram-sha-512' | 'aws'" and the only workaround was to declare a type which copied the string union.
@ThisIsMissEm
Copy link
Author

Turns out this may not be needed, as you can apparently do foo as SASLOptions["mechanism"] — though this isn't documented much anywhere.

@tulios
Copy link
Owner

tulios commented Aug 20, 2019

I think this is still valid; it's a good improvement.
Thanks.

@tulios tulios self-requested a review August 20, 2019 12:09
@tulios tulios merged commit 78a3270 into tulios:master Aug 20, 2019
@tulios
Copy link
Owner

tulios commented Aug 20, 2019

Pre-release 1.11.0-beta.9 was published with the changes.
Thanks.

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