| 19 | }; |
| 20 | |
| 21 | export 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 | }; |