-
Notifications
You must be signed in to change notification settings - Fork 24
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: add BaseService.constructServiceURL
method
#138
Conversation
// If null was passed, we set the variables to an empty map. | ||
// This results in all default variable values being used. | ||
if (providedUrlVariables === null) { | ||
providedUrlVariables = new Map<string, string>(); |
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.
Quick initial question - is there a reason that you used Maps instead of basic objects? e.g. {}
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.
I'm implementing the same method for Java and Go using a map, so I chose the Map
class for consistency. The class provides some useful methods like .has(key)
. I also chose the Map
class because the variables are intended to just have keys and values - nothing more nested than that.
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.
That all makes sense! I asked because I don't see them used very often but they seem great for this use case 👍
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.
LGTM!
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.
Looks good! 👍
# [2.11.0](v2.10.4...v2.11.0) (2021-05-27) ### Features * add `BaseService.constructServiceURL` method ([#138](#138)) ([0e73bde](0e73bde))
🎉 This PR is included in version 2.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This method can be used by an API to construct a service URL from a parameterized URL.
Checklist
npm test
passes (tip:npm run lint-fix
can correct most style issues)