File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -308,18 +308,18 @@ const createJSAst = async (options) => {
308308 try {
309309 const ast = fileToJsAst ( file ) ;
310310 writeAstFile ( file , ast , options ) ;
311- } catch ( err ) {
312- console . error ( file , err . message ) ;
313- }
314- if ( ts ) {
315- try {
316- const tsAst = ts . program . getSourceFile ( file ) ;
317- tsc . forEachChild ( tsAst , ts . addType ) ;
318- writeTypesFile ( file , ts . seenTypes , options ) ;
319- ts . seenTypes . clear ( ) ;
320- } catch ( err ) {
321- console . warn ( "Retrieving types" , file , ":" , err . message ) ;
311+ if ( ts ) {
312+ try {
313+ const tsAst = ts . program . getSourceFile ( file ) ;
314+ tsc . forEachChild ( tsAst , ts . addType ) ;
315+ writeTypesFile ( file , ts . seenTypes , options ) ;
316+ ts . seenTypes . clear ( ) ;
317+ } catch ( err ) {
318+ console . warn ( "Retrieving types" , file , ":" , err . message ) ;
319+ }
322320 }
321+ } catch ( err ) {
322+ console . error ( "Parsing" , file , ":" , err . message ) ;
323323 }
324324 }
325325 } catch ( err ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " @joernio/astgen" ,
3- "version" : " 3.10 .0" ,
3+ "version" : " 3.12 .0" ,
44 "description" : " Generate JS/TS AST in json format with Babel" ,
55 "exports" : " ./index.js" ,
66 "keywords" : [
You can’t perform that action at this time.
0 commit comments