validate

in lib/primer/classify/utilities.rb [148:171]


        def validate(key, val, breakpoint)
          unless supported_key?(key)
            raise ArgumentError, "#{key} is not a valid Primer utility key" if validate_class_names?

            return ""
          end

          unless breakpoint.empty? || responsive?(key, val)
            raise ArgumentError, "#{key} does not support responsive values" if validate_class_names?

            return ""
          end

          unless supported_value?(key, val)
            raise ArgumentError, "#{val} is not a valid value for :#{key}. Use one of #{mappings(key)}" if validate_class_names?

            return nil if [true, false].include?(val)

            return "#{key.to_s.dasherize}-#{val.to_s.dasherize}"
          end

          nil
        end