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

Function buildDirectIosGetResult

src/daemon/selector-runtime.ts:394–408  ·  view source on GitHub ↗
(
  property: 'text' | 'attrs',
  selector: string,
  result: DirectIosSelectorQueryResult,
)

Source from the content-addressed store, hash-verified

392}
393
394function buildDirectIosGetResult(
395 property: 'text' | 'attrs',
396 selector: string,
397 result: DirectIosSelectorQueryResult,
398): Record<string, unknown> | null {
399 if (!result.found || !result.node) return null;
400 const base = {
401 target: { kind: 'selector' as const, selector },
402 node: result.node,
403 selectorChain: [selector],
404 };
405 if (property === 'attrs') return { kind: 'attrs', ...base };
406 if (typeof result.text !== 'string') return null;
407 return { kind: 'text', ...base, text: result.text };
408}
409
410function buildDirectIosIsResult(
411 predicate: Exclude<IsPredicate, 'exists' | 'hidden'>,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected