hoppscotch/packages/hoppscotch-app/helpers/editorutils.js

13 lines
372 B
JavaScript

const mimeToMode = {
"text/plain": "text/x-yaml",
"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) {
return mimeToMode[mimeType] || "text/x-yaml"
}