MCPcopy Index your code
hub / github.com/adobe/react-spectrum / parseArgs

Function parseArgs

packages/dev/s2-docs/scripts/testAccessibility.mjs:103–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101
102// Parse command line arguments
103function parseArgs() {
104 const args = process.argv.slice(2);
105 const options = {
106 library: 'all',
107 baseUrl: 'http://localhost:1234',
108 headless: true,
109 htmlExt: true,
110 stripPrefix: false
111 };
112
113 for (let i = 0; i < args.length; i++) {
114 switch (args[i]) {
115 case '--library':
116 options.library = args[++i];
117 break;
118 case '--base-url':
119 options.baseUrl = args[++i].replace(/\/$/, ''); // Remove trailing slash
120 break;
121 case '--headless':
122 options.headless = args[++i] !== 'false';
123 break;
124 case '--no-html-ext':
125 options.htmlExt = false;
126 break;
127 case '--strip-prefix':
128 options.stripPrefix = true;
129 break;
130 }
131 }
132
133 return options;
134}
135
136// Get all MDX page paths
137async function getPagePaths(library) {

Callers 3

testAccessibilityFunction · 0.70
index.jsFile · 0.50
index.tsFile · 0.50

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected