Skip to content

Commit

Permalink
Prevent pirates from transforming folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark1626 committed Aug 29, 2019
1 parent f4e0e1d commit cc09d52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/jest-transform/src/ScriptTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ export default class ScriptTransformer {
this.preloadTransformer(moduleName);

let transforming = false;
const ext = path.extname(moduleName);
const revertHook = addHook(
(code, filename) => {
try {
Expand All @@ -475,7 +476,7 @@ export default class ScriptTransformer {
}
},
{
exts: [path.extname(moduleName)],
exts: ext === '' ? ['.js'] : [ext],
ignoreNodeModules: false,
matcher: filename => {
if (transforming) {
Expand Down

0 comments on commit cc09d52

Please sign in to comment.