@putout/printer 2.18.0 → 2.20.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 +10 -0
- package/lib/tokenize/expressions/binary-expression/binary-expression.js +5 -1
- package/lib/tokenize/expressions/binary-expression/maybe-space.js +10 -0
- package/lib/tokenize/expressions/functions/object-method.js +6 -4
- package/lib/tokenize/statements/variable-declaration/variable-declaration.js +0 -1
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
2023.06.16, v2.20.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 301d8af @putout/printer: ObjectMethod: generator (coderaiser/minify#107)
|
|
5
|
+
|
|
6
|
+
2023.06.16, v2.19.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- 8b5f8c4 @putout/printer: BinaryExpression: minification of UnaryExpression (coderaiser/minify#105)
|
|
10
|
+
|
|
1
11
|
2023.06.15, v2.18.0
|
|
2
12
|
|
|
3
13
|
feature:
|
|
@@ -5,6 +5,8 @@ const {
|
|
|
5
5
|
isConcatenation,
|
|
6
6
|
} = require('./concatanate');
|
|
7
7
|
|
|
8
|
+
const {maybeSpace} = require('./maybe-space');
|
|
9
|
+
|
|
8
10
|
const BinaryExpression = {
|
|
9
11
|
condition(path) {
|
|
10
12
|
const parens = path.node.extra?.parenthesized;
|
|
@@ -38,7 +40,9 @@ const BinaryExpression = {
|
|
|
38
40
|
print('__left');
|
|
39
41
|
print.space();
|
|
40
42
|
print(path.node.operator);
|
|
41
|
-
|
|
43
|
+
maybeSpace(path, {
|
|
44
|
+
print,
|
|
45
|
+
});
|
|
42
46
|
print('__right');
|
|
43
47
|
},
|
|
44
48
|
after(path, {print}) {
|
|
@@ -10,11 +10,12 @@ module.exports.ObjectMethod = {
|
|
|
10
10
|
before(path, {write}) {
|
|
11
11
|
write('async ');
|
|
12
12
|
},
|
|
13
|
-
print(path, {print}) {
|
|
14
|
-
const {kind} = path.node;
|
|
13
|
+
print(path, {print, maybe}) {
|
|
14
|
+
const {generator, kind} = path.node;
|
|
15
|
+
const notMethod = kind !== 'method';
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
maybe.print(notMethod, `${kind} `);
|
|
18
|
+
maybe.print(generator, '*');
|
|
18
19
|
|
|
19
20
|
print('__key');
|
|
20
21
|
|
|
@@ -32,3 +33,4 @@ module.exports.ObjectMethod = {
|
|
|
32
33
|
print.linebreak();
|
|
33
34
|
},
|
|
34
35
|
};
|
|
36
|
+
|
package/package.json
CHANGED