Socket
Socket
Sign inDemoInstall

@babel/plugin-proposal-private-property-in-object

Package Overview
Dependencies
60
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.21.4-esm.3 to 7.21.4-esm.4

lib/package.json

31

lib/index.js

@@ -1,12 +0,6 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _pluginSyntaxPrivatePropertyInObject = require("@babel/plugin-syntax-private-property-in-object");
var _helperCreateClassFeaturesPlugin = require("@babel/helper-create-class-features-plugin");
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
var _default = (0, _helperPluginUtils.declare)((api, opt) => {
import { declare } from "@babel/helper-plugin-utils";
import syntaxPlugin from "@babel/plugin-syntax-private-property-in-object";
import { enableFeature, FEATURES, injectInitialization as injectConstructorInit, buildCheckInRHS } from "@babel/helper-create-class-features-plugin";
import annotateAsPure from "@babel/helper-annotate-as-pure";
export default declare((api, opt) => {
api.assertVersion(7);

@@ -57,3 +51,3 @@ const {

} else {
(0, _helperCreateClassFeaturesPlugin.injectInitialization)(classPath, constructorPath, [t.expressionStatement(init)]);
injectConstructorInit(classPath, constructorPath, [t.expressionStatement(init)]);
}

@@ -68,3 +62,3 @@ }

const newExpr = t.newExpression(t.identifier("WeakSet"), []);
(0, _helperAnnotateAsPure.default)(newExpr);
annotateAsPure(newExpr);
outerClass.insertBefore(template.ast`var ${id} = ${newExpr}`);

@@ -76,5 +70,5 @@ }

name: "proposal-private-property-in-object",
inherits: _pluginSyntaxPrivatePropertyInObject.default,
inherits: syntaxPlugin.default,
pre() {
(0, _helperCreateClassFeaturesPlugin.enableFeature)(this.file, _helperCreateClassFeaturesPlugin.FEATURES.privateIn, loose);
enableFeature(this.file, FEATURES.privateIn, loose);
},

@@ -114,3 +108,3 @@ visitor: {

path.replaceWith(template.expression.ast`
${t.cloneNode(outerClass.node.id)} === ${(0, _helperCreateClassFeaturesPlugin.buildCheckInRHS)(node.right, file)}
${t.cloneNode(outerClass.node.id)} === ${buildCheckInRHS(node.right, file)}
`);

@@ -120,7 +114,7 @@ } else {

const id = getWeakSetId(classWeakSets, outerClass, outerClass, (_outerClass$node$id = outerClass.node.id) == null ? void 0 : _outerClass$node$id.name, injectInitialization);
path.replaceWith(template.expression.ast`${id}.has(${(0, _helperCreateClassFeaturesPlugin.buildCheckInRHS)(node.right, file)})`);
path.replaceWith(template.expression.ast`${id}.has(${buildCheckInRHS(node.right, file)})`);
}
} else {
const id = getWeakSetId(fieldsWeakSets, outerClass, privateElement, privateElement.node.key.id.name, injectToFieldInit);
path.replaceWith(template.expression.ast`${id}.has(${(0, _helperCreateClassFeaturesPlugin.buildCheckInRHS)(node.right, file)})`);
path.replaceWith(template.expression.ast`${id}.has(${buildCheckInRHS(node.right, file)})`);
}

@@ -131,4 +125,3 @@ }

});
exports.default = _default;
//# sourceMappingURL=index.js.map
{
"name": "@babel/plugin-proposal-private-property-in-object",
"version": "7.21.4-esm.3",
"version": "7.21.4-esm.4",
"description": "This plugin transforms checks for a private property in an object",

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

"dependencies": {
"@babel/helper-annotate-as-pure": "7.21.4-esm.3",
"@babel/helper-create-class-features-plugin": "7.21.4-esm.3",
"@babel/helper-plugin-utils": "7.21.4-esm.3",
"@babel/helper-annotate-as-pure": "7.21.4-esm.4",
"@babel/helper-create-class-features-plugin": "7.21.4-esm.4",
"@babel/helper-plugin-utils": "7.21.4-esm.4",
"@babel/plugin-syntax-private-property-in-object": "^7.14.5"

@@ -30,4 +30,4 @@ },

"devDependencies": {
"@babel/core": "7.21.4-esm.3",
"@babel/helper-plugin-test-runner": "7.21.4-esm.3"
"@babel/core": "7.21.4-esm.4",
"@babel/helper-plugin-test-runner": "7.21.4-esm.4"
},

@@ -34,0 +34,0 @@ "engines": {

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