from typing import Union
from pathlib import Path


def read_file(filepath: Union[str, Path]) -> str:
    """Read contents of file.

    Args:
        filepath (Union[str, Path]): path to file.

    Returns:
        str: contents of the file
    """
    return Path(filepath).read_text()