An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/creachadair/stringsort

Package stringsort provides support code for sorting strings. Ordinarily strings are sorted lexicographically by character. This is simple and consistent, but when applied to UI elements can be unintuitive for users. For example, lexicgraphically sorting a list of filenames will produce an order like That is, "file 2" is listed after "file 10". One way to address this is to treat runs of digits differently in comparison: Instead of comparing them digit-by-digit, treat the entire run as a single value. The MixedKey type supports this representation, representing a string as a sequence of "spans", each consisting of a non-digit string followed by an integer value corresponding to a digit string. Lexicographic comparison of these keys will preserve the intuitive ordering of digit sequences. This approach emulates the ordering used by the macOS Finder for file names.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/creachadair/stringsort
License: MIT
Latest release: over 1 year ago
First release: over 3 years ago
Namespace: github.com/creachadair
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 20 days ago

    Loading...
    Readme
    Loading...