Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/plugin-transform-proto-to-assign

Package Overview
Dependencies
Maintainers
4
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-proto-to-assign - npm Package Compare versions

Comparing version 7.18.9 to 7.20.7

lib/index.js.map

25

lib/index.js

@@ -7,10 +7,6 @@ "use strict";

exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _core = require("@babel/core");
var _default = (0, _helperPluginUtils.declare)(api => {
api.assertVersion(7);
function isProtoKey(node) {

@@ -21,3 +17,2 @@ return !_core.types.isSpreadElement(node) && _core.types.isStringLiteral(_core.types.toComputedKey(node, node.key), {

}
function isProtoAssignmentExpression(node) {

@@ -29,7 +24,6 @@ const left = node;

}
function buildDefaultsCallExpression(expr, ref, file) {
return _core.types.expressionStatement(_core.types.callExpression(file.addHelper("defaults"), [ref, expr.right]));
return _core.types.expressionStatement(_core.types.callExpression(file.addHelper("defaults"), [
ref, expr.right]));
}
return {

@@ -45,7 +39,6 @@ name: "transform-proto-to-assign",

const temp = path.scope.maybeGenerateMemoised(left);
if (temp) {
nodes.push(_core.types.expressionStatement(_core.types.assignmentExpression("=", temp, left)));
nodes.push(_core.types.expressionStatement(_core.types.assignmentExpression("=", temp,
left)));
}
nodes.push(buildDefaultsCallExpression(path.node, _core.types.cloneNode(temp || left), file));

@@ -55,3 +48,2 @@ if (temp) nodes.push(_core.types.cloneNode(temp));

},
ExpressionStatement(path, {

@@ -64,3 +56,2 @@ file

})) return;
if (isProtoAssignmentExpression(expr.left)) {

@@ -70,3 +61,2 @@ path.replaceWith(buildDefaultsCallExpression(expr, expr.left.object, file));

},
ObjectExpression(path, {

@@ -82,6 +72,4 @@ file

} = node;
for (let i = 0; i < properties.length; i++) {
const prop = properties[i];
if (isProtoKey(prop)) {

@@ -93,3 +81,2 @@ proto = prop.value;

}
if (proto) {

@@ -101,7 +88,7 @@ const args = [_core.types.objectExpression([]), proto];

}
}
};
});
exports.default = _default;
exports.default = _default;
//# sourceMappingURL=index.js.map
{
"name": "@babel/plugin-transform-proto-to-assign",
"version": "7.18.9",
"version": "7.20.7",
"description": "Babel plugin for turning __proto__ into a shallow property clone",

@@ -20,3 +20,3 @@ "repository": {

"dependencies": {
"@babel/helper-plugin-utils": "^7.18.9"
"@babel/helper-plugin-utils": "^7.20.2"
},

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

"devDependencies": {
"@babel/core": "^7.18.9",
"@babel/core": "^7.20.7",
"@babel/helper-plugin-test-runner": "^7.18.6"

@@ -30,0 +30,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc