def assert_trailing_slash(link: str) -> str:
    """
    Add a trailing slash to a link if there isn't one.
    :param link: link to directory or Web site.
    :return: the same link with a trailing slash.
    """
    link = link.rstrip()
    if link[-1] == "/":
        return link
    else:
        return link + "/"