MCPcopy Index your code
hub / github.com/C4illin/ConvertX / normalizeOutputFiletype

Function normalizeOutputFiletype

src/helpers/normalizeFiletype.ts:21–55  ·  view source on GitHub ↗
(filetype: string)

Source from the content-addressed store, hash-verified

19};
20
21export const normalizeOutputFiletype = (filetype: string): string => {
22 const lowercaseFiletype = filetype.toLowerCase();
23
24 switch (lowercaseFiletype) {
25 case "jpeg":
26 return "jpg";
27 case "latex":
28 return "tex";
29 case "markdown_phpextra":
30 case "markdown_strict":
31 case "markdown_mmd":
32 case "markdown":
33 return "md";
34 // assimp format ids that aren't real file extensions — map to the
35 // canonical extension for the underlying format so the output file
36 // opens in third-party viewers. The format id is still passed to
37 // `assimp export -f<id>` so the right encoding/variant is produced.
38 case "glb2":
39 return "glb";
40 case "gltf2":
41 return "gltf";
42 case "objnomtl":
43 return "obj";
44 case "stlb":
45 return "stl";
46 case "plyb":
47 return "ply";
48 case "fbxa":
49 return "fbx";
50 case "assjson":
51 return "json";
52 default:
53 return lowercaseFiletype;
54 }
55};

Callers 1

handleConvertFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected