@putout/printer 2.17.0 → 2.19.0
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
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
2023.06.16, v2.19.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 8b5f8c4 @putout/printer: BinaryExpression: minification of UnaryExpression (coderaiser/minify#105)
|
|
5
|
+
|
|
6
|
+
2023.06.15, v2.18.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- ad883dc @putout/printer: VariableDeclaration: no newline when previous has
|
|
10
|
+
|
|
1
11
|
2023.06.15, v2.17.0
|
|
2
12
|
|
|
3
13
|
feature:
|
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
concatanate,
|
|
5
5
|
isConcatenation,
|
|
6
6
|
} = require('./concatanate');
|
|
7
|
+
const {maybeSpace} = require('./maybe-space');
|
|
7
8
|
|
|
8
9
|
const BinaryExpression = {
|
|
9
10
|
condition(path) {
|
|
@@ -38,7 +39,7 @@ const BinaryExpression = {
|
|
|
38
39
|
print('__left');
|
|
39
40
|
print.space();
|
|
40
41
|
print(path.node.operator);
|
|
41
|
-
print
|
|
42
|
+
maybeSpace(path, {print});
|
|
42
43
|
print('__right');
|
|
43
44
|
},
|
|
44
45
|
after(path, {print}) {
|
|
@@ -128,6 +128,10 @@ function notLastPrevVarNotNextVar(path) {
|
|
|
128
128
|
|
|
129
129
|
function isNextCoupleLines(path) {
|
|
130
130
|
const next = path.getNextSibling();
|
|
131
|
+
const prev = path.getPrevSibling();
|
|
132
|
+
|
|
133
|
+
if (path.node.loc?.start.line === prev.node?.loc?.start.line + 2)
|
|
134
|
+
return false;
|
|
131
135
|
|
|
132
136
|
return isCoupleLines(next);
|
|
133
137
|
}
|
package/package.json
CHANGED