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

Null or undefined values #35

Closed
theblomskog opened this issue Nov 30, 2017 · 2 comments
Closed

Null or undefined values #35

theblomskog opened this issue Nov 30, 2017 · 2 comments
Milestone

Comments

@theblomskog
Copy link

theblomskog commented Nov 30, 2017

If target values are null or undefined, sorting becomes corrupt.
I have cloned your project and fixed it so it fits my use-case, where some values in rows might be null or undefined.
I just implemented a compare function as follows:
static compare(a: any, b: any ) {
if(a == null && b == null) return 0;
if(a != null && b == null) return -1;
if(a == null && b != null) return 1
return a > b ? 1 : -1;
}
And replaced some of the logic.
I also created som more tests to verify it.
Would you be intressted in me making a pull request?

@VadimDez
Copy link
Owner

If it makes the project better - sure!

@VadimDez
Copy link
Owner

Fixed by #44, released in 1.1.3

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

No branches or pull requests

2 participants