code: usekv,nextjs,frontends (1 files)

This commit is contained in:
2025-12-25 22:31:28 +00:00
parent d8fb9beade
commit 0eb8f90cd8

View File

@@ -30,7 +30,8 @@ function safeParse(raw: string): unknown | undefined {
function safeStringify(value: unknown): string | null {
try {
return JSON.stringify(value)
const serialized = JSON.stringify(value)
return typeof serialized === 'string' ? serialized : null
} catch {
return null
}