(obj: Record<string, unknown>, key: string)
| 372 | } |
| 373 | |
| 374 | function numericField(obj: Record<string, unknown>, key: string): number | undefined { |
| 375 | const v = obj[key]; |
| 376 | if (typeof v === "number" && Number.isFinite(v)) return v; |
| 377 | if (typeof v === "string") { |
| 378 | const n = Number.parseFloat(v); |
| 379 | return Number.isFinite(n) ? n : undefined; |
| 380 | } |
| 381 | return undefined; |
| 382 | } |
| 383 | |
| 384 | /** |
| 385 | * Persist a new OAuth token set, always preserving a co-located |
no outgoing calls
no test coverage detected