@putout/printer 9.18.0 → 10.0.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 +11 -0
- package/lib/tokenize/typescript/index.js +5 -1
- package/lib/tokenize/typescript/interface/ts-interface-body.js +12 -1
- package/lib/tokenize/typescript/mapped-type/ts-mapped-type.js +5 -1
- package/lib/tokenize/typescript/type/ts-type-parameter.js +10 -4
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
2024.10.26, v10.0.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 24d872a @putout/printer: align with Babel v8
|
|
5
|
+
|
|
6
|
+
2024.10.23, v9.19.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- 8b5626e @putout/printer: TSInterfaceBody: comments
|
|
10
|
+
- ebc416f @putout/printer: TSTypeParameter: default
|
|
11
|
+
|
|
1
12
|
2024.09.29, v9.18.0
|
|
2
13
|
|
|
3
14
|
feature:
|
|
@@ -193,7 +193,11 @@ module.exports = {
|
|
|
193
193
|
print(';');
|
|
194
194
|
print.newline();
|
|
195
195
|
},
|
|
196
|
-
|
|
196
|
+
TSClassImplements(path, {print}) {
|
|
197
|
+
print('__expression');
|
|
198
|
+
print('__typeParameters');
|
|
199
|
+
},
|
|
200
|
+
TSInterfaceHeritage(path, {print}) {
|
|
197
201
|
print('__expression');
|
|
198
202
|
print('__typeParameters');
|
|
199
203
|
},
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const {parseComments} = require('../../comment/comment');
|
|
4
|
+
|
|
5
|
+
module.exports.TSInterfaceBody = (path, printer, semantics) => {
|
|
4
6
|
const body = path.get('body');
|
|
7
|
+
const {
|
|
8
|
+
traverse,
|
|
9
|
+
write,
|
|
10
|
+
indent,
|
|
11
|
+
maybe,
|
|
12
|
+
} = printer;
|
|
13
|
+
|
|
5
14
|
write.space();
|
|
6
15
|
write('{');
|
|
7
16
|
maybe.write.newline(body.length);
|
|
8
17
|
indent.inc();
|
|
9
18
|
|
|
19
|
+
parseComments(path, printer, semantics);
|
|
20
|
+
|
|
10
21
|
for (const item of body) {
|
|
11
22
|
indent();
|
|
12
23
|
traverse(item);
|
|
@@ -17,10 +17,16 @@ module.exports.TSTypeParameter = (path, {write, traverse}) => {
|
|
|
17
17
|
if (!exists(constraint))
|
|
18
18
|
return;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
write(' in ');
|
|
22
|
-
else
|
|
23
|
-
write(' extends ');
|
|
20
|
+
write(' extends ');
|
|
24
21
|
|
|
25
22
|
traverse(constraint);
|
|
23
|
+
|
|
24
|
+
const defaultPath = path.get('default');
|
|
25
|
+
|
|
26
|
+
if (exists(defaultPath)) {
|
|
27
|
+
write.space();
|
|
28
|
+
write('=');
|
|
29
|
+
write.space();
|
|
30
|
+
traverse(defaultPath);
|
|
31
|
+
}
|
|
26
32
|
};
|
package/package.json
CHANGED