@putout/printer 1.96.0 → 1.97.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
|
@@ -14,8 +14,10 @@ const {
|
|
|
14
14
|
} = require('./ts-module-declaration');
|
|
15
15
|
|
|
16
16
|
const {TSInterfaceDeclaration} = require('./ts-interface-declaration');
|
|
17
|
+
const {TSAsExpression} = require('./ts-as-expression');
|
|
17
18
|
|
|
18
19
|
module.exports = {
|
|
20
|
+
TSAsExpression,
|
|
19
21
|
TSTypeLiteral,
|
|
20
22
|
TSTypeAliasDeclaration,
|
|
21
23
|
TSTypeParameter,
|
|
@@ -108,11 +110,6 @@ module.exports = {
|
|
|
108
110
|
print('>');
|
|
109
111
|
print('__expression');
|
|
110
112
|
},
|
|
111
|
-
TSAsExpression(path, {print}) {
|
|
112
|
-
print('__expression');
|
|
113
|
-
print(' as ');
|
|
114
|
-
print('__typeAnnotation');
|
|
115
|
-
},
|
|
116
113
|
TSParenthesizedType(path, {print}) {
|
|
117
114
|
print('(');
|
|
118
115
|
print('__typeAnnotation');
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports.TSAsExpression = {
|
|
4
|
+
condition(path) {
|
|
5
|
+
return path.parentPath.isMemberExpression();
|
|
6
|
+
},
|
|
7
|
+
before(path, {write}) {
|
|
8
|
+
write('(');
|
|
9
|
+
},
|
|
10
|
+
print(path, {print}) {
|
|
11
|
+
print('__expression');
|
|
12
|
+
print(' as ');
|
|
13
|
+
print('__typeAnnotation');
|
|
14
|
+
},
|
|
15
|
+
after(path, {write}) {
|
|
16
|
+
write(')');
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
package/package.json
CHANGED