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

Method cleanContent

apps/sim/lib/chunkers/docs-chunker.ts:213–225  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

211 }
212
213 private cleanContent(content: string): string {
214 return content
215 .replace(/\r\n/g, '\n')
216 .replace(/\r/g, '\n')
217 .replace(/^import\s+.*$/gm, '')
218 .replace(/^export\s+.*$/gm, '')
219 .replace(/<\/?[a-zA-Z][^>]*>/g, ' ')
220 .replace(/\{\/\*[\s\S]*?\*\/\}/g, ' ')
221 .replace(/\{[^{}]*\}/g, ' ')
222 .replace(/\n{3,}/g, '\n\n')
223 .replace(/[ \t]{2,}/g, ' ')
224 .trim()
225 }
226
227 private parseFrontmatter(content: string): { data: Frontmatter; content: string } {
228 const frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/

Callers 1

splitContentMethod · 0.95

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected