MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / parseRequestTimeoutFlag

Function parseRequestTimeoutFlag

src/commands/auth.ts:336–341  ·  view source on GitHub ↗

* Parse the `--request-timeout ` flag value into milliseconds. * Returns `undefined` when the flag was not supplied (factory falls back to * the env var / default). Silently clamps out-of-range values — the * factory applies the same clamp so there is no double-clamp risk.

(raw: string | undefined)

Source from the content-addressed store, hash-verified

334 * factory applies the same clamp so there is no double-clamp risk.
335 */
336function parseRequestTimeoutFlag(raw: string | undefined): number | undefined {
337 if (raw === undefined) return undefined;
338 const n = Number(raw);
339 if (!Number.isFinite(n) || n <= 0) return undefined;
340 return Math.round(n * 1000); // seconds → milliseconds
341}
342
343function makeOutput(mode: OutputMode, deps: AuthDeps): Output {
344 return new Output(mode, { stdout: deps.stdout, stderr: deps.stderr });

Callers 1

resolveCommonOptionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected