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.20.5 to 7.20.7

6

lib/node/parentheses.js

@@ -112,2 +112,5 @@ "use strict";

};
function isTSTypeExpression(node) {
return isTSAsExpression(node) || isTSSatisfiesExpression(node) || isTSTypeAssertion(node);
}
const isClassExtendsClause = (node, parent) => isClass(parent, {

@@ -214,3 +217,3 @@ superClass: node

test: node
}) || isAwaitExpression(parent) || isTSTypeAssertion(parent) || isTSAsExpression(parent) || isTSSatisfiesExpression(parent)) {
}) || isAwaitExpression(parent) || isTSTypeExpression(parent)) {
return true;

@@ -235,2 +238,3 @@ }

function LogicalExpression(node, parent) {
if (isTSTypeExpression(parent)) return true;
switch (node.operator) {

@@ -237,0 +241,0 @@ case "||":

5

lib/printer.js

@@ -15,3 +15,4 @@ "use strict";

isClassBody,
isTSInterfaceBody
isTSInterfaceBody,
isTSEnumDeclaration
} = _t;

@@ -630,3 +631,3 @@ const SCIENTIFIC_NOTATION = /e/i;

const singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value);
const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent);
const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent) && !isTSEnumDeclaration(parent);
if (type === 0) {

@@ -633,0 +634,0 @@ this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction(parent, {

{
"name": "@babel/generator",
"version": "7.20.5",
"version": "7.20.7",
"description": "Turns an AST into code.",

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

"dependencies": {
"@babel/types": "^7.20.5",
"@babel/types": "^7.20.7",
"@jridgewell/gen-mapping": "^0.3.2",

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

"@babel/helper-fixtures": "^7.19.4",
"@babel/parser": "^7.20.5",
"@babel/parser": "^7.20.7",
"@jridgewell/trace-mapping": "^0.3.8",

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

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc