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

Function extractTextContent

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

Source from the content-addressed store, hash-verified

2891 * and their readonly/DeepImmutable variants via structural typing.
2892 */
2893export function extractTextContent(
2894 blocks: readonly { readonly type: string }[],
2895 separator = '',
2896): string {
2897 return blocks
2898 .filter((b): b is { type: 'text'; text: string } => b.type === 'text')
2899 .map(b => b.text)
2900 .join(separator)
2901}
2902
2903export function getContentText(
2904 content: string | DeepImmutable<Array<ContentBlockParam>>,

Callers 15

extractTextFromValueFunction · 0.70
generateSessionTitleFunction · 0.70
extractResultTextFunction · 0.70
executeStopFailureHooksFunction · 0.70
executeStopHooksFunction · 0.70
getContentTextFunction · 0.70
getTaskOutputDataFunction · 0.50
extractPartialResultFunction · 0.50
runAsyncAgentLifecycleFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected