We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b68e5e7 commit a221f9bCopy full SHA for a221f9b
lib/internal/modules/esm/formats.js
@@ -24,12 +24,7 @@ if (experimentalWasmModules) {
24
* @returns {string | null}
25
*/
26
function mimeToFormat(mime) {
27
- if (
28
- RegExpPrototypeExec(
29
- /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i,
30
- mime,
31
- ) !== null
32
- ) return 'module';
+ if (mime === 'text/javascript') return 'module';
33
if (mime === 'application/json') return 'json';
34
if (experimentalWasmModules && mime === 'application/wasm') return 'wasm';
35
return null;
0 commit comments