* 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.
(raw: string | undefined)
| 509 | * the env var / default). Silently clamps out-of-range values. |
| 510 | */ |
| 511 | function parseRequestTimeoutFlag(raw: string | undefined): number | undefined { |
| 512 | if (raw === undefined) return undefined; |
| 513 | const n = Number(raw); |
| 514 | if (!Number.isFinite(n) || n <= 0) return undefined; |
| 515 | return Math.round(n * 1000); // seconds → milliseconds |
| 516 | } |
| 517 | |
| 518 | function makeClient(opts: CommonOptions, deps: ProjectDeps): HttpClient { |
| 519 | return makeHttpClient(opts, { |
no outgoing calls
no test coverage detected