( node: TextSurfaceNode, displayType?: string, )
| 45 | } |
| 46 | |
| 47 | export function describeTextSurface( |
| 48 | node: TextSurfaceNode, |
| 49 | displayType?: string, |
| 50 | ): { |
| 51 | text: string; |
| 52 | isLargeSurface: boolean; |
| 53 | shouldSummarize: boolean; |
| 54 | } { |
| 55 | const text = extractReadableText(node); |
| 56 | const isLargeSurface = isLargeTextSurface(node, displayType); |
| 57 | return { |
| 58 | text, |
| 59 | isLargeSurface, |
| 60 | shouldSummarize: isLargeSurface && shouldSummarizeTextSurface(text), |
| 61 | }; |
| 62 | } |
| 63 | |
| 64 | function shouldSummarizeTextSurface(text: string): boolean { |
| 65 | if (!text) { |
no test coverage detected
searching dependent graphs…