Files
hoppscotch/functions/editorutils.js
2020-02-24 21:06:23 -05:00

12 lines
270 B
JavaScript

const mimeToMode = {
"text/plain": "plain_text",
"text/html": "html",
"application/xml": "xml",
"application/hal+json": "json",
"application/json": "json",
}
export function getEditorLangForMimeType(mimeType) {
return mimeToMode[mimeType] || "plain_text"
}