MCPcopy
hub / github.com/claude-code-best/claude-code / extractTextContent

Function extractTextContent

src/utils/messages.ts:3248–3256  ·  view source on GitHub ↗
(
  blocks: readonly { readonly type: string }[],
  separator = '',
)

Source from the content-addressed store, hash-verified

3246 * and their readonly/DeepImmutable variants via structural typing.
3247 */
3248export function extractTextContent(
3249 blocks: readonly { readonly type: string }[],
3250 separator = '',
3251): string {
3252 return blocks
3253 .filter((b): b is { type: 'text'; text: string } => b.type === 'text')
3254 .map(b => b.text)
3255 .join(separator)
3256}
3257
3258export function getContentText(
3259 content: string | DeepImmutable<Array<ContentBlockParam>>,

Callers 15

getTaskOutputDataFunction · 0.85
extractPartialResultFunction · 0.85
runAsyncAgentLifecycleFunction · 0.85
callFunction · 0.85
useMemorySurveyFunction · 0.85
extractTextFromValueFunction · 0.85
generateSessionTitleFunction · 0.85
extractResultTextFunction · 0.85
executeStopFailureHooksFunction · 0.85
executeStopHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected