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

Function convert

packages/core/src/tool/webfetch.ts:111–116  ·  view source on GitHub ↗
(content: string, contentType: string, format: Format)

Source from the content-addressed store, hash-verified

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)
114 if (format === "text") return extractTextFromHTML(content)
115 return content
116}
117
118const layer = Layer.effectDiscard(
119 Effect.gen(function* () {

Callers 1

webfetch.tsFile · 0.70

Calls 2

convertHTMLToMarkdownFunction · 0.70
extractTextFromHTMLFunction · 0.70

Tested by

no test coverage detected