(
blocks: readonly { readonly type: string }[],
separator = '',
)
| 3246 | * and their readonly/DeepImmutable variants via structural typing. |
| 3247 | */ |
| 3248 | export 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 | |
| 3258 | export function getContentText( |
| 3259 | content: string | DeepImmutable<Array<ContentBlockParam>>, |
no outgoing calls
no test coverage detected