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

Fix inner callback call for non comparable items #23

Merged
merged 5 commits into from
Jul 24, 2019

Conversation

Sumolari
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Jul 23, 2019

Coverage Status

Coverage remained the same at 94.083% when pulling 0e775ab on 21-Fix-innerCallback-call-for-non-comparable-items into 7f62106 on master.

Copy link

@furstenheim-geoblink furstenheim-geoblink left a 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

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

Copy link
Contributor Author

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`)

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

Copy link
Contributor Author

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose

@Sumolari Sumolari force-pushed the 21-Fix-innerCallback-call-for-non-comparable-items branch from d9b2662 to 0e775ab Compare July 24, 2019 06:21
@Sumolari Sumolari merged commit 242c0d0 into master Jul 24, 2019
@Sumolari Sumolari deleted the 21-Fix-innerCallback-call-for-non-comparable-items branch July 24, 2019 06:30
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.

None yet

3 participants