| 69 | |
| 70 | // Check if the node or any of its children contains a retry tag |
| 71 | export function hasRetryTag(node: Node): boolean { |
| 72 | if (node.nodeType === Node.TEXT_NODE) return false; |
| 73 | |
| 74 | // Type guard to check if the node is an Element |
| 75 | if (node instanceof Element && node.classList.contains('fluent-read-failure')) return true; |
| 76 | |
| 77 | // Check children only if the node is an Element |
| 78 | if (node instanceof Element) { |
| 79 | return Array.from(node.children).some(child => hasRetryTag(child)); |
| 80 | } |
| 81 | |
| 82 | return false; |
| 83 | } |
| 84 | |
| 85 | // Search for a node with a specific class name |
| 86 | export function searchClassName(node: Node, className: string): Node | null { |