def truncate_directory(directory: str) -> str:
    """Simple truncation of a given directory path as string."""

    if len(directory) > 50:
        split_directory = directory.split('/')
        prefix_truncated = '/'.join(directory.split('/')[len(split_directory)-5:])
        return '.../' + prefix_truncated
    else:
        return directory