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

Function getResolvedTarget

src/daemon/selector-recording.ts:103–116  ·  view source on GitHub ↗
(
  result: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

101}
102
103function getResolvedTarget(
104 result: Record<string, unknown>,
105): { kind: 'ref'; ref: string } | { kind: 'selector'; selector: string } | undefined {
106 const target = result.target;
107 if (!target || typeof target !== 'object') return undefined;
108 const record = target as Record<string, unknown>;
109 if (record.kind === 'ref' && typeof record.ref === 'string') {
110 return { kind: 'ref', ref: record.ref };
111 }
112 if (record.kind === 'selector' && typeof record.selector === 'string') {
113 return { kind: 'selector', selector: record.selector };
114 }
115 return undefined;
116}
117
118function normalizeDaemonRef(ref: string): string {
119 return ref.startsWith('@') ? ref.slice(1) : ref;

Callers 2

buildGetRecordResultFunction · 0.85
toDaemonGetDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected