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?
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?