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

Function readElementTarget

src/commands/command-input.ts:340–351  ·  view source on GitHub ↗
(record: Record<string, unknown>, key: string)

Source from the content-addressed store, hash-verified

338}
339
340function readElementTarget(record: Record<string, unknown>, key: string): ElementTargetInput {
341 const target = readRecordField(record, key);
342 const kind = requiredEnum(target, 'kind', ['ref', 'selector'] as const);
343 if (kind === 'ref') {
344 return {
345 kind,
346 ref: requiredString(target, 'ref'),
347 label: optionalString(target, 'label'),
348 };
349 }
350 return { kind, selector: requiredString(target, 'selector') };
351}
352
353export function readPoint(record: Record<string, unknown>, key: string): PointInput {
354 const point = readRecordField(record, key);

Callers 1

elementTargetFieldFunction · 0.85

Calls 4

readRecordFieldFunction · 0.85
requiredEnumFunction · 0.85
requiredStringFunction · 0.70
optionalStringFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…