@putout/printer
Advanced tools
Comparing version 8.46.0 to 8.47.0
@@ -9,3 +9,3 @@ 'use strict'; | ||
isStringAndArray, | ||
isSimpleAndEmptyObject, | ||
isSimpleAndNotEmptyObject, | ||
isNextObject, | ||
@@ -33,2 +33,3 @@ } = require('../../is'); | ||
isIdentifier, | ||
isFunction, | ||
} = types; | ||
@@ -49,2 +50,11 @@ | ||
const argCall = prev.get('argument'); | ||
if (argCall.isCallExpression()) { | ||
const [first] = argCall.get('arguments'); | ||
if (isFunction(first)) | ||
return false; | ||
} | ||
if (prev.getPrevSibling().isObjectExpression()) | ||
@@ -164,3 +174,3 @@ return false; | ||
if (isSimpleAndEmptyObject(elements) && !isSpreadElement(elements.at(-1))) { | ||
if (isSimpleAndNotEmptyObject(elements) && !isSpreadElement(elements.at(-1))) { | ||
print(','); | ||
@@ -167,0 +177,0 @@ print.breakline(); |
@@ -24,3 +24,3 @@ 'use strict'; | ||
isIdentifierAndIdentifier, | ||
isSimpleAndEmptyObject, | ||
isSimpleAndNotEmptyObject, | ||
} = require('../../is'); | ||
@@ -66,3 +66,3 @@ | ||
if (isSimpleAndEmptyObject(elements)) | ||
if (isSimpleAndNotEmptyObject(elements)) | ||
return MULTI_LINE; | ||
@@ -69,0 +69,0 @@ |
@@ -70,3 +70,3 @@ 'use strict'; | ||
module.exports.isSimpleAndEmptyObject = ([a, b]) => { | ||
module.exports.isSimpleAndNotEmptyObject = ([a, b]) => { | ||
if (!isIdentifier(a) && !isSpreadElement(a) && !isArrayExpression(a)) | ||
@@ -73,0 +73,0 @@ return false; |
{ | ||
"name": "@putout/printer", | ||
"version": "8.46.0", | ||
"version": "8.47.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
223230
4926