from pathlib import Path
from typing import Optional


def get_latest_json_file(output_dir: Path) -> Optional[Path]:
    """Get the name of the last data-*.json file."""
    files = list(output_dir.glob("data-*.json"))
    return sorted(files)[-1] if files else None