@putout/printer 2.37.0 → 2.38.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 +5 -0
- package/lib/tokenize/typescript/index.js +24 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -220,6 +220,29 @@ module.exports = {
|
|
|
220
220
|
traverse(typeAnnotation);
|
|
221
221
|
}
|
|
222
222
|
},
|
|
223
|
+
TSMethodSignature(path, {traverse, write, maybe}) {
|
|
224
|
+
traverse(path.get('key'));
|
|
225
|
+
write('(');
|
|
226
|
+
|
|
227
|
+
const params = path.get('parameters');
|
|
228
|
+
const n = params.length - 1;
|
|
229
|
+
|
|
230
|
+
for (const [index, param] of params.entries()) {
|
|
231
|
+
traverse(param);
|
|
232
|
+
maybe.write(index < n, ',');
|
|
233
|
+
maybe.write.space(index < n);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
write(')');
|
|
237
|
+
|
|
238
|
+
const typeAnnotation = path.get('typeAnnotation');
|
|
239
|
+
|
|
240
|
+
if (exists(typeAnnotation)) {
|
|
241
|
+
write(':');
|
|
242
|
+
write.space();
|
|
243
|
+
traverse(typeAnnotation);
|
|
244
|
+
}
|
|
245
|
+
},
|
|
223
246
|
TSExpressionWithTypeArguments(path, {print}) {
|
|
224
247
|
print('__expression');
|
|
225
248
|
print('__typeParameters');
|
|
@@ -238,3 +261,4 @@ module.exports = {
|
|
|
238
261
|
}
|
|
239
262
|
},
|
|
240
263
|
};
|
|
264
|
+
|
package/package.json
CHANGED