@jest/transform
Advanced tools
Comparing version 27.0.0-next.5 to 27.0.0-next.6
@@ -29,12 +29,2 @@ 'use strict'; | ||
function _url() { | ||
const data = require('url'); | ||
_url = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _core() { | ||
@@ -390,26 +380,6 @@ const data = require('@babel/core'); | ||
async ([, transformPath, transformerConfig]) => { | ||
let transformer; | ||
let transformer = await (0, _jestUtil().requireOrImportModule)( | ||
transformPath | ||
); | ||
try { | ||
transformer = (0, _jestUtil().interopRequireDefault)( | ||
require(transformPath) | ||
).default; | ||
} catch (error) { | ||
if (error.code === 'ERR_REQUIRE_ESM') { | ||
const configUrl = (0, _url().pathToFileURL)(transformPath); // node `import()` supports URL, but TypeScript doesn't know that | ||
const importedConfig = await import(configUrl.href); | ||
if (!importedConfig.default) { | ||
throw new Error( | ||
`Jest: Failed to load ESM transformer at ${transformPath} - did you use a default export?` | ||
); | ||
} | ||
transformer = importedConfig.default; | ||
} else { | ||
throw error; | ||
} | ||
} | ||
if (!transformer) { | ||
@@ -416,0 +386,0 @@ throw new TypeError('Jest: a transform must export something.'); |
{ | ||
"name": "@jest/transform", | ||
"version": "27.0.0-next.5", | ||
"version": "27.0.0-next.6", | ||
"repository": { | ||
@@ -24,5 +24,5 @@ "type": "git", | ||
"graceful-fs": "^4.2.4", | ||
"jest-haste-map": "^27.0.0-next.5", | ||
"jest-haste-map": "^27.0.0-next.6", | ||
"jest-regex-util": "^27.0.0-next.0", | ||
"jest-util": "^27.0.0-next.3", | ||
"jest-util": "^27.0.0-next.6", | ||
"micromatch": "^4.0.2", | ||
@@ -35,3 +35,3 @@ "pirates": "^4.0.1", | ||
"devDependencies": { | ||
"@jest/test-utils": "^27.0.0-next.5", | ||
"@jest/test-utils": "^27.0.0-next.6", | ||
"@types/babel__core": "^7.1.0", | ||
@@ -52,3 +52,3 @@ "@types/convert-source-map": "^1.5.1", | ||
}, | ||
"gitHead": "0a2b94282170b6d4cc26c2d2003cc04ffebe5e3f" | ||
"gitHead": "974d2f22b7deeb4f683fb38dd1ee3a0e984916df" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1
46360
1321
Updatedjest-util@^27.0.0-next.6