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

@putout/printer

Package Overview
Dependencies
Maintainers
1
Versions
599
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.14.0 to 1.14.1

15

lib/tokenize/comments.js
'use strict';
const {isFirst} = require('./is');
const {markBefore} = require('./mark');
const {
isFirst,
isNext,
} = require('./is');
const {
markBefore,
hasPrevNewline,
} = require('./mark');

@@ -44,2 +50,5 @@ module.exports.parseLeadingComments = (path, {print, indent}) => {

if (isNext(path))
return;
for (const {type, value} of trailingComments) {

@@ -56,3 +65,3 @@ if (type === 'CommentLine') {

function shouldAddNewlineBefore(path) {
return path.isStatement() && !isFirst(path);
return path.isStatement() && !isFirst(path) && !hasPrevNewline(path);
}

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

module.exports.ObjectMethod = (path, {print}) => {
const {kind} = path.node;
if (kind !== 'method')
print(`${kind} `);
print('__key');

@@ -56,0 +61,0 @@ print('(');

2

lib/tokenize/expressions/object-expression.js
'use strict';
const {isCoupleLines} = require('../is');
const isBodyOfArrow = (path) => path.parentPath.node.body === path.node;

@@ -93,2 +92,1 @@ const isLogical = (path) => path.get('argument').isLogicalExpression();

}

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

), ' ');
print('__argument');

@@ -49,0 +50,0 @@

{
"name": "@putout/printer",
"version": "1.14.0",
"version": "1.14.1",
"type": "commonjs",

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

@@ -28,3 +28,2 @@ # Printer [![NPM version][NPMIMGURL]][NPMURL]

// returns
// returns
`

@@ -36,3 +35,2 @@ const a = (b, c) => {

`;
```

@@ -68,5 +66,3 @@

// returns
// returns
'const {a /* [hello world] */= 5} = b;\n';
```

@@ -73,0 +69,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