babel-plugin-polyfill-corejs3
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -41,3 +41,3 @@ "use strict"; | ||
const available = new Set((0, _getModulesListForTargetVersion.default)(version)); | ||
const coreJSBase = method === "usage-pure" ? proposals ? "core-js-pure/features" : "core-js-pure/stable" : "core-js"; | ||
const coreJSPureBase = proposals ? "core-js-pure/features" : "core-js-pure/stable"; | ||
@@ -55,3 +55,3 @@ function maybeInjectGlobal(names, utils) { | ||
if (desc.pure && !(object && desc.exclude && desc.exclude.includes(object)) && shouldInjectPolyfill(desc.name)) { | ||
return utils.injectDefaultImport(`${coreJSBase}/${desc.pure}.js`, hint); | ||
return utils.injectDefaultImport(`${coreJSPureBase}/${desc.pure}.js`, hint); | ||
} | ||
@@ -107,3 +107,3 @@ } | ||
if (meta.key === "Symbol.iterator") { | ||
path.replaceWith(_core.types.callExpression(utils.injectDefaultImport(`${coreJSBase}/is-iterable.js`, "isIterable"), [path.node.right])); | ||
path.replaceWith(_core.types.callExpression(utils.injectDefaultImport((0, _utils.coreJSPureHelper)("is-iterable"), "isIterable"), [path.node.right])); | ||
} | ||
@@ -129,9 +129,9 @@ | ||
if (path.parent.arguments.length === 0) { | ||
path.parentPath.replaceWith(_core.types.callExpression(utils.injectDefaultImport(`${coreJSBase}/get-iterator.js`, "getIterator"), [path.node.object])); | ||
path.parentPath.replaceWith(_core.types.callExpression(utils.injectDefaultImport((0, _utils.coreJSPureHelper)("get-iterator"), "getIterator"), [path.node.object])); | ||
path.skip(); | ||
} else { | ||
(0, _utils.callMethod)(path, utils.injectDefaultImport(`${coreJSBase}/get-iterator-method.js`, "getIteratorMethod")); | ||
(0, _utils.callMethod)(path, utils.injectDefaultImport((0, _utils.coreJSPureHelper)("get-iterator-method"), "getIteratorMethod")); | ||
} | ||
} else { | ||
path.replaceWith(_core.types.callExpression(utils.injectDefaultImport(`${coreJSBase}/get-iterator-method.js`, "getIteratorMethod"), [path.node.object])); | ||
path.replaceWith(_core.types.callExpression(utils.injectDefaultImport((0, _utils.coreJSPureHelper)("get-iterator-method"), "getIteratorMethod"), [path.node.object])); | ||
} | ||
@@ -138,0 +138,0 @@ |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.coreJSModule = coreJSModule; | ||
exports.coreJSPureHelper = coreJSPureHelper; | ||
@@ -43,2 +44,6 @@ var _core = require("@babel/core"); | ||
return `core-js/modules/${name}.js`; | ||
} | ||
function coreJSPureHelper(name) { | ||
return `core-js-pure/features/${name}.js`; | ||
} |
{ | ||
"name": "babel-plugin-polyfill-corejs3", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "A Babel plugin to inject imports to core-js@3 polyfills", | ||
@@ -33,3 +33,3 @@ "repository": { | ||
}, | ||
"gitHead": "ab1ebbd308b1111920327d95dc4c66a5ae4518f5" | ||
"gitHead": "740427dfa150fbce1cad77602c35cec7cfe69605" | ||
} |
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
30481
522