Skip to content

Commit f0ed57c

Browse files
author
Erica Windisch
committed
ruby2.5: replace filter_map with each_with_object
filter_map was introduced in Ruby 2.7, breaking CI on Ruby 2.5 and 2.6.
1 parent b4b1fb8 commit f0ed57c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/jwt/jwk/set.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def initialize(jwks = nil, options = {}) # rubocop:disable Metrics/CyclomaticCom
2222
[jwks]
2323
when Hash
2424
jwks = jwks.transform_keys(&:to_sym)
25-
[*jwks[:keys]].filter_map do |k|
26-
JWT::JWK.new(k, nil, options)
25+
[*jwks[:keys]].each_with_object([]) do |k, arr|
26+
arr << JWT::JWK.new(k, nil, options)
2727
rescue JWT::UnsupportedKeyType
2828
nil
2929
end

0 commit comments

Comments
 (0)