(node: any, source?: string, lineStarts?: number[])
| 805 | } |
| 806 | |
| 807 | function getRenderedElementText(node: any, source?: string, lineStarts?: number[]): string { |
| 808 | const children = node.children; |
| 809 | if (!children) return ""; |
| 810 | |
| 811 | let text = ""; |
| 812 | let previousChild: any | null = null; |
| 813 | let previousText = ""; |
| 814 | |
| 815 | for (const child of children) { |
| 816 | const childText = getRenderedChildText(child, source, lineStarts); |
| 817 | if (!childText) continue; |
| 818 | |
| 819 | if (previousChild) { |
| 820 | const sourceBetween = getSourceBetween(previousChild, child, source, lineStarts); |
| 821 | if (needsBoundarySpace(previousText, childText, sourceBetween)) { |
| 822 | text += " "; |
| 823 | } |
| 824 | } |
| 825 | |
| 826 | text += childText; |
| 827 | previousChild = child; |
| 828 | previousText = childText; |
| 829 | } |
| 830 | |
| 831 | return collapseRenderedWhitespace(text); |
| 832 | } |
| 833 | |
| 834 | function prependToChildText(child: any, text: string): boolean { |
| 835 | if (child.type === "JSXText") { |
no test coverage detected