MCPcopy Create free account
hub / github.com/PromtEngineer/localGPT / hasExcessiveWhitespace

Function hasExcessiveWhitespace

src/utils/textNormalization.ts:45–63  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

43 * Check if text contains excessive whitespace that needs normalization
44 */
45export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected