* Safely get the first content item from a MessageContent value. * Returns undefined for string content or empty arrays.
(content: MessageContent | undefined)
| 29 | * Returns undefined for string content or empty arrays. |
| 30 | */ |
| 31 | function getFirstContentItem(content: MessageContent | undefined): ContentItem | undefined { |
| 32 | if (!content || typeof content === 'string') return undefined |
| 33 | return content[0] |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Iterate over content items that are objects (not strings). |
no outgoing calls
no test coverage detected