(contents: bytes, *, normalize_last_updated: bool)
| 21 | |
| 22 | |
| 23 | def normalized_json_lines(contents: bytes, *, normalize_last_updated: bool) -> list[str]: |
| 24 | data = json.loads(contents.decode("utf-8")) |
| 25 | |
| 26 | if normalize_last_updated and isinstance(data, dict) and "last_updated" in data: |
| 27 | data["last_updated"] = FIXED_TIMESTAMP |
| 28 | |
| 29 | return (json.dumps(data, indent=2, ensure_ascii=False, sort_keys=True) + "\n").splitlines() |
| 30 | |
| 31 | |
| 32 | def raw_text_lines(contents: bytes) -> list[str]: |