(envVal: string | undefined)
| 124 | * non-numeric / non-positive value falls back to the default (10s). |
| 125 | */ |
| 126 | export function resolveParseTimeoutMs(envVal: string | undefined): number { |
| 127 | if (envVal !== undefined && envVal !== '') { |
| 128 | const n = Number(envVal); |
| 129 | if (Number.isFinite(n) && n > 0) return Math.floor(n); |
| 130 | } |
| 131 | return DEFAULT_PARSE_TIMEOUT_MS; |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Per-file soft timeout. Size scaling helps legitimate large sources, but an |
no test coverage detected