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