MCPcopy Create free account
hub / github.com/WJX20/claude-code / getFirstContentItem

Function getFirstContentItem

src/utils/collapseReadSearch.ts:31–34  ·  view source on GitHub ↗

* Safely get the first content item from a MessageContent value. * Returns undefined for string content or empty arrays.

(content: MessageContent | undefined)

Source from the content-addressed store, hash-verified

29 * Returns undefined for string content or empty arrays.
30 */
31function 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).

Callers 7

getCollapsibleToolInfoFunction · 0.85
isTextBreakerFunction · 0.85
isNonCollapsibleToolUseFunction · 0.85
shouldSkipMessageFunction · 0.85
isCollapsibleToolUseFunction · 0.85
getToolUseIdsFromMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected