Skip to content

Commit 86d9f19

Browse files
committed
refactor: Forward optionals where applicable
1 parent e4059c8 commit 86d9f19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pystac/stac_io.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def json_loads(self, txt: str, *args: Any, **kwargs: Any) -> Dict[str, Any]:
9898
if orjson is not None:
9999
result = orjson.loads(txt)
100100
else:
101-
result = json.loads(txt)
101+
result = json.loads(txt, *args, **kwargs)
102102
return result
103103

104104
def json_dumps(self, json_dict: Dict[str, Any], *args: Any, **kwargs: Any) -> str:
@@ -115,9 +115,11 @@ def json_dumps(self, json_dict: Dict[str, Any], *args: Any, **kwargs: Any) -> st
115115
json_dict : The dictionary to serialize
116116
"""
117117
if orjson is not None:
118-
return orjson.dumps(json_dict, option=orjson.OPT_INDENT_2).decode("utf-8")
118+
return orjson.dumps(json_dict, option=orjson.OPT_INDENT_2, **kwargs).decode(
119+
"utf-8"
120+
)
119121
else:
120-
return json.dumps(json_dict, indent=2)
122+
return json.dumps(json_dict, *args, indent=2, **kwargs)
121123

122124
def stac_object_from_dict(
123125
self,

0 commit comments

Comments
 (0)