refactor(web): 去冗余 cast(idx.valueOf / dict[error] as string)

stream/sse.ts SseFrameBuffer 去 idx.valueOf()(idx 本就是 number);jobs/job.ts 去 dict["error"] as string(typeof 守卫后 TS 自动收窄)。typecheck 绿。
This commit is contained in:
Yaojia Wang
2026-07-08 13:27:45 +02:00
parent 16f2eae2d3
commit 64145422eb
2 changed files with 2 additions and 2 deletions

View File

@@ -45,7 +45,7 @@ export function narrowJob(raw: unknown): JobView {
status: asStatus(dict["status"]),
progress: asProgress(dict["progress"]),
result: asResult(dict["result"]),
error: typeof dict["error"] === "string" ? (dict["error"] as string) : null,
error: typeof dict["error"] === "string" ? dict["error"] : null,
};
}