babel-plugin-polyfill-corejs2
Advanced tools
Comparing version 0.1.10 to 0.2.0
@@ -16,6 +16,13 @@ "use strict"; | ||
var _core = require("@babel/core"); | ||
var babel = _interopRequireWildcard(require("@babel/core")); | ||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const { | ||
types: t | ||
} = babel.default || babel; | ||
const presetEnvCompat = "#__secret_key__@babel/preset-env__compatibility"; | ||
@@ -112,3 +119,3 @@ const runtimeCompat = "#__secret_key__@babel/runtime__compatibility"; // $FlowIgnore | ||
if (meta.key === "Symbol.iterator") { | ||
path.replaceWith(_core.types.callExpression(utils.injectDefaultImport(`${coreJSBase}/is-iterable${ext}`, "isIterable"), [path.node.right])); | ||
path.replaceWith(t.callExpression(utils.injectDefaultImport(`${coreJSBase}/is-iterable${ext}`, "isIterable"), [path.node.right])); | ||
} | ||
@@ -131,3 +138,3 @@ | ||
}) && path.parent.arguments.length === 0) { | ||
path.parentPath.replaceWith(_core.types.callExpression(utils.injectDefaultImport(`${coreJSBase}/get-iterator${ext}`, "getIterator"), [path.node.object])); | ||
path.parentPath.replaceWith(t.callExpression(utils.injectDefaultImport(`${coreJSBase}/get-iterator${ext}`, "getIterator"), [path.node.object])); | ||
path.skip(); | ||
@@ -134,0 +141,0 @@ return; |
{ | ||
"name": "babel-plugin-polyfill-corejs2", | ||
"version": "0.1.10", | ||
"version": "0.2.0", | ||
"description": "A Babel plugin to inject imports to core-js@2 polyfills", | ||
@@ -15,2 +15,12 @@ "repository": { | ||
"main": "lib/index.js", | ||
"exports": { | ||
".": [ | ||
{ | ||
"import": "./esm/index.mjs", | ||
"default": "./lib/index.js" | ||
}, | ||
"./lib/index.js" | ||
], | ||
"./package.json": "./package.json" | ||
}, | ||
"keywords": [ | ||
@@ -20,4 +30,4 @@ "babel-plugin" | ||
"dependencies": { | ||
"@babel/compat-data": "^7.13.0", | ||
"@babel/helper-define-polyfill-provider": "^0.1.5", | ||
"@babel/compat-data": "^7.13.11", | ||
"@babel/helper-define-polyfill-provider": "^0.2.0", | ||
"semver": "^6.1.1" | ||
@@ -34,3 +44,3 @@ }, | ||
}, | ||
"gitHead": "7ec5d8eb769d309c78d27a336c9764abc8ac4db7" | ||
} | ||
"gitHead": "841e713e0002eb8aa167553fc43840e526fa2d8c" | ||
} |
81207
9
773
+ Added@babel/helper-define-polyfill-provider@0.2.4(transitive)
- Removed@babel/helper-define-polyfill-provider@0.1.5(transitive)
Updated@babel/compat-data@^7.13.11