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

@babel/plugin-proposal-class-static-block

Package Overview
Dependencies
Maintainers
6
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-proposal-class-static-block - npm Package Compare versions

Comparing version 7.12.13 to 7.13.11

18

lib/index.js

@@ -43,19 +43,17 @@ "use strict";

const privateNames = new Set();
let staticBlockPath;
const body = classBody.get("body");
for (const path of classBody.get("body")) {
for (const path of body) {
if (path.isPrivate()) {
privateNames.add(path.get("key.id").node.name);
} else if (path.isStaticBlock()) {
staticBlockPath = path;
}
}
if (!staticBlockPath) {
return;
for (const path of body) {
if (!path.isStaticBlock()) continue;
const staticBlockPrivateId = generateUid(scope, privateNames);
privateNames.add(staticBlockPrivateId);
const staticBlockRef = t.privateName(t.identifier(staticBlockPrivateId));
path.replaceWith(t.classPrivateProperty(staticBlockRef, template.expression.ast`(() => { ${path.node.body} })()`, [], true));
}
const staticBlockRef = t.privateName(t.identifier(generateUid(scope, privateNames)));
classBody.pushContainer("body", t.classPrivateProperty(staticBlockRef, template.expression.ast`(() => { ${staticBlockPath.node.body} })()`, [], true));
staticBlockPath.remove();
}

@@ -62,0 +60,0 @@

{
"name": "@babel/plugin-proposal-class-static-block",
"version": "7.12.13",
"version": "7.13.11",
"description": "Allow parsing of class static blocks",

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

"dependencies": {
"@babel/helper-plugin-utils": "^7.12.13",
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/plugin-syntax-class-static-block": "^7.12.13"

@@ -30,6 +30,6 @@ },

"devDependencies": {
"@babel/core": "7.12.13",
"@babel/helper-plugin-test-runner": "7.12.13"
"@babel/core": "7.13.10",
"@babel/helper-plugin-test-runner": "7.13.10"
},
"homepage": "https://babel.dev/docs/en/next/babel-plugin-proposal-class-static-block"
}
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