* Get the extension for a transpiled file. * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS]
(path: string)
| 879 | * [MUST_UPDATE_FOR_NEW_FILE_EXTENSIONS] |
| 880 | */ |
| 881 | function getEmitExtension(path: string) { |
| 882 | const lastDotIndex = path.lastIndexOf('.'); |
| 883 | if (lastDotIndex >= 0) { |
| 884 | const ext = path.slice(lastDotIndex); |
| 885 | switch (ext) { |
| 886 | case '.js': |
| 887 | case '.ts': |
| 888 | return '.js'; |
| 889 | case '.jsx': |
| 890 | case '.tsx': |
| 891 | return jsxEmitPreserve ? '.jsx' : '.js'; |
| 892 | case '.mjs': |
| 893 | case '.mts': |
| 894 | return '.mjs'; |
| 895 | case '.cjs': |
| 896 | case '.cts': |
| 897 | return '.cjs'; |
| 898 | } |
| 899 | } |
| 900 | return '.js'; |
| 901 | } |
| 902 | |
| 903 | type GetOutputFunction = (code: string, fileName: string) => SourceOutput; |
| 904 | /** |
no outgoing calls
no test coverage detected
searching dependent graphs…