MCPcopy Index your code
hub / github.com/simstudioai/sim / cleanText

Function cleanText

apps/sim/lib/chunkers/utils.ts:13–21  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

11}
12
13export function cleanText(text: string): string {
14 return text
15 .replace(/\r\n/g, '\n')
16 .replace(/\r/g, '\n')
17 .replace(/\n{3,}/g, '\n\n')
18 .replace(/\t/g, ' ')
19 .replace(/ {2,}/g, ' ')
20 .trim()
21}
22
23export function addOverlap(chunks: string[], overlapChars: number): string[] {
24 if (overlapChars <= 0 || chunks.length <= 1) {

Callers 6

chunkMethod · 0.90
chunkMethod · 0.90
chunkMethod · 0.90
utils.test.tsFile · 0.90
chunkMethod · 0.90
chunkMethod · 0.90

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected