(payload: unknown)
| 301 | } |
| 302 | |
| 303 | function payloadToText(payload: unknown): string { |
| 304 | if (typeof payload === `string`) { |
| 305 | return payload |
| 306 | } |
| 307 | if (payload && typeof payload === `object`) { |
| 308 | const text = (payload as { text?: unknown }).text |
| 309 | if (typeof text === `string`) { |
| 310 | return text |
| 311 | } |
| 312 | return JSON.stringify(payload) |
| 313 | } |
| 314 | return String(payload ?? ``) |
| 315 | } |
| 316 | |
| 317 | function findLatestQuestion( |
| 318 | items: Array<{ payload?: unknown } | undefined> |
no outgoing calls
no test coverage detected