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

Function normalizeTargetShutdownResult

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

Source from the content-addressed store, hash-verified

238}
239
240export function normalizeTargetShutdownResult(value: unknown): TargetShutdownResult | undefined {
241 if (!isRecord(value)) return undefined;
242 if (
243 typeof value.success !== 'boolean' ||
244 typeof value.exitCode !== 'number' ||
245 typeof value.stdout !== 'string' ||
246 typeof value.stderr !== 'string'
247 ) {
248 return undefined;
249 }
250 const error = normalizeTargetShutdownError(value.error);
251 return {
252 success: value.success,
253 exitCode: value.exitCode,
254 stdout: value.stdout,
255 stderr: value.stderr,
256 ...(error ? { error } : {}),
257 };
258}
259
260function normalizeTargetShutdownError(value: unknown): NormalizedError | undefined {
261 if (!isRecord(value)) return undefined;

Callers 1

createAgentDeviceClientFunction · 0.90

Calls 2

isRecordFunction · 0.90

Tested by

no test coverage detected