(value: string | null)
| 23 | |
| 24 | // Strictly positive — for params where 0 makes no sense (e.g. connection pool size). |
| 25 | const toPositiveInt = (value: string | null): number | undefined => { |
| 26 | if (value === null || value.trim() === "") { |
| 27 | return undefined; |
| 28 | } |
| 29 | |
| 30 | const parsed = Number.parseInt(value, 10); |
| 31 | return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined; |
| 32 | }; |
| 33 | |
| 34 | // Non-negative — for params where 0 has the documented meaning of "disable / |
| 35 | // unlimited" (e.g. connect_timeout=0 means wait indefinitely, idle lifetime=0 |
no outgoing calls
no test coverage detected