Comparing version 0.1.3 to 0.1.4
21
index.js
@@ -36,2 +36,17 @@ "use strict"; | ||
var transformOpts; | ||
function getJestTransformConfig(jestConfig) { | ||
var _a, _b; | ||
if ("transformerConfig" in jestConfig) { | ||
// jest 27 | ||
return jestConfig.transformerConfig; | ||
} | ||
if ("transform" in jestConfig) { | ||
// jest 26 | ||
return ((_b = (_a = jestConfig.transform.find(function (_a) { | ||
var transformerPath = _a[1]; | ||
return transformerPath === __filename; | ||
})) === null || _a === void 0 ? void 0 : _a[2]) !== null && _b !== void 0 ? _b : {}); | ||
} | ||
return {}; | ||
} | ||
function set(obj, path, value) { | ||
@@ -53,7 +68,3 @@ var o = obj; | ||
if (!transformOpts) { | ||
var isSwcJestTransformer = function (_a) { | ||
var transformerPath = _a[1]; | ||
return transformerPath === __filename; | ||
}; | ||
var _a = (jestConfig.transform || []).find(isSwcJestTransformer) || [], swcOptions = _a[2]; | ||
var swcOptions = getJestTransformConfig(jestConfig); | ||
if (!swcOptions) { | ||
@@ -60,0 +71,0 @@ var swcrc = path.join(process.cwd(), '.swcrc'); |
{ | ||
"name": "@swc/jest", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "swc integration for jest", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
4184
80