MCPcopy Create free account
hub / github.com/callstack/agent-device / normalizeDeviceTarget

Function normalizeDeviceTarget

src/commands/management/runtime/admin.ts:252–266  ·  view source on GitHub ↗
(
  target: BackendDeviceTarget | undefined,
)

Source from the content-addressed store, hash-verified

250}
251
252function normalizeDeviceTarget(
253 target: BackendDeviceTarget | undefined,
254): BackendDeviceTarget | undefined {
255 if (!target) return undefined;
256 const id = normalizeOptionalText(target.id, 'target.id');
257 const name = normalizeOptionalText(target.name, 'target.name');
258 const normalized = {
259 ...(id ? { id } : {}),
260 ...(name ? { name } : {}),
261 ...(target.platform ? { platform: target.platform } : {}),
262 ...(target.target ? { target: target.target } : {}),
263 ...(target.headless !== undefined ? { headless: target.headless } : {}),
264 };
265 return Object.keys(normalized).length > 0 ? normalized : undefined;
266}
267
268// fallow-ignore-next-line complexity
269function formatInstallResult(

Callers 2

bootCommandFunction · 0.85
shutdownCommandFunction · 0.85

Calls 1

normalizeOptionalTextFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…