[TS] Transform multiple assert and assign correctly (#7217)
* Transform multiple assert and assign correctly * Handling nested TSAsExpressions in the transform
This commit is contained in:
parent
7273cf8fe5
commit
7accee9c24
@ -250,7 +250,11 @@ export default declare((api, { jsxPragma = "React" }) => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
TSAsExpression(path) {
|
TSAsExpression(path) {
|
||||||
path.replaceWith(path.node.expression);
|
let { node } = path;
|
||||||
|
do {
|
||||||
|
node = node.expression;
|
||||||
|
} while (t.isTSAsExpression(node));
|
||||||
|
path.replaceWith(node);
|
||||||
},
|
},
|
||||||
|
|
||||||
TSNonNullExpression(path) {
|
TSNonNullExpression(path) {
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
(a as number as any) = 42;
|
||||||
@ -0,0 +1 @@
|
|||||||
|
a = 42;
|
||||||
Loading…
x
Reference in New Issue
Block a user