MCPcopy Index your code
hub / github.com/callstack/agent-device / normalizeTargetShutdownError

Function normalizeTargetShutdownError

src/client/client-normalizers.ts:260–271  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

258}
259
260function 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
273export function readSnapshotNodes(value: unknown): SnapshotNode[] {
274 // Snapshot nodes are produced by the daemon snapshot pipeline and treated as trusted here.

Callers 1

Calls 1

isRecordFunction · 0.90

Tested by

no test coverage detected