-
Notifications
You must be signed in to change notification settings - Fork 258
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
refactor: introduce branded types #1223
refactor: introduce branded types #1223
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.
Awesome @dammy95 - left a few comments
Awesome work @dammy95 - thank you 🙏 re: |
Link reads less awkwardly than WebUrl, at least to me. I have no better ideas. |
Yep, agree with the above! |
Thanks for the feedback @setchy @afonsojramos @bmulholland ⭐ |
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.
Thanks @dammy95 - this is great!
Closes #1141
Created the following branded types:
Hostname
Token
ClientSecret
ClientID
AuthCode
URL
(see follow-up question below)Follow-up question:
While attempting to create the
URL
branded type, I observed it clashes with JavaScript's URL class. There are also different variations ofurl
(i.ethread_url
,html_url
,upload_url
, etc) in the project that I'm unsure of how to handle – do I ignore these variations and create the branded type for the occurrences withurl: string
?