from pathlib import Path
from typing import Union
import json


def load_json_data(fpath: Path) -> Union[list, dict]:
    """
    Loads a JSON file and returns data.

    Args:
        fpath (Path): The path to the file

    Returns:
        Union[list, dict]: The data loaded from JSON.
    """
    with open(fpath) as f:
        data = json.load(f)
    return data