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

Method extractText

deepwiki/deepwiki.ts:379–394  ·  view source on GitHub ↗
(result: any)

Source from the content-addressed store, hash-verified

377 private closed = false;
378
379 private extractText(result: any): string {
380 const parts = result?.content;
381 if (!Array.isArray(parts)) {
382 if (typeof result === "string") return result;
383 if (typeof result?.text === "string") return result.text;
384 return String(result ?? "");
385 }
386 const texts = parts
387 .map((p: any) => {
388 if (p?.type === "text" && typeof p?.text === "string") return p.text;
389 if (typeof p?.text === "string") return p.text;
390 return "";
391 })
392 .filter(Boolean);
393 return texts.join("\n").trim();
394 }
395
396 private stripWikiExploreTail(text: string): string {
397 if (!text) return text;

Callers 1

askMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected