mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
Merge pull request #1143 from TriliumNext/fix_ts-file-mime-import
fix(import/mime): fix ts file mime import handling
This commit is contained in:
commit
48d4093274
@ -12,12 +12,17 @@ describe("#getMime", () => {
|
|||||||
],
|
],
|
||||||
|
|
||||||
[
|
[
|
||||||
"File extension that is defined in EXTENSION_TO_MIME",
|
"File extension ('.py') that is defined in EXTENSION_TO_MIME",
|
||||||
["test.py"], "text/x-python"
|
["test.py"], "text/x-python"
|
||||||
],
|
],
|
||||||
|
|
||||||
[
|
[
|
||||||
"File extension with inconsisten capitalization that is defined in EXTENSION_TO_MIME",
|
"File extension ('.ts') that is defined in EXTENSION_TO_MIME",
|
||||||
|
["test.ts"], "text/x-typescript"
|
||||||
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
"File extension with inconsistent capitalization that is defined in EXTENSION_TO_MIME",
|
||||||
["test.gRoOvY"], "text/x-groovy"
|
["test.gRoOvY"], "text/x-groovy"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ const CODE_MIME_TYPES = new Set([
|
|||||||
"text/x-sql",
|
"text/x-sql",
|
||||||
"text/x-stex",
|
"text/x-stex",
|
||||||
"text/x-swift",
|
"text/x-swift",
|
||||||
|
"text/x-typescript",
|
||||||
"text/x-yaml"
|
"text/x-yaml"
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -65,7 +66,8 @@ const EXTENSION_TO_MIME = new Map<string, string>([
|
|||||||
[".py", "text/x-python"],
|
[".py", "text/x-python"],
|
||||||
[".rb", "text/x-ruby"],
|
[".rb", "text/x-ruby"],
|
||||||
[".scala", "text/x-scala"],
|
[".scala", "text/x-scala"],
|
||||||
[".swift", "text/x-swift"]
|
[".swift", "text/x-swift"],
|
||||||
|
[".ts", "text/x-typescript"]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** @returns false if MIME is not detected */
|
/** @returns false if MIME is not detected */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user