Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

419 B
Raw Blame
const mimeToMode = {
  "text/plain": "text/plain",
  "text/xml": "application/xml",
  "text/html": "htmlmixed",
  "application/xml": "application/xml",
  "application/hal+json": "application/ld+json",
  "application/vnd.api+json": "application/ld+json",
  "application/json": "application/ld+json",
}

export function getEditorLangForMimeType(mimeType: string): string {
  return mimeToMode[mimeType] || "text/plain"
}