@putout/printer
Advanced tools
Comparing version 1.8.7 to 1.8.8
'use strict'; | ||
const {isNext} = require('../is'); | ||
const { | ||
isNext, | ||
isProgramParent, | ||
} = require('../is'); | ||
const isFirstStatement = (path) => path.get('body.0')?.isStatement(); | ||
@@ -38,2 +41,5 @@ | ||
if (!isNext(path) && !isNext(path.parentPath) && isProgramParent(path.parentPath)) | ||
return false; | ||
if (parentPath.isStatement() && !path.node.body.length && !isNext(parentPath)) | ||
@@ -45,5 +51,2 @@ return false; | ||
if (parentPath.isIfStatement() && parentPath.get('consequent').node === path.node && parentPath.node.alternate) | ||
return false; | ||
return true; | ||
@@ -50,0 +53,0 @@ } |
{ | ||
"name": "@putout/printer", | ||
"version": "1.8.7", | ||
"version": "1.8.8", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", |
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
48738
1387