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
NOTE v0.2 used an explicit second argument (case_sensitive).
This has been removed and replaced with an options keyword list,
this is a breaking change.
Sort a list of strings containing numbers in a natural manner.
Sort functions will not [generally] sort strings containing
numbers the same way a human would.
Sorts a list of strings (ascending).
This works by leveraging Elixir's
Enum.sort_by/3 function (which takes as the second argument
a mapping function). The mapping operation converts each string
into a list of strings and integers. Once in this form, applying
the sort function results in a correctly sorted list.
Options
There are currently two available options (passed as a
keyword list), :direction and case_sensitive.
:direction may have a value of :asc or :desc, and
defaults to :asc.
:case_sensitive may be true or false, and defaults
to false.
ENHANCEMENT: Add options: choice to use unicode, choice to strip whitespace from result.
ENHANCEMENT: Stream rather than map - this was designed to aid me in organising vast amounts of files by name; mapping over large lists seems inefficient.
About
Elixir natural sort implementation for lists of strings.