@putout/printer
Advanced tools
Comparing version 8.4.0 to 8.5.0
@@ -30,2 +30,4 @@ 'use strict'; | ||
const isNextString = (path) => isStringLiteral(path.getNextSibling()); | ||
const isPrevString = (path) => isStringLiteral(path.getPrevSibling()); | ||
const isAroundStrings = (path) => isNextString(path) || isPrevString(path); | ||
const isNextObject = (a) => a.getNextSibling().isObjectExpression(); | ||
@@ -104,5 +106,8 @@ const isPrevObject = (a) => a.getPrevSibling().isObjectExpression(); | ||
if (isInsideArray(path) && isStringAndArray(parentElements)) { | ||
maybe.indent.dec(!isNextString(path)); | ||
const parentCountTwo = parentElements.length === 2; | ||
const isHideIdent = !isAroundStrings(path) || parentCountTwo; | ||
maybe.indent.dec(isHideIdent); | ||
maybe.indent(elements.length && isNewLine); | ||
maybe.indent.inc(!isNextString(path)); | ||
maybe.indent.inc(isHideIdent); | ||
} else if (!isArrayInsideArray(path) && !isObjectExpression(elements.at(-1))) { | ||
@@ -109,0 +114,0 @@ maybe.indent(elements.length && isNewLine); |
{ | ||
"name": "@putout/printer", | ||
"version": "8.4.0", | ||
"version": "8.5.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
206433
4613