summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--patternutils/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/patternutils/utils.py b/patternutils/utils.py
index 9160cfe..d1ccacf 100644
--- a/patternutils/utils.py
+++ b/patternutils/utils.py
@@ -29,11 +29,11 @@ def edit(data: Dict[str, str]) -> Dict[str, str]:
return data
-def json_dumps(data: Any, humand_readable: bool = False) -> str:
- if humand_readable:
- return json.dumps(data, indent=4, sort_keys=True)
- else:
- return json.dumps(data, separators=(",", ":"))
+def json_dumps(data: Any, human_readable: bool = False) -> str:
+ config = (
+ {"indent": 4, sort_keys: True} if human_readable else {"separators": (",", ":")}
+ )
+ return json.dumps(data, **config)
def walk(