MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / cleanResponseText

Method cleanResponseText

outdated/gemini/gemini.ts:415–426  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

413class HttpClient {
414
415 static cleanResponseText(text: string): string {
416 if (!text) return text;
417 return text
418 .replace(/^\uFEFF/, '')
419 .replace(/\uFFFD/g, '')
420 .replace(/[\uFFFC\uFFFF\uFFFE]/g, '')
421 .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '')
422 .replace(/[\uDC00-\uDFFF]/g, '')
423 .replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])/g, '')
424 .normalize('NFKC')
425 .normalize('NFKC');
426 }
427
428 static async makeRequest(url: string, options: HttpRequestOptions = {}): Promise<HttpResponse> {
429 return new Promise((resolve, reject) => {

Callers 3

makeRequestMethod · 0.45
generateContentMethod · 0.45
generateImageMethod · 0.45

Calls 1

normalizeMethod · 0.80

Tested by

no test coverage detected