def validate_unit(unit: str) -> str:
    """
    Validates the unit of an object.

    :param unit: The unit of the object.
    :return: The validated unit.
    """
    if not unit:
        raise ValueError("Unit must not be empty.")
    if len(unit) > 100:
        raise ValueError("Unit must not be longer than 100 characters.")
    return unit