code: def _convert_to_closest_type(value):
      '''
      Convert string value to it's closest non-string analog, if possible.
  
      :param dict value: The string value to attempt conversion on.
  
      :return: The converted value.
      :rtype: Union[bool, int, None, str]
      '''
      value = salt.utils.stringutils.to_bool(value.strip())
  
      if isinstance(value, bool):
          return value
  
      return salt.utils.stringutils.to_none(salt.utils.stringutils.to_num(value)f _convert_to_closest_type(value):
      '''
      Convert string value to it's closest non-string analog, if possible.
  
      :param dict value: The string value to attempt conversion on.
  
      :return: The converted value.
      :rtype: Union[bool, int, None, str]
      '''
      value = salt.utils.stringutils.to_bool(value.strip())
  
      if isinstance(value, bool):
          return value
  
      return salt.utils.stringutils.to_none(salt.utils.stringutils.to_num(value))
docs: Convert string value to it's closest non-string analog, if possible.
  
      :param dict value: The string value to attempt conversion on.
  
      :return: The converted value.
      :rtype: Union[bool, int, None, str]