(env: EnvLike = process.env)
| 26 | * @param env Environment variables to check (defaults to process.env for production use) |
| 27 | */ |
| 28 | export function getMaxBashTimeoutMs(env: EnvLike = process.env): number { |
| 29 | const envValue = env.BASH_MAX_TIMEOUT_MS |
| 30 | if (envValue) { |
| 31 | const parsed = parseInt(envValue, 10) |
| 32 | if (!isNaN(parsed) && parsed > 0) { |
| 33 | // Ensure max is at least as large as default |
| 34 | return Math.max(parsed, getDefaultBashTimeoutMs(env)) |
| 35 | } |
| 36 | } |
| 37 | // Always ensure max is at least as large as default |
| 38 | return Math.max(MAX_TIMEOUT_MS, getDefaultBashTimeoutMs(env)) |
| 39 | } |
| 40 |
no test coverage detected