from typing import Union
from pathlib import Path


def check_size(path: Union[str, Path], size: int):
    """Check if the size of a file matches the expected one.

    Parameters
    ----------
    path : str or Path
        Path to the file.
    size : str
        Expected size of the file.

    """
    return Path(path).stat().st_size == size