-
-
Notifications
You must be signed in to change notification settings - Fork 929
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: Allow coordinate parameter to be [string, string] #1066
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.
Can you provide one extra test with mixed ([number, string]
) parameters on the coordinate property? Just to ensure that nothing breaks during runtime.
I changed the title to a |
Listed as a todo in #1044. |
Codecov Report
@@ Coverage Diff @@
## main #1066 +/- ##
==========================================
- Coverage 99.65% 99.64% -0.01%
==========================================
Files 2135 2135
Lines 229134 229134
Branches 974 971 -3
==========================================
- Hits 228348 228329 -19
- Misses 765 784 +19
Partials 21 21
|
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 for the feedback! Added another loop to the current test which runs the assertions against all 4 possible type combinations. Does this solution work for you?
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 to me. Thanks for your contribution!
We should discuss whether we want to support string coordinates at all: See also:
Sorry for the trouble. |
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.
@samm459 We had a team meeting today, where we discussed this PR. We came to the conclusion, that we currently don't feel responsible for providing a wide variety of input types. That means that the PR as-is will not be merged. In the #1044 you can see that this todo is updated to "will not fix".
But, this is your first PR in our project we want you to have a positive feeling of achievement.
Since the todo will no longer be fixed it needs to be removed from the code base.
So would you be so kind and revert your changes and then push an additional commit where you remove the comment?
Sounds good, can do. After giving it some thought I totally agree with the decision. |
@samm459 are you still willing to update your PR? Just wanted to make sure, was just checking open PRs. |
Superseded by #1234 |
Hello! This is my first contribution to this great repo 🙏. Hope it helps!
Opted for :
coordinate?: [longitude: number | string, latitude: number | string]
instead of this:
coordinate?: [longitude: number, latitude: number] | [longitude: string, latitude: string]
Made sense to me given my approach coerces both into numbers either way. Hopefully this is what you were looking for.
Thank you!