@putout/printer 2.23.0 → 2.25.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/functions/class-method.js +1 -3
- package/lib/tokenize/expressions/functions/function-declaration.js +10 -2
- package/lib/tokenize/statements/export-declaration/export-default-declaration.js +1 -3
- package/lib/tokenize/statements/switch-statement.js +1 -3
- package/lib/tokenize/statements/variable-declaration/variable-declaration.js +3 -0
- package/lib/tokenize/typescript/ts-interface-declaration.js +1 -3
- package/lib/tokenize/typescript/ts-module-declaration.js +1 -3
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
2023.06.19, v2.25.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 0a70e74 @putout/printer: FunctionDeclaration: generator: imporve support (coderaiser/minify#108)
|
|
5
|
+
|
|
6
|
+
2023.06.16, v2.24.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- 32d4852 @putout/printer: VariableDeclaration: newline
|
|
10
|
+
|
|
1
11
|
2023.06.16, v2.23.0
|
|
2
12
|
|
|
3
13
|
feature:
|
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
const {markAfter} = require('../../mark');
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const {
|
|
6
|
+
isNext,
|
|
7
|
+
isNextParent,
|
|
8
|
+
} = require('../../is');
|
|
6
9
|
|
|
7
10
|
const {printParams} = require('./params');
|
|
8
11
|
|
|
9
12
|
module.exports.FunctionDeclaration = {
|
|
10
13
|
print(path, {print, maybe}) {
|
|
11
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
async,
|
|
16
|
+
generator,
|
|
17
|
+
} = path.node;
|
|
12
18
|
|
|
13
19
|
maybe.print(async, 'async ');
|
|
14
20
|
|
|
15
21
|
print('function ');
|
|
22
|
+
maybe.print(generator, '*');
|
|
23
|
+
|
|
16
24
|
print('__id');
|
|
17
25
|
print('__typeParameters');
|
|
18
26
|
|
|
@@ -23,9 +23,7 @@ module.exports.ExportDefaultDeclaration = {
|
|
|
23
23
|
traverse(declaration);
|
|
24
24
|
maybe.print(shouldAddSemi(declaration), ';');
|
|
25
25
|
},
|
|
26
|
-
afterSatisfy: () => [
|
|
27
|
-
notClass,
|
|
28
|
-
],
|
|
26
|
+
afterSatisfy: () => [notClass],
|
|
29
27
|
after(path, {print}) {
|
|
30
28
|
print.newline();
|
|
31
29
|
print.newline();
|
|
@@ -130,6 +130,9 @@ function isNextCoupleLines(path) {
|
|
|
130
130
|
const next = path.getNextSibling();
|
|
131
131
|
const prev = path.getPrevSibling();
|
|
132
132
|
|
|
133
|
+
if (!exists(prev.getPrevSibling()) && next.isVariableDeclaration())
|
|
134
|
+
return false;
|
|
135
|
+
|
|
133
136
|
if (path.node.loc?.start.line === prev.node?.loc?.start.line + 2)
|
|
134
137
|
return false;
|
|
135
138
|
|
package/package.json
CHANGED