javascript-natural-sort icon indicating copy to clipboard operation
javascript-natural-sort copied to clipboard

Sort things "naturally" in Javascript

Results 15 javascript-natural-sort issues
Sort by recently updated
recently updated
newest added

I hope this isn't duplicated elsewhere. [.3,'.2',.1].sort(naturalSort) > > > [0.1, 0.3, ".2"] Seems that the floating point regex requires an integer part, so the '.2' is chunked to ['.',...

In 0.8.1 at line 45: `return comp / Math.abs(comp);` always leaves function even if chunks are equal. I think this would help, it does for me: `if (comp) return comp...

The result of this array is incorrect: ``` js ["a55", "a010", "a102", "a02", "a1", "a255", "a33", "a43", "a87"].sort( naturalSort ); // result : ["a010", "a02", "a1", "a33", "a43", "a55", "a87",...

Hi @overset! First I want to thank you for a really great sorting algorithm! Then I want to notify you that I encapsulated it into a "Component": [github.com/javve/natural-sort](https://github.com/javve/natural-sort). Please tell...