lib/primer/view_components/linters/close_button_component_migration_counter.rb
def aria_label_from_octicon(kwargs)
        return if kwargs.blank? || kwargs.type != :hash || kwargs.pairs.blank?

        aria_label = kwargs.pairs.find { |x| x.key.value == :"aria-label" }

        return aria_label.value.source if aria_label

        aria_hash = kwargs.pairs.find { |x| x.key.value == :aria }

        return if aria_hash.blank?

        aria_label = aria_hash.value.pairs.find { |x| x.key.value == :label }

        aria_label&.value&.source
      end
# Extracts the aria-label value from the octicon kwargs.
# It can either be in `"aria-label": "value"`` or `aria: { label: "value" } }`.
Extracts the aria-label value from the octicon kwargs.
Extracts the aria - label value from the octicon kwargs .
def aria_label_from_octicon(kwargs)
        return if kwargs.blank? || kwargs.type != :hash || kwargs.pairs.blank?
        aria_label = kwargs.pairs.find { |x| x.key.value == :"aria-label" }
        return aria_label.value.source if aria_label
        aria_hash = kwargs.pairs.find { |x| x.key.value == :aria }
        return if aria_hash.blank?
        aria_label = aria_hash.value.pairs.find { |x| x.key.value == :label }
        aria_label&.value&.source
      end
def aria_label_from_octicon ( kwargs ) return if kwargs . blank? || kwargs . type != :hash || kwargs . pairs . blank? aria_label = kwargs . pairs . find { | x | x . key . value == :" aria-label " } return aria_label . value . source if aria_label aria_hash = kwargs . pairs . find { | x | x . key . value == :aria } return if aria_hash . blank? aria_label = aria_hash . value . pairs . find { | x | x . key . value == :label } aria_label &. value &. source end
Extracts the aria-label value from the octicon kwargs.
Extracts the aria - label value from the octicon kwargs .
kwargs