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

Function normalizeRef

src/kernel/snapshot.ts:137–145  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

135}
136
137export function normalizeRef(input: string): string | null {
138 const trimmed = input.trim();
139 if (trimmed.startsWith('@')) {
140 const ref = trimmed.slice(1);
141 return ref ? ref : null;
142 }
143 if (trimmed.startsWith('e')) return trimmed;
144 return null;
145}
146
147export function findNodeByRef(nodes: SnapshotNode[], ref: string): SnapshotNode | null {
148 return nodes.find((node) => node.ref === ref) ?? null;

Callers 5

resolveRefNodeFunction · 0.90
tryResolveRefNodeFunction · 0.90
assertVisibleRefTargetFunction · 0.90
waitCommandFunction · 0.90
resolveSnapshotScopeFunction · 0.90

Calls 1

startsWithMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…