Collapse all whitespace runs (including newlines) to a single space.
(s: string)
| 221 | |
| 222 | /** Collapse all whitespace runs (including newlines) to a single space. */ |
| 223 | function normalizeWs(s: string): string { |
| 224 | return s.replace(/\s+/g, " "); |
| 225 | } |
| 226 | |
| 227 | /** Check if a JSX element's text content (recursive) contains the given text. |
| 228 | * Uses whitespace-normalized comparison because React collapses JSX whitespace |