Socket
Socket
Sign inDemoInstall

babel-plugin-polyfill-corejs2

Package Overview
Dependencies
66
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.1 to 0.3.2

2

lib/built-in-definitions.js
"use strict";
exports.__esModule = true;
exports.StaticProperties = exports.InstanceProperties = exports.BuiltIns = exports.CommonIterators = void 0;
exports.StaticProperties = exports.InstanceProperties = exports.CommonIterators = exports.BuiltIns = void 0;

@@ -6,0 +6,0 @@ var _corejs2BuiltIns = _interopRequireDefault(require("@babel/compat-data/corejs2-built-ins"));

@@ -16,7 +16,7 @@ "use strict";

var babel = _interopRequireWildcard(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 _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
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 _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }

@@ -27,6 +27,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

types: t
} = babel.default || babel;
} = _babel.default || _babel;
const presetEnvCompat = "#__secret_key__@babel/preset-env__compatibility";
const runtimeCompat = "#__secret_key__@babel/runtime__compatibility"; // $FlowIgnore
const runtimeCompat = "#__secret_key__@babel/runtime__compatibility";
const has = Function.call.bind(Object.hasOwnProperty);

@@ -37,3 +36,5 @@

entryInjectRegenerator
} = {},
} = {
entryInjectRegenerator: false
},
[runtimeCompat]: {

@@ -43,3 +44,6 @@ useBabelRuntime,

ext = ".js"
} = {}
} = {
useBabelRuntime: "",
runtimeVersion: ""
}
}) {

@@ -111,3 +115,3 @@ const resolve = api.createMetaResolver({

if (resolved.kind !== "global" && meta.object && meta.placement === "prototype") {
if (resolved.kind !== "global" && "object" in meta && meta.object && meta.placement === "prototype") {
const low = meta.object.toLowerCase();

@@ -123,3 +127,4 @@ deps = deps.filter(m => m.includes(low));

if (meta.key === "Symbol.iterator") {
path.replaceWith(t.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] // meta.kind === "in" narrows this
));
}

@@ -141,3 +146,3 @@

callee: path.node
}) && path.parent.arguments.length === 0) {
}) && path.parentPath.node.arguments.length === 0) {
path.parentPath.replaceWith(t.callExpression(utils.injectDefaultImport(`${coreJSBase}/get-iterator${ext}`, "getIterator"), [path.node.object]));

@@ -144,0 +149,0 @@ path.skip();

{
"name": "babel-plugin-polyfill-corejs2",
"version": "0.3.1",
"version": "0.3.2",
"description": "A Babel plugin to inject imports to core-js@2 polyfills",

@@ -29,11 +29,11 @@ "repository": {

"dependencies": {
"@babel/compat-data": "^7.13.11",
"@babel/helper-define-polyfill-provider": "^0.3.1",
"@babel/compat-data": "^7.17.7",
"@babel/helper-define-polyfill-provider": "^0.3.2",
"semver": "^6.1.1"
},
"devDependencies": {
"@babel/core": "^7.13.0",
"@babel/helper-plugin-test-runner": "^7.10.4",
"@babel/plugin-transform-for-of": "^7.10.4",
"@babel/plugin-transform-modules-commonjs": "^7.10.4"
"@babel/core": "^7.17.8",
"@babel/helper-plugin-test-runner": "^7.16.7",
"@babel/plugin-transform-for-of": "^7.16.7",
"@babel/plugin-transform-modules-commonjs": "^7.17.7"
},

@@ -43,3 +43,3 @@ "peerDependencies": {

},
"gitHead": "f5eb1c6d74fa29afdb0a3a533dfc5742557197bc"
"gitHead": "62b9025beeec450a1ff5d61fadcf63963aec5015"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc