(value)
| 4423 | } |
| 4424 | |
| 4425 | function extractStructuredString(value) { |
| 4426 | if (typeof value === 'string' && value.trim()) { |
| 4427 | return value; |
| 4428 | } |
| 4429 | if (!value || typeof value !== 'object') { |
| 4430 | return null; |
| 4431 | } |
| 4432 | return extractTextCandidate(value) ?? extractTextCandidate(value?.message) ?? extractTextCandidate(value?.error); |
| 4433 | } |
| 4434 | |
| 4435 | function extractTextCandidate(value) { |
| 4436 | if (typeof value === 'string') { |
no test coverage detected