
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Sort Array/Hash/Enumerable recursively.
Add this line to your application's Gemfile:
gem 'deep_sort'
And then execute:
$ bundle
Or install it yourself as:
$ gem install deep_sort
DeepSort.deep_sort(obj, options = {})
require 'deep_sort/extend'
Array#deep_sort(options = {})
Array#deep_sort!(options = {})
Hash#deep_sort(options = {})
Hash#deep_sort!(options = {})
Enumerable#deep_sort()
require 'deep_sort'
require 'pp'
require 'set'
hash = {"firstName"=>"John",
"lastName"=>"Smith",
"age"=>25,
"address"=>
{"streetAddress"=>"21 2nd Street",
"city"=>"New York",
"state"=>"NY",
"postalCode"=>"10021"},
"phoneNumber"=>
[{"type"=>"home", "number"=>"212 555-1234"},
{"type"=>"fax", "number"=>"646 555-4567"}],
"gender"=>{"type"=>"male"},
"number"=>[10, 5, 4, 9, 7],
"tags"=>Set["staff", "engineer", {"joined_at"=>"2016", "emp_no"=>10}, "writer"]}
pp DeepSort.deep_sort(hash)
#=> {"address"=>
# {"city"=>"New York",
# "postalCode"=>"10021",
# "state"=>"NY",
# "streetAddress"=>"21 2nd Street"},
# "age"=>25,
# "firstName"=>"John",
# "gender"=>{"type"=>"male"},
# "lastName"=>"Smith",
# "phoneNumber"=>
# [{"number"=>"212 555-1234", "type"=>"home"},
# {"number"=>"646 555-4567", "type"=>"fax"}],
# "number" => [4, 5, 7, 9, 10],
# "tags"=>Set["staff", "engineer", {"joined_at"=>"2016", "emp_no"=>10}, "writer"]}
sort_enum: true
pp DeepSort.deep_sort(sort_enum: true)
#=> {"address"=>
# {"city"=>"New York",
# "postalCode"=>"10021",
# "state"=>"NY",
# "streetAddress"=>"21 2nd Street"},
# "age"=>25,
# "firstName"=>"John",
# "gender"=>{"type"=>"male"},
# "lastName"=>"Smith",
# "phoneNumber"=>
# [{"number"=>"212 555-1234", "type"=>"home"},
# {"number"=>"646 555-4567", "type"=>"fax"}],
# "number" => [4, 5, 7, 9],
# "tags"=>["engineer", "staff", "writer", {"emp_no"=>10, "joined_at"=>"2016"}]}
FAQs
Unknown package
We found that deep_sort demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.