(text: string)
| 43 | * Check if text contains excessive whitespace that needs normalization |
| 44 | */ |
| 45 | export function hasExcessiveWhitespace(text: string): boolean { |
| 46 | if (!text || typeof text !== 'string') { |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | if (/\n{3,}/.test(text)) { |
| 51 | return true; |
| 52 | } |
| 53 | |
| 54 | if (/[ \t]{3,}/.test(text)) { |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | if (/[ \t]*\n[ \t]*\n[ \t]*\n/.test(text)) { |
| 59 | return true; |
| 60 | } |
| 61 | |
| 62 | return false; |
| 63 | } |
nothing calls this directly
no outgoing calls
no test coverage detected