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

Function parseSelector

src/utils/selectors-parse.ts:138–146  ·  view source on GitHub ↗
(segment: string)

Source from the content-addressed store, hash-verified

136}
137
138function parseSelector(segment: string): Selector {
139 const raw = segment.trim();
140 if (!raw) throw new AppError('INVALID_ARGS', 'Selector segment cannot be empty');
141 const tokens = tokenize(raw);
142 if (tokens.length === 0) {
143 throw new AppError('INVALID_ARGS', `Invalid selector segment: ${segment}`);
144 }
145 return { raw, terms: tokens.map(parseTerm) };
146}
147
148function parseTerm(token: string): SelectorTerm {
149 const normalized = token.trim();

Callers 1

parseSelectorChainFunction · 0.85

Calls 1

tokenizeFunction · 0.85

Tested by

no test coverage detected