Skip to content

Commit

Permalink
Remove nullish check from api.caller
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 19, 2023
1 parent 4bf5932 commit e0cb7ba
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/babel-preset-env/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ option \`forceAllTransforms: true\` instead.

const compatData = getPluginList(shippedProposals, bugfixes);
const shouldSkipExportNamespaceFrom =
(modules === "auto" && api.caller?.(supportsExportNamespaceFrom)) ||
(modules === "auto" && api.caller(supportsExportNamespaceFrom)) ||
(modules === false &&
!isRequired("transform-export-namespace-from", transformTargets, {
compatData,
Expand All @@ -365,11 +365,9 @@ option \`forceAllTransforms: true\` instead.
const modulesPluginNames = getModulesPluginNames({
modules,
transformations: moduleTransformations,
// TODO: Remove the 'api.caller' check eventually. Just here to prevent
// unnecessary breakage in the short term for users on older betas/RCs.
shouldTransformESM: modules !== "auto" || !api.caller?.(supportsStaticESM),
shouldTransformESM: modules !== "auto" || !api.caller(supportsStaticESM),
shouldTransformDynamicImport:
modules !== "auto" || !api.caller?.(supportsDynamicImport),
modules !== "auto" || !api.caller(supportsDynamicImport),
shouldTransformExportNamespaceFrom: !shouldSkipExportNamespaceFrom,
});

Expand Down

0 comments on commit e0cb7ba

Please sign in to comment.