(...candidates: Array<unknown>)
| 6 | * by the OTel middleware, or the optional numeric fields on `TokenUsage`. |
| 7 | */ |
| 8 | export function firstNumber(...candidates: Array<unknown>): number | undefined { |
| 9 | for (const candidate of candidates) { |
| 10 | if (typeof candidate === 'number' && Number.isFinite(candidate)) { |
| 11 | return candidate |
| 12 | } |
| 13 | } |
| 14 | return undefined |
| 15 | } |
no outgoing calls
no test coverage detected