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

Function isImageAttachment

packages/opencode/src/util/media.ts:11–13  ·  view source on GitHub ↗
(mime: string)

Source from the content-addressed store, hash-verified

9}
10
11export function isImageAttachment(mime: string) {
12 return mime.startsWith("image/") && mime !== "image/svg+xml" && mime !== "image/vnd.fastbidsheet"
13}
14
15export function sniffAttachmentMime(bytes: Uint8Array, fallback: string) {
16 if (startsWith(bytes, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])) return "image/png"

Callers 1

webfetch.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected