SYNC: Merge pull request #10 from dbgate/feat-chat-compl-api

This commit is contained in:
Jan Prochazka
2025-09-11 14:52:56 +02:00
committed by Diflow
parent 580e0f9df7
commit 1f89a6304b
11 changed files with 259 additions and 19 deletions

View File

@@ -386,6 +386,9 @@ export function safeJsonParse(json, defaultValue?, logError = false) {
if (_isArray(json) || _isPlainObject(json)) {
return json;
}
if (!json) {
return defaultValue;
}
try {
return JSON.parse(json);
} catch (err) {