(value: unknown)
| 173 | } |
| 174 | |
| 175 | function toInt(value: unknown): number | null { |
| 176 | if (typeof value === 'number') { |
| 177 | return Number.isFinite(value) ? Math.trunc(value) : null; |
| 178 | } |
| 179 | if (typeof value === 'string') { |
| 180 | const n = Number(value); |
| 181 | return Number.isFinite(n) ? Math.trunc(n) : null; |
| 182 | } |
| 183 | return null; |
| 184 | } |
| 185 | |
| 186 | // ── HTTP fetch ──────────────────────────────────────────────────────── |
| 187 |
no outgoing calls
no test coverage detected