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
0
Versions
641
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 12.29.0 to 12.30.0

lib/tokenize/comment/comments-printer/comments-printer.js

21

lib/tokenize/comment/parse-leading-comments.js

@@ -14,2 +14,7 @@ 'use strict';

const {
hasCommentsPrinter,
printComments,
} = require('./comments-printer/comments-printer');
const {
isArrowFunctionExpression,

@@ -51,5 +56,2 @@ isObjectProperty,

if (path.node.decorators)
return true;
return path?.parentPath.node?.decorators;

@@ -95,3 +97,9 @@ };

module.exports.parseLeadingComments = (path, {print, maybe, indent}, semantics) => {
module.exports.parseLeadingComments = (path, printer, semantics, {currentTraverse = {}} = {}) => {
const {
print,
maybe,
indent,
} = printer;
if (!semantics.comments)

@@ -105,2 +113,7 @@ return;

if (hasCommentsPrinter(currentTraverse))
return printComments(path, printer, semantics, {
currentTraverse,
});
if (hasDecoratorsWithComments(path))

@@ -107,0 +120,0 @@ return;

5

lib/tokenize/tokenize.js

@@ -222,3 +222,6 @@ 'use strict';

const currentIndent = i;
parseLeadingComments(path, printer, semantics);
parseLeadingComments(path, printer, semantics, {
currentTraverse,
});
// this is main thing

@@ -225,0 +228,0 @@ maybeVisitor(currentTraverse, path, printer, semantics);

@@ -43,3 +43,17 @@ 'use strict';

print('__parameter');
maybe.print.breakline(decoratorsLength);
if (hasLeadingComment(path) && !path.node.decorators)
print.breakline();
};
module.exports.TSParameterProperty.printLeadingCommentLine = (path, printer, semantics, {printComment}) => {
const {indent, print} = printer;
if (path.parentPath.isClassMethod() && !path.node.decorators) {
indent.inc();
print.breakline();
printComment();
print.breakline();
indent.dec();
}
};
{
"name": "@putout/printer",
"version": "12.29.0",
"version": "12.30.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