(path: pathlib.Path, payload: typing.Any)
| 278 | |
| 279 | |
| 280 | def write_json(path: pathlib.Path, payload: typing.Any) -> None: |
| 281 | path.parent.mkdir(parents=True, exist_ok=True) |
| 282 | with open(path, "w", encoding="utf-8") as handle: |
| 283 | json.dump(payload, handle, indent=2, sort_keys=True) |
| 284 | handle.write("\n") |
| 285 | |
| 286 | |
| 287 | def read_json(path: pathlib.Path) -> typing.Any: |