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

Function normalizeStartupSample

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

Source from the content-addressed store, hash-verified

220}
221
222export function normalizeStartupSample(value: unknown): StartupPerfSample | undefined {
223 if (!isRecord(value)) return undefined;
224 if (
225 typeof value.durationMs !== 'number' ||
226 typeof value.measuredAt !== 'string' ||
227 typeof value.method !== 'string'
228 ) {
229 return undefined;
230 }
231 return {
232 durationMs: value.durationMs,
233 measuredAt: value.measuredAt,
234 method: value.method,
235 appTarget: readOptionalString(value, 'appTarget'),
236 appBundleId: readOptionalString(value, 'appBundleId'),
237 };
238}
239
240export function normalizeTargetShutdownResult(value: unknown): TargetShutdownResult | undefined {
241 if (!isRecord(value)) return undefined;

Callers 1

createAgentDeviceClientFunction · 0.90

Calls 2

isRecordFunction · 0.90
readOptionalStringFunction · 0.90

Tested by

no test coverage detected