
Product
Introducing Socket Scanning for OpenVSX Extensions
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
sort_authority
Advanced tools
Natural order string comparison using natsort by Martin Pool.
If you're using Bundler, you can add sort_authority to your Gemfile:
gem 'sort_authority'
Or manually install the gem using:
gem install sort_authority
# bad
['9 Main Street', '10 Main Street'].sort
# => ['10 Main Street', '9 Main Street']
# good!
require 'sort_authority/ext/enumerable'
['9 Main Street', '10 Main Street'].natural_sort
# => ['9 Main Street', '10 Main Street']
Comparison of sorting an array ['x1'] * 100_000 with naturalsort,
naturally, natcmp,
and sensible_sort.
user system total real
sort 0.000000 0.000000 0.000000 ( 0.001758)
strnatcmp.c 0.030000 0.000000 0.030000 ( 0.029083)
naturalsort gem 0.060000 0.000000 0.060000 ( 0.061879)
naturally gem 0.990000 0.020000 1.010000 ( 1.009634)
natcmp gem 1.140000 0.010000 1.150000 ( 1.141950)
sensible_sort 2.280000 0.000000 2.280000 ( 2.286274)
Fork, branch, and pull-request.
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies