Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@putout/printer

Package Overview
Dependencies
Maintainers
0
Versions
603
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/printer - npm Package Compare versions

Comparing version 11.11.0 to 11.12.0

1

lib/tokenize/expressions/unary-expression/unary-expressions.js
'use strict';
const {isLast, isNext} = require('../../is');
const {maybeParens} = require('../../maybe/maybe-parens');

@@ -6,0 +5,0 @@

25

lib/tokenize/statements/if-statement/if-statement.js
'use strict';
const {types} = require('@putout/babel');
const {markAfter} = require('../../mark');
const {exists, isNext} = require('../../is');
const {
isBlockStatement,
isFunctionDeclaration,
} = types;
const isInside = ({parentPath}) => !parentPath.parentPath.isProgram();

@@ -19,2 +24,17 @@ const isEmptyConsequent = (path) => path.get('consequent').isEmptyStatement();

const isLastEmptyInsideBody = (path) => {
const {parentPath} = path;
if (!isBlockStatement(parentPath))
return false;
if (!isBlockStatement(path.node.consequent))
return false;
if (path.node.consequent.body.length)
return false;
return isFunctionDeclaration(path.parentPath.parentPath);
};
module.exports.IfStatement = {

@@ -83,2 +103,5 @@ print: (path, {indent, print, maybe, write, traverse}) => {

print.newline();
if (isLastEmptyInsideBody(path))
print.newline();
},

@@ -85,0 +108,0 @@ afterSatisfy: () => [isNext],

{
"name": "@putout/printer",
"version": "11.11.0",
"version": "11.12.0",
"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

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