def deep_update(this: dict, other: dict) -> dict:
    """Recursively updates the values of a dictionary.
    Just as with the regular dict.update() implementation does the function
    preferably uses the values of the other dictionary.

    Raises a type error, if not both of the parameters are dictionaries.

    :param value: Dictionary to update
    :param other: Other dictionary to merge into the first one.
    :return: Updated dictionary
    """

    for k, v in other.items():
        if isinstance(v, dict):
            this[k] = deep_update(this.get(k, {}), v)
        else:
            this[k] = other[k]

    return this