@babel/generator
Advanced tools
Comparing version 7.20.5 to 7.20.7
@@ -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 "||": |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
455402
4644
Updated@babel/types@^7.20.7