forked from boos/BoosAPI
[codex] fix cross-database JSON boundary handling (#283)
* fix: normalize cross-database json boundaries * fix: address json boundary review comments --------- Co-authored-by: apple <apple@appledeMacBook-Pro.local>
This commit is contained in:
@@ -7,7 +7,8 @@ function serializeSnapshot(snapshot: unknown): string | null {
|
||||
return JSON.stringify(snapshot);
|
||||
}
|
||||
|
||||
export function parseRouteDecisionSnapshot(value: string | null | undefined): unknown | null {
|
||||
export function parseRouteDecisionSnapshot(value: unknown): unknown | null {
|
||||
if (value && typeof value === 'object') return value;
|
||||
if (typeof value !== 'string' || value.trim().length === 0) return null;
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
|
||||
Reference in New Issue
Block a user