MCPcopy Create free account
hub / github.com/dwgx/WindsurfAPI / sanitizeText

Function sanitizeText

src/sanitize.js:120–125  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

118 * non-strings and empty strings are returned unchanged.
119 */
120export function sanitizeText(s) {
121 if (typeof s !== 'string' || !s) return s;
122 let out = s;
123 for (const [re, rep] of PATTERNS) out = out.replace(re, rep);
124 return out;
125}
126
127/**
128 * Incremental sanitizer for streamed deltas.

Callers 11

sanitize.test.jsFile · 0.90
chatStreamErrorFunction · 0.90
nonStreamResponseFunction · 0.90
emitToolCallDeltaFunction · 0.90
handlerFunction · 0.90
feedMethod · 0.85
flushMethod · 0.85
sanitizeToolCallFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected