Load JSON from file, return None if file doesn't exist.
(filepath: str)
| 23 | |
| 24 | @staticmethod |
| 25 | def load_json(filepath: str) -> Optional[Dict[str, Any]]: |
| 26 | """Load JSON from file, return None if file doesn't exist.""" |
| 27 | if not os.path.exists(filepath): |
| 28 | return None |
| 29 | |
| 30 | with open(filepath, 'r', encoding='utf-8') as f: |
| 31 | return json.load(f) |
| 32 | |
| 33 | @staticmethod |
| 34 | def save_text(content: str, filepath: str) -> None: |
no test coverage detected