Fix trace diagnostics validation issues

Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
Cursor AgentandJulius Marminge committed 2026-07-08 16:18:20 +00:00
1 parent 5429dfb4d5
commit 55038ce366
2 files changed
+2 -5

No files matched your search

@@ -59,10 +59,7 @@ describe("TraceDiagnostics", () => {
durationMs: 50,
}),
"not-json",
JSON.stringify({
name: "missing span fields",
durationMs: "not-a-number",
}),
'{"name":"missing span fields","durationMs":"not-a-number"}',
].join("\n"),
},
{
@@ -100,7 +100,7 @@ function toStringValue(value: unknown): Option.Option<string> {
return typeof value === "string" && value.trim().length > 0 ? Option.some(value) : Option.none();
}
function unixNanoToDateTime(value: string | null | undefined): Option.Option<DateTime.Utc> {
function unixNanoToDateTime(value: unknown): Option.Option<DateTime.Utc> {
const text = Option.getOrUndefined(toStringValue(value));
if (text === undefined) return Option.none();
try {