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

Function parseSelectorChain

src/utils/selectors-parse.ts:63–76  ·  view source on GitHub ↗
(expression: string)

Source from the content-addressed store, hash-verified

61]);
62
63export function parseSelectorChain(expression: string): SelectorChain {
64 const raw = expression.trim();
65 if (!raw) {
66 throw new AppError('INVALID_ARGS', 'Selector expression cannot be empty');
67 }
68 const segments = splitByFallback(raw);
69 if (segments.length === 0) {
70 throw new AppError('INVALID_ARGS', 'Selector expression cannot be empty');
71 }
72 return {
73 raw,
74 selectors: segments.map((segment) => parseSelector(segment)),
75 };
76}
77
78export function tryParseSelectorChain(expression: string): SelectorChain | null {
79 try {

Callers 11

isCommandFunction · 0.90
waitForSelectorFunction · 0.90
resolveSelectorNodeFunction · 0.90
selectors.test.tsFile · 0.90
tryParseSelectorChainFunction · 0.85

Calls 2

splitByFallbackFunction · 0.85
parseSelectorFunction · 0.85

Tested by 1