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
592
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 11.2.1 to 11.3.0

lib/tokenize/expressions/logical-expression/chain.js

1

lib/tokenize/expressions/assignment-expression/maybe-write-brace.js
'use strict';
const {isParens} = require('../../maybe/maybe-parens');
module.exports.maybePrintLeftBrace = (path, printer, semantics) => {

@@ -5,0 +6,0 @@ maybeWriteBrace(path, printer, semantics, {

75

lib/tokenize/expressions/binary-expression/binary-expression.js

@@ -9,54 +9,31 @@ 'use strict';

const {maybeSpace} = require('./maybe-space');
const {isParens} = require('../../maybe/maybe-parens');
const {maybeParens} = require('../../maybe/maybe-parens');
const BinaryExpression = {
condition(path) {
if (isParens(path))
return true;
module.exports.BinaryExpression = maybeParens((path, {print, indent, maybe}) => {
const {operator} = path.node;
if (operator === 'in' || operator === 'instanceof') {
print('__left');
print(' ');
print(operator);
print(' ');
print('__right');
return path.parentPath.isAwaitExpression();
},
before(path, {print}) {
print('(');
},
print(path, {print, indent, maybe}) {
const {operator} = path.node;
if (operator === 'instanceof') {
print('__left');
print(' instanceof ');
print('__right');
return;
}
if (operator === 'in') {
print('__left');
print(' in ');
print('__right');
return;
}
if (isConcatenation(path))
return concatenate(path, {
print,
indent,
maybe,
});
print('__left');
print.space();
print(path.node.operator);
maybeSpace(path, {
return;
}
if (isConcatenation(path))
return concatenate(path, {
print,
indent,
maybe,
});
print('__right');
},
after(path, {print}) {
print(')');
},
};
module.exports.BinaryExpression = BinaryExpression;
module.exports.LogicalExpression = BinaryExpression;
print('__left');
print.space();
print(path.node.operator);
maybeSpace(path, {
print,
});
print('__right');
});

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

if (operator !== '+')
return false;
const startLine = path.node.loc?.start.line;

@@ -30,5 +33,2 @@ const endLine = path.node.loc?.end.line;

if (operator !== '+')
return false;
if (isStringLike(left) && isStringLike(right) && isBinaryExpression(parentPath))

@@ -35,0 +35,0 @@ return true;

@@ -38,8 +38,4 @@ 'use strict';

const {TaggedTemplateExpression} = require('./tagged-template-expression');
const {
BinaryExpression,
LogicalExpression,
} = require('./binary-expression/binary-expression');
const {BinaryExpression} = require('./binary-expression/binary-expression');
const {LogicalExpression} = require('./logical-expression/logical-expression');
const {ConditionalExpression} = require('./conditional-expression');

@@ -46,0 +42,0 @@ const {StaticBlock} = require('./class/static-block');

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