How to transform an AST node to a node with different type? #5577
-
I am trying writing a plugin to replace an AST node with another node of a different type for example:
the type of the input node is 'ImportDeclaration', but the output is a 'ExpressionStatement'. How can I do this transforming? |
Beta Was this translation helpful? Give feedback.
Answered by
daflyinbed
Aug 22, 2022
Replies: 1 comment 1 reply
-
visit Module and change its body |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Utakata-t
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
visit Module and change its body