MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / normalizeText

Function normalizeText

sdk/src/tools/read-url.ts:102–113  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

100}
101
102function normalizeText(text: string): string {
103 return text
104 .replace(/\r/g, '')
105 .replace(/[ \t\f\v]+/g, ' ')
106 .replace(/ *\n */g, '\n')
107 .replace(/\n{3,}/g, '\n\n')
108 .split('\n')
109 .map((line) => line.trim())
110 .filter(Boolean)
111 .join('\n')
112 .trim()
113}
114
115function extractFirstMatch(html: string, pattern: RegExp): string | undefined {
116 const match = html.match(pattern)

Callers 6

extractFirstMatchFunction · 0.85
extractMetaContentFunction · 0.85
extractHtmlFunction · 0.85
getValueFunction · 0.85
extractTextByContentTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected