MCPcopy Create free account
hub / github.com/deta/surf / codeLanguageToMimeType

Function codeLanguageToMimeType

packages/utils/src/io/files.ts:168–172  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

166}
167
168export const codeLanguageToMimeType = (code: string) => {
169 const parsed = code.toLowerCase()
170 if (parsed === 'plaintext') return 'text/plain'
171 return `text/${parsed}`
172}
173
174export const mimeTypeToCodeLanguage = (mimeType: string) => {
175 if (mimeType === 'text/plain') return 'plaintext'

Callers 3

createCodeResourceMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected