-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix inner callback call for non comparable items #23
Fix inner callback call for non comparable items #23
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.
Implementation is good, but I worry about the change in the API
@@ -14,7 +14,7 @@ export type ComparisonResult = number | |||
* Can be used to implement efficient algorithms which profit from sorted data | |||
* like `mergeSort` or `mergeJoinWith`. | |||
* | |||
* Both collections must be sortable. They will be sorted ascendently using | |||
* Both collections must be sortable. They will be sorted ascendantly using |
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.
why the change? both are good
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.
When I copied it to my comment in Github, Chrome's autocorrector complained about it 😆
if (lhsValue < rhsValue) return SORTING_ORDER.LHS_BEFORE_RHS | ||
if (lhsValue > rhsValue) return SORTING_ORDER.LHS_AFTER_RHS | ||
|
||
throw new Error(`[@geoblink/lodash-mixins#mergeForEach] Found non-comparable values: ${lhsValue} on LHS and ${rhsValue} on RHS`) |
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.
This might have impact where we use it. We have to be careful about this
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.
If we find this error then we were relying on the old bug which was actually an undefined/unexpected behaviour, I think it's better to fail even without us expecting it rather than giving false matches (this was happening in My Data wizard before and was a crazy thing to debug)
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 suppose
d9b2662
to
0e775ab
Compare
No description provided.