def validate_category_or_command_name(name):
    """
    Validates the given category name.
    
    Parameters
    ----------
    name : `str`
        The name of a category or command.
    
    Returns
    -------
    name : `str`
        The validated name.
    
    Raises
    ------
    TypeError
        If `name` was not given as `str`.
    ValueError
        If `name`'s length is out of range [1:128] characters.
    """
    name_type = type(name)
    if name_type is str:
        pass
    elif issubclass(name_type, str):
        name = str(name)
    else:
        raise TypeError(
            f'Category and command names can be `str`, got {name_type.__name__}; {name!r}.'
        )
    
    name_length = len(name)
    if (name_length < 1) or (name_length > 128):
        raise ValueError(
            f'`Category and command name length can be in range [0:128], got {name_length}; {name!r}.'
        )
    
    return name