You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems that the floating point regex requires an integer part, so the '.2' is chunked to ['.', 2] while the non-string numbers are recognized by javascript as numbers and are not chunked.
Changing /\d+(?:.\d_)?/ to /(?:\d+(?:.\d_)?|.\d+)/ resolves this, but I don't know if it breaks other unit tests and haven't used github long enough to feel comfortable contributing to "live" code (and may not have the required tools installed).
I hope this isn't duplicated elsewhere.
[.3,'.2',.1].sort(naturalSort)
Seems that the floating point regex requires an integer part, so the '.2' is chunked to ['.', 2] while the non-string numbers are recognized by javascript as numbers and are not chunked.
Changing /\d+(?:.\d_)?/ to /(?:\d+(?:.\d_)?|.\d+)/ resolves this, but I don't know if it breaks other unit tests and haven't used github long enough to feel comfortable contributing to "live" code (and may not have the required tools installed).
original: sign? integer fraction? exponent?
modified: sign? ( integer fraction? | fraction ) exponent? // second fraction requires digits
The text was updated successfully, but these errors were encountered: