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
630
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.11.0 to 12.12.0

34

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

@@ -20,2 +20,3 @@ 'use strict';

isSpreadElement,
isClassBody,
} = types;

@@ -74,6 +75,16 @@

return line === loc.start.line - 1;
return line <= loc.start.line - 1;
}
const isFirst = (path) => path === path.parentPath?.get('properties')[0];
const isFirst = (path) => {
const {parentPath} = path;
if (path === parentPath.get('properties')[0])
return true;
if (isClassBody(parentPath) && isClassProperty(path))
return path === parentPath.get('body')[0];
return false;
};

@@ -106,6 +117,9 @@ module.exports.parseLeadingComments = (path, {print, maybe, indent}, semantics) => {

for (const {type, value} of leadingComments) {
maybe.indent(isIndent);
const count = leadingComments.length - 1;
for (const [index, {type, value}] of leadingComments.entries()) {
if (type === 'CommentLine') {
if (!path.isClassProperty() || index)
maybe.indent(isIndent);
maybeInsideFn(insideFn, {

@@ -123,4 +137,8 @@ print,

maybe.print.breakline(propIs);
maybe.print.newline(!propIs);
if (index === count) {
maybe.print.breakline(propIs);
maybe.print.newline(!propIs);
} else {
print.newline();
}

@@ -137,2 +155,4 @@ if (isInsideVar(path)) {

if (type === 'CommentBlock') {
maybe.indent(isIndent);
const looksLikeMethod = path.isClassMethod();

@@ -139,0 +159,0 @@ const looksLikeDirective = path.isDirective();

{
"name": "@putout/printer",
"version": "12.11.0",
"version": "12.12.0",
"type": "commonjs",

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

"#test/printer": {
"default": "./test/printer.js"
"default": "./test/print-extension/print-extension.js"
},

@@ -63,2 +63,5 @@ "#test/fixture": {

"default": "./lib/printer.js"
},
"#test": {
"default": "./test/create-test.js"
}

@@ -65,0 +68,0 @@ },

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