Bugfixes for args, updated the README

This commit is contained in:
atmaranto
2024-03-09 05:32:08 -06:00
parent 793854d21b
commit 0b4788d2af
4 changed files with 42 additions and 14 deletions
+7
View File
@@ -101,3 +101,10 @@ def get_value_at_index(obj: Union[Sequence, Mapping], index: int) -> Any:
return obj[index]
except KeyError:
return obj['result'][index]
def parse_arg(s: str):
""" Parses a JSON string, returning it unchanged if the parsing fails. """
try:
return json.loads(s)
except json.JSONDecodeError:
return s