def check_key!(key)
      return if key.is_a?(String) || key.is_a?(Symbol)
      raise TypeError, 'key must be a String or Symbol'
    end
def check_key!(key)
      return if key.is_a?(String) || key.is_a?(Symbol)
      raise TypeError, 'key must be a String or Symbol'
    end
Internal: Raises an error if the key is not a String
 or a Symbol.

 key - A key provided by the user.