11 lines
311 B
Python
Raw Normal View History

import json
from typing import List, Dict, Any
2024-11-01 18:07:08 -03:00
def compact(a_string: str) -> str:
2024-12-14 06:34:11 -03:00
return "\n".join([line.strip() for line in a_string.splitlines() if line.strip()])
def make_jsonl(content: List[Dict[str, Any]]) -> str:
return "\n".join([json.dumps(line, separators=(",", ":")) for line in content])