chore: split app to commons and web (squash commit)
This commit is contained in:
12
packages/hoppscotch-common/src/helpers/editorutils.ts
Normal file
12
packages/hoppscotch-common/src/helpers/editorutils.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
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"
|
||||
}
|
||||
Reference in New Issue
Block a user