(value: unknown)
| 258 | } |
| 259 | |
| 260 | function normalizeTargetShutdownError(value: unknown): NormalizedError | undefined { |
| 261 | if (!isRecord(value)) return undefined; |
| 262 | if (typeof value.code !== 'string' || typeof value.message !== 'string') return undefined; |
| 263 | return { |
| 264 | code: value.code, |
| 265 | message: value.message, |
| 266 | ...(typeof value.hint === 'string' ? { hint: value.hint } : {}), |
| 267 | ...(typeof value.diagnosticId === 'string' ? { diagnosticId: value.diagnosticId } : {}), |
| 268 | ...(typeof value.logPath === 'string' ? { logPath: value.logPath } : {}), |
| 269 | ...(isRecord(value.details) ? { details: value.details } : {}), |
| 270 | }; |
| 271 | } |
| 272 | |
| 273 | export function readSnapshotNodes(value: unknown): SnapshotNode[] { |
| 274 | // Snapshot nodes are produced by the daemon snapshot pipeline and treated as trusted here. |
no test coverage detected