fix: preserve large integer precision when formatting JSON in value editor (fixes #2765)
* fix: preserve large integer precision when formatting JSON in value editor (fixes #2765) * fix: add missing showDiagramDialog to useNavigationTargets in AiAssistant
This commit is contained in:
1 parent
326c4f5495
commit
9410bf42a9
6 files changed
+116
-8
No files matched your search
@@ -19,6 +19,7 @@ import { useEditorFontFamilyStyle } from "@/composables/useEditorFontFamilyStyle
|
||||
import { createRedisShikiJsonHighlighter, type RedisJsonHighlighter } from "@/lib/redis/redisJsonHighlighter";
|
||||
import { copyToClipboard } from "@/lib/common/clipboard";
|
||||
import { formatTtl } from "@/lib/common/ttlFormat";
|
||||
import { safeJsonFormat } from "@/lib/common/safeJsonFormat";
|
||||
import { canEditRedisMemberDetail, clampRedisMemberDetailSheetWidth, formatRedisMemberDetail, getRedisMemberSelectionKey } from "@/lib/redis/redisValuePresentation";
|
||||
|
||||
const { t } = useI18n();
|
||||
@@ -347,8 +348,7 @@ function handleStringInput() {
|
||||
|
||||
function formatJsonText(raw: string): string | null {
|
||||
try {
|
||||
const parsed = JSON.parse(raw);
|
||||
return JSON.stringify(parsed, null, 2);
|
||||
return safeJsonFormat(raw, 2);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
@@ -356,8 +356,7 @@ function formatJsonText(raw: string): string | null {
|
||||
|
||||
function compressJsonText(raw: string): string | null {
|
||||
try {
|
||||
const parsed = JSON.parse(raw);
|
||||
return JSON.stringify(parsed);
|
||||
return safeJsonFormat(raw);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user