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

IP addresses sort as floats (192.200 < 192.42) #34

Open
Krinkle opened this issue Mar 8, 2019 · 0 comments
Open

IP addresses sort as floats (192.200 < 192.42) #34

Krinkle opened this issue Mar 8, 2019 · 0 comments

Comments

@Krinkle
Copy link

Krinkle commented Mar 8, 2019

IP addresses currently sort the first chunk as a float.

This bug leads, for example, 192.200.2.3 to sorts before 192.42.2.3, instead of after it.

/* Version: 0.8.1 */

['192.200.2.3','192.42.2.3','192.3.2.1'].sort(naturalSort)
// actual>   ["192.200.2.3", "192.3.2.1",  "192.42.2.3"] 
// expected> ["192.3.2.1",   "192.42.2.3", "192.200.2.3"] 

I ran into this when trying out this module as sorting algorithm for Wikipedia's tablesorter code, but it failed out unit tests.

capture

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

1 participant