@putout/printer 2.35.0 → 2.37.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.22, v2.37.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 7eeab91 @putout/printer: TSConstructorSignatureDeclaration: add
|
|
5
|
+
|
|
6
|
+
2023.06.22, v2.36.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- 57649ed @putout/printer: AssignmentPattern: improve support of TSParameterProperty
|
|
10
|
+
|
|
1
11
|
2023.06.22, v2.35.0
|
|
2
12
|
|
|
3
13
|
feature:
|
|
@@ -13,11 +13,16 @@ module.exports.AssignmentPattern = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
function shouldPrint(path) {
|
|
16
|
-
|
|
16
|
+
const {parentPath} = path;
|
|
17
|
+
|
|
18
|
+
if (parentPath.isObjectProperty() && !parentPath.node.shorthand)
|
|
17
19
|
return true;
|
|
18
20
|
|
|
19
21
|
if (isArg(path))
|
|
20
22
|
return true;
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
if (parentPath.isTSParameterProperty())
|
|
25
|
+
return true;
|
|
26
|
+
|
|
27
|
+
return parentPath.isArrayPattern();
|
|
23
28
|
}
|
|
@@ -198,6 +198,28 @@ module.exports = {
|
|
|
198
198
|
|
|
199
199
|
print('__typeAnnotation');
|
|
200
200
|
},
|
|
201
|
+
TSConstructSignatureDeclaration(path, {write, traverse, maybe}) {
|
|
202
|
+
write('new');
|
|
203
|
+
write('(');
|
|
204
|
+
|
|
205
|
+
const params = path.get('parameters');
|
|
206
|
+
const n = params.length - 1;
|
|
207
|
+
|
|
208
|
+
for (const [index, param] of params.entries()) {
|
|
209
|
+
traverse(param);
|
|
210
|
+
maybe.write(index < n, ',');
|
|
211
|
+
maybe.write.space(index < n);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
write(')');
|
|
215
|
+
const typeAnnotation = path.get('typeAnnotation');
|
|
216
|
+
|
|
217
|
+
if (exists(typeAnnotation)) {
|
|
218
|
+
write(':');
|
|
219
|
+
write.space();
|
|
220
|
+
traverse(typeAnnotation);
|
|
221
|
+
}
|
|
222
|
+
},
|
|
201
223
|
TSExpressionWithTypeArguments(path, {print}) {
|
|
202
224
|
print('__expression');
|
|
203
225
|
print('__typeParameters');
|
package/package.json
CHANGED