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 8.17.0 to 8.18.0

20

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

@@ -39,2 +39,12 @@ 'use strict';

const isObjectAfterSimple = (a) => isObjectAfterSpread(a) || isObjectAfterIdentifier(a);
const isNextSpread = (a) => a.getNextSibling().isSpreadElement();
const isNextSpreadBetweenObjects = (a) => {
const next = a.getNextSibling();
const is = next.isSpreadElement();
if (!is)
return true;
return next.getNextSibling().isObjectExpression();
};

@@ -89,2 +99,6 @@ const isInsideOneElementArray = ({parentPath}) => parentPath.node.elements.length === 1;

const is = isNewLine && isCurrentNewLine(element);
if (index && isSpreadElement(element) && !isNextSpread(element) && !isNextObject(element))
print.newline();
maybe.indent(is);

@@ -101,3 +115,5 @@ print(element);

print(',');
print.space();
if (isNextSpreadBetweenObjects(element) || !(element.isObjectExpression() && isNextSpread(element)))
print.space();
}

@@ -122,3 +138,3 @@ }

if (isSimpleAndEmptyObject(elements)) {
if (isSimpleAndEmptyObject(elements) && !isSpreadElement(elements.at(-1))) {
print(',');

@@ -125,0 +141,0 @@ print.breakline();

2

package.json
{
"name": "@putout/printer",
"version": "8.17.0",
"version": "8.18.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