@putout/printer
Advanced tools
Comparing version 1.6.10 to 1.6.11
@@ -14,3 +14,3 @@ 'use strict'; | ||
const isNewLine = !isNumbers(elements) && !isForOf(path) && isLastArg(path) && !isParentProperty(path); | ||
const isNewLine = tooLong(path) || !isNumbers(elements) && !isForOf(path) && isLastArg(path) && !isParentProperty(path); | ||
const n = elements.length - 1; | ||
@@ -22,5 +22,3 @@ | ||
maybe.indent(isNewLine); | ||
print(element); | ||
maybe.print(isNewLine, ',\n'); | ||
@@ -32,3 +30,2 @@ maybe.print(!isNewLine && index < n, ', '); | ||
maybe.indent(elements.length && isNewLine); | ||
print(']'); | ||
@@ -70,1 +67,15 @@ }; | ||
} | ||
function tooLong(path) { | ||
const elements = path.get('elements'); | ||
if (elements.length < 2) | ||
return false; | ||
for (const el of path.get('elements')) { | ||
if (el.isStringLiteral() && el.node.value.length > 4) | ||
return true; | ||
} | ||
return false; | ||
} |
{ | ||
"name": "@putout/printer", | ||
"version": "1.6.10", | ||
"version": "1.6.11", | ||
"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
41761
1183