Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@putout/printer

Package Overview
Dependencies
Maintainers
1
Versions
748
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
17.5.0
to
17.6.0
+7
-0
lib/tokenize/is.js

@@ -14,2 +14,3 @@ import {types} from '@putout/babel';

isLabeledStatement,
isTryStatement,
} = types;

@@ -29,2 +30,8 @@

export const isNextTry = (path) => {
return isTryStatement(path.getNextSibling());
};
export const isPrevTry = (path) => isTryStatement(path.getPrevSibling());
export const isPrev = (path) => {

@@ -31,0 +38,0 @@ const next = path.getPrevSibling();

+4
-0

@@ -7,2 +7,3 @@ import {types} from '@putout/babel';

isLast,
isPrevTry,
} from '#is';

@@ -19,2 +20,5 @@ import {hasPrevNewline} from '../../mark.js';

beforeIf(path) {
if (isPrevTry(path))
return true;
return !hasPrevNewline(path) && isBodyLength(path) || isPrevBody(path);

@@ -21,0 +25,0 @@ },

+15
-6

@@ -1,5 +0,8 @@

import {isNext} from '#is';
import {types} from '@putout/babel';
import {isNext, isNextTry} from '#is';
const {isExpressionStatement} = types;
export const TryStatement = {
print(path, {print}) {
print(path, {print, maybe}) {
const finalizer = path.get('finalizer');

@@ -17,12 +20,18 @@ print.indent();

print(finalizer);
print.newline();
maybe.print.newline(!isNext(path));
}
},
afterSatisfy: () => [isNext],
after(path, {maybe, print}) {
maybe.print.newline(!path.node.finalizer);
print.breakline();
after(path, {print}) {
print.newline();
if (isNextExpression(path) || isNextTry(path))
print.breakline();
},
};
const isNextExpression = (path) => {
return isExpressionStatement(path.getNextSibling());
};
export const CatchClause = (path, {print, maybe}) => {

@@ -29,0 +38,0 @@ const param = path.get('param');

{
"name": "@putout/printer",
"version": "17.5.0",
"version": "17.6.0",
"type": "module",

@@ -5,0 +5,0 @@ "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",

Sorry, the diff of this file is too big to display