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

Function readDeviceTarget

src/commands/command-input.ts:303–314  ·  view source on GitHub ↗
(
  record: Record<string, unknown>,
  options: CommonInputOptions,
)

Source from the content-addressed store, hash-verified

301}
302
303function readDeviceTarget(
304 record: Record<string, unknown>,
305 options: CommonInputOptions,
306): DeviceTarget | undefined {
307 const deviceTarget = optionalEnum(record, 'deviceTarget', DEVICE_TARGETS);
308 if (options.readTargetAlias === false || record.target === undefined) return deviceTarget;
309 const targetAlias = optionalEnum(record, 'target', DEVICE_TARGETS);
310 if (deviceTarget !== undefined && targetAlias !== deviceTarget) {
311 throw new Error('Expected target alias to match deviceTarget when both are set.');
312 }
313 return deviceTarget ?? targetAlias;
314}
315
316function readInteractionTarget(
317 record: Record<string, unknown>,

Callers 3

readClientDeviceIdentityFunction · 0.90
normalizeOpenDeviceFunction · 0.90
readCommonInputFunction · 0.70

Calls 1

optionalEnumFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…