Socket
Socket
Sign inDemoInstall

@babel/generator

Package Overview
Dependencies
Maintainers
4
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/generator - npm Package Compare versions

Comparing version 7.17.12 to 7.18.0

20

lib/generators/typescript.js

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

exports.TSInferType = TSInferType;
exports.TSInstantiationExpression = TSInstantiationExpression;
exports.TSInterfaceBody = TSInterfaceBody;

@@ -96,2 +97,12 @@ exports.TSInterfaceDeclaration = TSInterfaceDeclaration;

function TSTypeParameter(node) {
if (node.in) {
this.word("in");
this.space();
}
if (node.out) {
this.word("out");
this.space();
}
this.word(node.name);

@@ -357,2 +368,6 @@

this.print(node.exprName);
if (node.typeParameters) {
this.print(node.typeParameters, node);
}
}

@@ -617,2 +632,7 @@

function TSInstantiationExpression(node) {
this.print(node.expression, node);
this.print(node.typeParameters, node);
}
function TSEnumDeclaration(node) {

@@ -619,0 +639,0 @@ const {

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

exports.TSInferType = TSInferType;
exports.TSInstantiationExpression = TSInstantiationExpression;
exports.TSTypeAssertion = TSTypeAssertion;

@@ -70,2 +71,3 @@ exports.TSIntersectionType = exports.TSUnionType = TSUnionType;

isTSAsExpression,
isTSInstantiationExpression,
isTSIntersectionType,

@@ -196,2 +198,6 @@ isTSNonNullExpression,

function TSInstantiationExpression(node, parent) {
return (isCallExpression(parent) || isOptionalCallExpression(parent) || isNewExpression(parent) || isTSInstantiationExpression(parent)) && !!parent.typeParameters;
}
function BinaryExpression(node, parent) {

@@ -198,0 +204,0 @@ return node.operator === "in" && (isVariableDeclarator(parent) || isFor(parent));

6

package.json
{
"name": "@babel/generator",
"version": "7.17.12",
"version": "7.18.0",
"description": "Turns an AST into code.",

@@ -22,3 +22,3 @@ "author": "The Babel Team (https://babel.dev/team)",

"dependencies": {
"@babel/types": "^7.17.12",
"@babel/types": "^7.18.0",
"@jridgewell/gen-mapping": "^0.3.0",

@@ -29,3 +29,3 @@ "jsesc": "^2.5.1"

"@babel/helper-fixtures": "^7.17.10",
"@babel/parser": "^7.17.12",
"@babel/parser": "^7.18.0",
"@jridgewell/trace-mapping": "^0.3.8",

@@ -32,0 +32,0 @@ "@types/jsesc": "^2.5.0",

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