This commit is contained in:
2026-01-02 21:02:51 +01:00
parent 0407393eda
commit e2431f2b21
3 changed files with 27 additions and 13 deletions
+4 -1
View File
@@ -14,7 +14,7 @@ def dump_scalar(entry: hints.JSONDataScalar) -> str:
case False:
return "false\n"
case _:
return f"{entry:s}\n"
return f"{entry}\n"
def dump(obj: dict[str, hints.JSONDataScalar | list[hints.JSONDataScalar]]) -> str:
@@ -24,10 +24,13 @@ def dump(obj: dict[str, hints.JSONDataScalar | list[hints.JSONDataScalar]]) -> s
ret += ":"
match value:
case []:
ret += " []\n"
case list() as entries:
ret += "\n"
for entry in entries:
ret += f" - {dump_scalar(entry)}"
case entry:
ret += f" {dump_scalar(entry)}"