New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@putout/printer

Package Overview
Dependencies
Maintainers
1
Versions
623
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 1.52.4 to 1.53.0

49

lib/tokenize/statements/variable-declaration.js

@@ -42,3 +42,11 @@ 'use strict';

},
afterIf: shouldAddNewlineAfter,
afterSatisfy: () => [
noNextParentBlock,
notLastCoupleLines,
isNextAssign,
isNextCoupleLines,
notLastPrevVarNotNextVar,
isNewlineBetweenStatements,
notLastParentExport,
],
after(path, {maybe, store}) {

@@ -63,32 +71,19 @@ const wasNewline = store();

function shouldAddNewlineAfter(path) {
if (noNextParentBlock(path))
return true;
function notLastCoupleLines(path) {
return !isLast(path) && isCoupleLines(path);
}
function notLastPrevVarNotNextVar(path) {
const prev = path.getPrevSibling();
const next = path.getNextSibling();
if (isLast(path))
return false;
if (isCoupleLines(path))
return true;
if (isNextAssign(path))
return true;
return !isLast(path) && prev.isVariableDeclaration() && !next.isVariableDeclaration();
}
function isNextCoupleLines(path) {
const next = path.getNextSibling();
const prev = path.getPrevSibling();
if (isCoupleLines(next))
return true;
if (prev.isVariableDeclaration() && !next.isVariableDeclaration())
return true;
if (isNewlineBetweenStatements(path))
return true;
if (notLastParentExport(path))
return true;
return false;
return isCoupleLines(next);
}
const isLast = (path) => path.parentPath?.isProgram() && !isNext(path);

@@ -95,0 +90,0 @@

{
"name": "@putout/printer",
"version": "1.52.4",
"version": "1.53.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