Files
hoppscotch/packages/hoppscotch-common/src/helpers/editorutils.ts
2022-12-02 03:05:35 -05:00

13 lines
388 B
TypeScript

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