MCPcopy Create free account
hub / github.com/anomalyco/opencode / isTextualMime

Function isTextualMime

packages/core/src/tool/webfetch.ts:102–110  ·  view source on GitHub ↗
(mime: string)

Source from the content-addressed store, hash-verified

100const isImageAttachment = (mime: string) =>
101 mime.startsWith("image/") && mime !== "image/svg+xml" && mime !== "image/vnd.fastbidsheet"
102const isTextualMime = (mime: string) =>
103 !mime ||
104 mime.startsWith("text/") ||
105 mime === "application/json" ||
106 mime.endsWith("+json") ||
107 mime === "application/xml" ||
108 mime.endsWith("+xml") ||
109 mime === "application/javascript" ||
110 mime === "application/x-javascript"
111const convert = (content: string, contentType: string, format: Format) => {
112 if (!contentType.includes("text/html")) return content
113 if (format === "markdown") return convertHTMLToMarkdown(content)

Callers 1

webfetch.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected