Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-typescript

Package Overview
Dependencies
Maintainers
4
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-typescript - npm Package Compare versions

Comparing version 7.24.8 to 7.25.0

19

lib/enum.js

@@ -7,2 +7,3 @@ "use strict";

exports.default = transpileEnum;
exports.isSyntacticallyString = isSyntacticallyString;
exports.translateEnumValues = translateEnumValues;

@@ -12,2 +13,3 @@ var _core = require("@babel/core");

var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
var _helperSkipTransparentExpressionWrappers = require("@babel/helper-skip-transparent-expression-wrappers");
const ENUMS = new WeakMap();

@@ -87,3 +89,3 @@ const buildEnumWrapper = _core.template.expression(`

} = translateEnumValues(path, t);
const assignments = x.map(([memberName, memberValue]) => buildEnumMember(t.isStringLiteral(memberValue), {
const assignments = x.map(([memberName, memberValue]) => buildEnumMember(isSyntacticallyString(memberValue), {
ENUM: t.cloneNode(id),

@@ -102,2 +104,17 @@ NAME: memberName,

}
function isSyntacticallyString(expr) {
expr = (0, _helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes)(expr);
switch (expr.type) {
case "BinaryExpression":
{
const left = expr.left;
const right = expr.right;
return expr.operator === "+" && (isSyntacticallyString(left) || isSyntacticallyString(right));
}
case "TemplateLiteral":
case "StringLiteral":
return true;
}
return false;
}
function ReferencedIdentifier(expr, state) {

@@ -104,0 +121,0 @@ const {

11

package.json
{
"name": "@babel/plugin-transform-typescript",
"version": "7.24.8",
"version": "7.25.0",
"description": "Transform TypeScript into ES.next",

@@ -21,4 +21,5 @@ "repository": {

"@babel/helper-annotate-as-pure": "^7.24.7",
"@babel/helper-create-class-features-plugin": "^7.24.8",
"@babel/helper-create-class-features-plugin": "^7.25.0",
"@babel/helper-plugin-utils": "^7.24.8",
"@babel/helper-skip-transparent-expression-wrappers": "^7.24.7",
"@babel/plugin-syntax-typescript": "^7.24.7"

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

"devDependencies": {
"@babel/core": "^7.24.8",
"@babel/core": "^7.24.9",
"@babel/helper-plugin-test-runner": "^7.24.7",
"@babel/traverse": "^7.24.8",
"@babel/types": "^7.24.8"
"@babel/traverse": "^7.25.0",
"@babel/types": "^7.25.0"
},

@@ -36,0 +37,0 @@ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-typescript",

@@ -23,2 +23,5 @@ /* This file is automatically generated by scripts/generators/tsconfig.js */

{
"path": "../../packages/babel-helper-skip-transparent-expression-wrappers"
},
{
"path": "../../packages/babel-plugin-syntax-typescript"

@@ -25,0 +28,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc