(envVal: string | undefined)
| 104 | * non-numeric / non-positive value falls back to the default (10s). |
| 105 | */ |
| 106 | export function resolveParseTimeoutMs(envVal: string | undefined): number { |
| 107 | if (envVal !== undefined && envVal !== '') { |
| 108 | const n = Number(envVal); |
| 109 | if (Number.isFinite(n) && n > 0) return Math.floor(n); |
| 110 | } |
| 111 | return DEFAULT_PARSE_TIMEOUT_MS; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Per-file soft timeout. Size scaling helps legitimate large sources, but an |
no outgoing calls
no test coverage detected