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

Function normalizeSnapshotResult

src/client/client.ts:356–373  ·  view source on GitHub ↗
(
  data: Record<string, unknown>,
  session: string | undefined,
)

Source from the content-addressed store, hash-verified

354}
355
356function normalizeSnapshotResult(
357 data: Record<string, unknown>,
358 session: string | undefined,
359): CaptureSnapshotResult {
360 const appBundleId = readOptionalString(data, 'appBundleId');
361 return {
362 nodes: readSnapshotNodes(data.nodes),
363 truncated: data.truncated === true,
364 appName: readOptionalString(data, 'appName'),
365 appBundleId,
366 ...optionalSnapshotResponseFields(data),
367 identifiers: {
368 session,
369 appId: appBundleId,
370 appBundleId,
371 },
372 };
373}
374
375function optionalSnapshotResponseFields(
376 data: Record<string, unknown>,

Callers 1

createAgentDeviceClientFunction · 0.85

Calls 3

readOptionalStringFunction · 0.90
readSnapshotNodesFunction · 0.90

Tested by

no test coverage detected