editorutils.js 308 B

123456789101112
  1. const mimeToMode = {
  2. "text/plain": "plain_text",
  3. "text/html": "html",
  4. "application/xml": "xml",
  5. "application/hal+json": "json",
  6. "application/vnd.api+json": "json",
  7. "application/json": "json",
  8. }
  9. export function getEditorLangForMimeType(mimeType) {
  10. return mimeToMode[mimeType] || "plain_text"
  11. }