@putout/printer 1.15.3 → 1.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog
CHANGED
|
@@ -8,6 +8,7 @@ const isForOf = ({parentPath}) => parentPath.isForOfStatement();
|
|
|
8
8
|
const SECOND = 1;
|
|
9
9
|
|
|
10
10
|
const isStringAndArray = ([a, b]) => a?.isStringLiteral() && b?.isArrayExpression();
|
|
11
|
+
const isArrayParent = (path) => path.parentPath.isArrayExpression();
|
|
11
12
|
const isTwoLongStrings = ([a, b]) => {
|
|
12
13
|
const LONG_STRING = 20;
|
|
13
14
|
|
|
@@ -46,7 +47,9 @@ module.exports.ArrayExpression = (path, {print, maybe, indent}) => {
|
|
|
46
47
|
if (!isTwoLongStrings(elements))
|
|
47
48
|
maybe.indent.dec(!shouldIncreaseIndent);
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
const parentElements = path.parentPath.get('elements');
|
|
51
|
+
|
|
52
|
+
if (isArrayParent(path) && isStringAndArray(parentElements)) {
|
|
50
53
|
indent.dec();
|
|
51
54
|
maybe.indent(elements.length && isNewLine);
|
|
52
55
|
indent.inc();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/printer",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.4",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
6
|
"description": "Easiest possible opinionated Babel AST printer made with ❤️ to use in 🐊Putout",
|