@putout/printer
Advanced tools
Comparing version 8.20.0 to 8.20.1
@@ -39,2 +39,20 @@ 'use strict'; | ||
const isObjectAfterSimple = (a) => isObjectAfterSpread(a) || isObjectAfterIdentifier(a); | ||
const isSpreadBeforeObject = (a) => { | ||
if (!a.isObjectExpression()) | ||
return false; | ||
const prev = a.getPrevSibling(); | ||
if (!prev.isSpreadElement()) | ||
return false; | ||
if (prev.getPrevSibling().isObjectExpression()) | ||
return false; | ||
return prev | ||
.get('argument') | ||
.isCallExpression(); | ||
}; | ||
const isNextSimple = (a) => { | ||
@@ -119,3 +137,3 @@ const next = a.getNextSibling(); | ||
maybe.print.newline(is && !isNextObject(element)); | ||
maybe.print.newline((is || isSpreadBeforeObject(element)) && !isNextObject(element)); | ||
maybe.print.space(is && isObjectAfterSimple(element)); | ||
@@ -127,3 +145,2 @@ | ||
if (isNextSimpleBetweenObjects(element) || !(element.isObjectExpression() && isNextSimple(element))) | ||
//if (!(element.isObjectExpression() && isNextSimple(element))) | ||
print.space(); | ||
@@ -130,0 +147,0 @@ } |
{ | ||
"name": "@putout/printer", | ||
"version": "8.20.0", | ||
"version": "8.20.1", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
213278
4740