File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
example-transformers/return-multiple-node Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,9 @@ const transformer: ts.TransformerFactory<ts.SourceFile> = context => {
55 const visitor = ( node : ts . Node ) : ts . VisitResult < ts . Node > => {
66 // If it is a expression statement,
77 if ( ts . isExpressionStatement ( node ) ) {
8- // Clone it
9- const newNode = ts . getMutableClone ( node ) ;
10- // And return it twice.
8+ // Return it twice.
119 // Effectively duplicating the statement
12- return [ node , newNode ] ;
10+ return [ node , node ] ;
1311 }
1412
1513 return ts . visitEachChild ( node , visitor , context ) ;
Original file line number Diff line number Diff line change @@ -1102,11 +1102,9 @@ const transformer: ts.TransformerFactory<ts.SourceFile> = context => {
11021102 const visitor = (node : ts .Node ): ts .VisitResult <ts .Node > => {
11031103 // If it is a expression statement,
11041104 if (ts .isExpressionStatement (node )) {
1105- // Clone it
1106- const newNode = ts .getMutableClone (node );
1107- // And return it twice.
1105+ // Return it twice.
11081106 // Effectively duplicating the statement
1109- return [node , newNode ];
1107+ return [node , node ];
11101108 }
11111109
11121110 return ts .visitEachChild (node , visitor , context );
You can’t perform that action at this time.
0 commit comments