@babel/plugin-transform-typescript
Advanced tools
+32
-51
@@ -42,5 +42,6 @@ import { declare } from '@babel/helper-plugin-utils'; | ||
| } | ||
| const enumIIFE = buildEnumWrapper(Object.assign({}, fill, { | ||
| const enumIIFE = buildEnumWrapper({ | ||
| ...fill, | ||
| INIT: init | ||
| })); | ||
| }); | ||
| if (isPure) annotateAsPure(enumIIFE); | ||
@@ -126,8 +127,6 @@ if (isSeen) { | ||
| if (seen.has(name)) { | ||
| { | ||
| if (expr.scope.hasBinding(name, { | ||
| upToScope: path.scope | ||
| })) { | ||
| return; | ||
| } | ||
| if (expr.scope.hasBinding(name, { | ||
| upToScope: path.scope | ||
| })) { | ||
| return; | ||
| } | ||
@@ -457,12 +456,10 @@ expr.replaceWith(t.memberExpression(t.cloneNode(path.node.id), t.cloneNode(expr.node))); | ||
| let namespaceTopLevel; | ||
| { | ||
| if (types.isTSQualifiedName(id)) { | ||
| namespaceTopLevel = body.body; | ||
| while (types.isTSQualifiedName(id)) { | ||
| namespaceTopLevel = [types.exportNamedDeclaration(types.tsModuleDeclaration(types.cloneNode(id.right), types.tsModuleBlock(namespaceTopLevel)))]; | ||
| id = id.left; | ||
| } | ||
| } else { | ||
| namespaceTopLevel = body.body; | ||
| if (types.isTSQualifiedName(id)) { | ||
| namespaceTopLevel = body.body; | ||
| while (types.isTSQualifiedName(id)) { | ||
| namespaceTopLevel = [types.exportNamedDeclaration(types.tsModuleDeclaration(types.cloneNode(id.right), types.tsModuleBlock(namespaceTopLevel)))]; | ||
| id = id.left; | ||
| } | ||
| } else { | ||
| namespaceTopLevel = body.body; | ||
| } | ||
@@ -612,3 +609,3 @@ let isEmpty = true; | ||
| } = api; | ||
| api.assertVersion("8.0.0-beta.3"); | ||
| api.assertVersion("^7.0.0-0 || ^8.0.0 || 8.0.0-beta.4"); | ||
| const JSX_PRAGMA_REGEX = /\*?\s*@jsx((?:Frag)?)\s+(\S+)/; | ||
@@ -640,3 +637,3 @@ const { | ||
| path.remove(); | ||
| } else ; | ||
| } | ||
| if (node.accessibility) node.accessibility = null; | ||
@@ -666,4 +663,4 @@ if (node.abstract) node.abstract = null; | ||
| for (const paramPath of path.get("params")) { | ||
| const param = paramPath.node; | ||
| if (param.type === "TSParameterProperty") { | ||
| if (paramPath.isTSParameterProperty()) { | ||
| const param = paramPath.node; | ||
| const parameter = param.parameter; | ||
@@ -683,3 +680,3 @@ if (PARSED_PARAMS.has(parameter)) continue; | ||
| `); | ||
| paramPath.replaceWith(paramPath.get("parameter")); | ||
| paramPath.replaceWith(param.parameter); | ||
| scope.registerBinding("param", paramPath); | ||
@@ -910,5 +907,3 @@ } | ||
| if (node.typeParameters) node.typeParameters = null; | ||
| { | ||
| if (node.superTypeArguments) node.superTypeArguments = null; | ||
| } | ||
| if (node.superTypeArguments) node.superTypeArguments = null; | ||
| if (node.implements) node.implements = null; | ||
@@ -973,5 +968,3 @@ if (node.abstract) node.abstract = null; | ||
| const newNode = t.variableDeclaration(varKind, [t.variableDeclarator(id, init)]); | ||
| { | ||
| path.replaceWith(newNode); | ||
| } | ||
| path.replaceWith(newNode); | ||
| path.scope.registerDeclaration(path); | ||
@@ -999,25 +992,15 @@ }, | ||
| CallExpression(path) { | ||
| { | ||
| path.node.typeArguments = null; | ||
| } | ||
| path.node.typeArguments = null; | ||
| }, | ||
| OptionalCallExpression(path) { | ||
| { | ||
| path.node.typeArguments = null; | ||
| } | ||
| path.node.typeArguments = null; | ||
| }, | ||
| NewExpression(path) { | ||
| { | ||
| path.node.typeArguments = null; | ||
| } | ||
| path.node.typeArguments = null; | ||
| }, | ||
| JSXOpeningElement(path) { | ||
| { | ||
| path.node.typeArguments = null; | ||
| } | ||
| path.node.typeArguments = null; | ||
| }, | ||
| TaggedTemplateExpression(path) { | ||
| { | ||
| path.node.typeArguments = null; | ||
| } | ||
| path.node.typeArguments = null; | ||
| } | ||
@@ -1053,10 +1036,8 @@ } | ||
| let sourceFileHasJsx = false; | ||
| { | ||
| t.traverseFast(programPath.node, node => { | ||
| if (t.isJSXElement(node) || t.isJSXFragment(node)) { | ||
| sourceFileHasJsx = true; | ||
| return t.traverseFast.stop; | ||
| } | ||
| }); | ||
| } | ||
| t.traverseFast(programPath.node, node => { | ||
| if (t.isJSXElement(node) || t.isJSXFragment(node)) { | ||
| sourceFileHasJsx = true; | ||
| return t.traverseFast.stop; | ||
| } | ||
| }); | ||
| return !sourceFileHasJsx; | ||
@@ -1063,0 +1044,0 @@ } |
+11
-11
| { | ||
| "name": "@babel/plugin-transform-typescript", | ||
| "version": "8.0.0-beta.3", | ||
| "version": "8.0.0-beta.4", | ||
| "description": "Transform TypeScript into ES.next", | ||
@@ -20,16 +20,16 @@ "repository": { | ||
| "dependencies": { | ||
| "@babel/helper-annotate-as-pure": "^8.0.0-beta.3", | ||
| "@babel/helper-create-class-features-plugin": "^8.0.0-beta.3", | ||
| "@babel/helper-plugin-utils": "^8.0.0-beta.3", | ||
| "@babel/helper-skip-transparent-expression-wrappers": "^8.0.0-beta.3", | ||
| "@babel/plugin-syntax-typescript": "^8.0.0-beta.3" | ||
| "@babel/helper-annotate-as-pure": "^8.0.0-beta.4", | ||
| "@babel/helper-create-class-features-plugin": "^8.0.0-beta.4", | ||
| "@babel/helper-plugin-utils": "^8.0.0-beta.4", | ||
| "@babel/helper-skip-transparent-expression-wrappers": "^8.0.0-beta.4", | ||
| "@babel/plugin-syntax-typescript": "^8.0.0-beta.4" | ||
| }, | ||
| "peerDependencies": { | ||
| "@babel/core": "^8.0.0-beta.3" | ||
| "@babel/core": "^7.0.0-0" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "^8.0.0-beta.3", | ||
| "@babel/helper-plugin-test-runner": "^8.0.0-beta.3", | ||
| "@babel/traverse": "^8.0.0-beta.3", | ||
| "@babel/types": "^8.0.0-beta.3" | ||
| "@babel/core": "^8.0.0-beta.4", | ||
| "@babel/helper-plugin-test-runner": "^8.0.0-beta.4", | ||
| "@babel/traverse": "^8.0.0-beta.4", | ||
| "@babel/types": "^8.0.0-beta.4" | ||
| }, | ||
@@ -36,0 +36,0 @@ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-typescript", |
Sorry, the diff of this file is too big to display
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
138652
-4.06%1048
-1.78%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
Updated
Updated