Try matching key type

This commit is contained in:
Douglas Eichelberger 2024-11-07 09:11:00 -08:00
parent a81b6a4b44
commit c17ffb8c3b

View File

@ -62,13 +62,12 @@ module Homebrew
end
json = {
"formulae" => json_info(formulae),
"casks" => json_info(casks),
formulae: json_info(formulae),
casks: json_info(casks),
}
puts JSON.pretty_generate(json)
outdated = formulae + casks
else
outdated = if args.formula?
outdated_formulae
@ -170,10 +169,7 @@ module Homebrew
"v1" => :v1,
"v2" => :v2,
}
raise UsageError, "invalid JSON version: #{version}" unless version_hash.include?(version)
version_hash[version]
version_hash.fetch(version) { raise UsageError, "invalid JSON version: #{version}" }
end
sig { returns(T::Array[Formula]) }