Dumps all the data into a JSON file.

def json_dump_hook(cfg, text: bool=False):
    """
    Dumps all the data into a JSON file.
    """
    data = cfg.config.dump()

    if not text:
        json.dump(data, cfg.fd)
    else:
        return json.dumps(data)