@putout/printer
Advanced tools
Comparing version 11.6.0 to 11.7.0
'use strict'; | ||
const { | ||
isTSModuleBlock, | ||
isBlockStatement, | ||
isExportNamedDeclaration, | ||
} = require('@putout/babel').types; | ||
const {markAfter} = require('../../mark'); | ||
@@ -7,9 +13,7 @@ const {isNext, isNextParent} = require('../../is'); | ||
const isInsideNamedExport = ({parentPath}) => isExportNamedDeclaration(parentPath); | ||
module.exports.FunctionDeclaration = { | ||
print(path, printer, semantics) { | ||
const { | ||
print, | ||
maybe, | ||
indent, | ||
} = printer; | ||
const {print, maybe} = printer; | ||
@@ -22,3 +26,3 @@ const { | ||
indent(); | ||
maybe.indent(!isInsideNamedExport(path)); | ||
maybe.print(async, 'async '); | ||
@@ -54,3 +58,8 @@ | ||
function isInsideBlockStatement(path) { | ||
if (!path.parentPath.isBlockStatement()) | ||
const {parentPath} = path; | ||
if (isTSModuleBlock(parentPath.parentPath)) | ||
return true; | ||
if (!isBlockStatement(parentPath)) | ||
return false; | ||
@@ -57,0 +66,0 @@ |
@@ -54,2 +54,1 @@ 'use strict'; | ||
} | ||
@@ -29,2 +29,1 @@ 'use strict'; | ||
}); | ||
'use strict'; | ||
const {isLabeledStatement} = require('@putout/babel').types; | ||
const { | ||
@@ -38,5 +39,7 @@ isNext, | ||
const isInsideLabel = ({parentPath}) => isLabeledStatement(parentPath); | ||
module.exports.ExpressionStatement = { | ||
print(path, {indent, print, maybe, store}) { | ||
indent(); | ||
print(path, {print, maybe, store}) { | ||
maybe.indent(!isInsideLabel(path)); | ||
@@ -43,0 +46,0 @@ print('__expression'); |
@@ -24,2 +24,3 @@ 'use strict'; | ||
const {ContinueStatement} = require('./continue-statement'); | ||
const {LabeledStatement} = require('./labeled-statement/labeled-satement'); | ||
@@ -48,8 +49,3 @@ const { | ||
DebuggerStatement, | ||
LabeledStatement(path, {print}) { | ||
print('__label'); | ||
print(':'); | ||
print.space(); | ||
print('__body'); | ||
}, | ||
LabeledStatement, | ||
Program, | ||
@@ -56,0 +52,0 @@ EmptyStatement(path, {write}) { |
{ | ||
"name": "@putout/printer", | ||
"version": "11.6.0", | ||
"version": "11.7.0", | ||
"type": "commonjs", | ||
@@ -57,3 +57,3 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
"@putout/plugin-printer": "^3.0.0", | ||
"@putout/plugin-promises": "^15.0.0", | ||
"@putout/plugin-promises": "^16.0.0", | ||
"@putout/plugin-react-hook-form": "^4.0.0", | ||
@@ -60,0 +60,0 @@ "@putout/plugin-react-hooks": "^6.0.0", |
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
242430
145
5297