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

Function shouldConsumeOptionalPathValue

src/cli/parser/args.ts:284–298  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

282}
283
284function shouldConsumeOptionalPathValue(value: string): boolean {
285 const trimmed = value.trim();
286 if (!trimmed) return false;
287 if (/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(trimmed)) return false;
288 if (
289 trimmed.startsWith('./') ||
290 trimmed.startsWith('../') ||
291 trimmed.startsWith('~/') ||
292 trimmed.startsWith('/')
293 ) {
294 return true;
295 }
296 if (trimmed.includes('/') || trimmed.includes('\\')) return true;
297 return false;
298}
299
300function shouldTreatUnknownDashTokenAsPositional(
301 command: string | null,

Callers 1

parseFlagValueFunction · 0.85

Calls 1

startsWithMethod · 0.80

Tested by

no test coverage detected