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

@babel/plugin-transform-shorthand-properties

Package Overview
Dependencies
Maintainers
4
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-shorthand-properties - npm Package Compare versions

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

lib/package.json

29

lib/index.js

@@ -1,10 +0,4 @@

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _core = require("@babel/core");
var _default = (0, _helperPluginUtils.declare)(api => {
import { declare } from "@babel/helper-plugin-utils";
import { types as t } from "@babel/core";
export default declare(api => {
api.assertVersion(7);

@@ -19,11 +13,11 @@ return {

if (node.kind === "method") {
const func = _core.types.functionExpression(null, node.params, node.body, node.generator, node.async);
const func = t.functionExpression(null, node.params, node.body, node.generator, node.async);
func.returnType = node.returnType;
const computedKey = _core.types.toComputedKey(node);
if (_core.types.isStringLiteral(computedKey, {
const computedKey = t.toComputedKey(node);
if (t.isStringLiteral(computedKey, {
value: "__proto__"
})) {
path.replaceWith(_core.types.objectProperty(computedKey, func, true));
path.replaceWith(t.objectProperty(computedKey, func, true));
} else {
path.replaceWith(_core.types.objectProperty(node.key, func, node.computed));
path.replaceWith(t.objectProperty(node.key, func, node.computed));
}

@@ -37,7 +31,7 @@ }

if (node.shorthand) {
const computedKey = _core.types.toComputedKey(node);
if (_core.types.isStringLiteral(computedKey, {
const computedKey = t.toComputedKey(node);
if (t.isStringLiteral(computedKey, {
value: "__proto__"
})) {
path.replaceWith(_core.types.objectProperty(computedKey, node.value, true));
path.replaceWith(t.objectProperty(computedKey, node.value, true));
} else {

@@ -51,4 +45,3 @@ node.shorthand = false;

});
exports.default = _default;
//# sourceMappingURL=index.js.map
{
"name": "@babel/plugin-transform-shorthand-properties",
"version": "7.21.4-esm.3",
"version": "7.21.4-esm.4",
"description": "Compile ES2015 shorthand properties to ES5",

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

"dependencies": {
"@babel/helper-plugin-utils": "7.21.4-esm.3"
"@babel/helper-plugin-utils": "7.21.4-esm.4"
},

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

"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"
},

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

Sorry, the diff of this file is not supported yet

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