pat310 / quick-pivot

Quickly format data to create a pivot table
https://www.npmjs.com/package/quick-pivot
MIT License
64 stars 21 forks source link

Comparison functions used are causing unexpected results #78

Closed jedrus2000 closed 2 years ago

jedrus2000 commented 2 years ago

This issue is well mentioned here : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#sorting_with_non-well-formed_comparator

It causes all tests to fail in Node 11, 12, 13, 14 etc. However, on Node 10 it works good.

Look at the problem below (same comparison is used in this project)

2022-10-05_12-19

Code : 2022-10-05_12-20

On Node 10 sorting is as expected.

I will do PR shortly with fix.