def case_transform_dict_values(dictionary, func_name, transform):
    """Transform the string-type values of a dictionary.

    :param dictionary: dict to transform
    :param func_name: name of the transformation function used for error messages
    :param transform: transformation function
    :returns: dictionary where string values have been transformed
    """
    if not isinstance(dictionary, dict):
        raise TypeError(f'{func_name} accepts only dictionaries as argument, got {type(dictionary)}')
    new_dict = {}
    for k, v in dictionary.items():
        if isinstance(v, str):
            new_dict[k] = transform(v)
        else:
            new_dict[k] = v
    return new_dict