from pathlib import Path


def postfit_available(rex_dir: str | Path) -> bool:
    """Check if TRExFitter result directory contains postFit information.

    Parameters
    ----------
    rex_dir : str or pathlib.Path
        Path of the TRExFitter result directory

    Returns
    -------
    bool
        True of postFit discovered

    """
    histdir = Path(rex_dir) / "Histograms"
    for f in histdir.iterdir():
        if "postFit" in f.name:
            return True
    return False