@putout/printer
Advanced tools
Comparing version 8.18.0 to 8.19.0
@@ -10,2 +10,4 @@ 'use strict'; | ||
isSimpleAndEmptyObject, | ||
isNext, | ||
} = require('../../is'); | ||
@@ -41,2 +43,3 @@ | ||
const isNextSpread = (a) => a.getNextSibling().isSpreadElement(); | ||
const isNextSpreadBetweenObjects = (a) => { | ||
@@ -49,3 +52,5 @@ const next = a.getNextSibling(); | ||
return next.getNextSibling().isObjectExpression(); | ||
return next | ||
.getNextSibling() | ||
.isObjectExpression(); | ||
}; | ||
@@ -102,3 +107,3 @@ | ||
if (index && isSpreadElement(element) && !isNextSpread(element) && !isNextObject(element)) | ||
if (isSpreadAfterObject(element)) | ||
print.newline(); | ||
@@ -167,1 +172,14 @@ | ||
}; | ||
function isSpreadAfterObject(path) { | ||
if (!isSpreadElement(path)) | ||
return; | ||
const prev = path.getPrevSibling(); | ||
const next = path.getNextSibling(); | ||
if (next.isObjectExpression()) | ||
return false; | ||
return prev.isObjectExpression(); | ||
} |
@@ -8,2 +8,3 @@ 'use strict'; | ||
...down(path), | ||
...up(path), | ||
@@ -10,0 +11,0 @@ ]; |
{ | ||
"name": "@putout/printer", | ||
"version": "8.18.0", | ||
"version": "8.19.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
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
212559
4724