feat: map basic information for scheme A1111

This commit is contained in:
Manuel Schmid
2024-01-28 18:04:40 +01:00
parent ee21c2b6bc
commit e19596c2df
3 changed files with 128 additions and 27 deletions
+10
View File
@@ -197,6 +197,16 @@ def quote(text):
return json.dumps(text, ensure_ascii=False)
def unquote(text):
if len(text) == 0 or text[0] != '"' or text[-1] != '"':
return text
try:
return json.loads(text)
except Exception:
return text
def is_json(data: str) -> bool:
try:
loaded_json = json.loads(data)