File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ export default function addAsAnyToObjectLiterals(oldSource: string): string {
5
5
return function transform ( rootNode : T ) {
6
6
function visit ( node : ts . Node ) : ts . Node {
7
7
if ( node . kind === ts . SyntaxKind . ObjectLiteralExpression ) {
8
- return ts . createAsExpression (
8
+ return ts . factory . createAsExpression (
9
9
node as ts . Expression ,
10
- ts . createTypeReferenceNode ( "any" , [ ] )
10
+ ts . factory . createTypeReferenceNode ( "any" , [ ] )
11
11
) ;
12
12
}
13
13
return ts . visitEachChild ( node , visit , context ) ;
@@ -27,7 +27,7 @@ export default function addAsAnyToObjectLiterals(oldSource: string): string {
27
27
const result = ts . transform ( source , [ transformer ] ) ;
28
28
29
29
const printer : ts . Printer = ts . createPrinter ( {
30
- newLine : ts . NewLineKind . LineFeed
30
+ newLine : ts . NewLineKind . LineFeed ,
31
31
} ) ;
32
32
return printer . printFile ( result . transformed [ 0 ] as ts . SourceFile ) ;
33
33
}
You can’t perform that action at this time.
0 commit comments