@@ -554,7 +554,7 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
554554 let program = project . program ;
555555 let typeChecker = program . getTypeChecker ( ) ;
556556
557- let shouldReportDiagnostics = getEnvironmentVariable ( "SEMMLE_TYPESCRIPT_REPORT_DIAGNOSTICS" , Boolean , false ) ;
557+ let shouldReportDiagnostics = getEnvironmentVariable ( "SEMMLE_TYPESCRIPT_REPORT_DIAGNOSTICS" , v => v . trim ( ) . toLowerCase ( ) === "true" , false ) ;
558558 let diagnostics = shouldReportDiagnostics
559559 ? program . getSemanticDiagnostics ( ) . filter ( d => d . category === ts . DiagnosticCategory . Error )
560560 : [ ] ;
@@ -807,7 +807,8 @@ function handleGetMetadataCommand(command: GetMetadataCommand) {
807807
808808function reset ( ) {
809809 state = new State ( ) ;
810- state . typeTable . restrictedExpansion = getEnvironmentVariable ( "SEMMLE_TYPESCRIPT_NO_EXPANSION" , Boolean , true ) ;
810+ state . typeTable . restrictedExpansion = getEnvironmentVariable ( "SEMMLE_TYPESCRIPT_NO_EXPANSION" , v => v . trim ( ) . toLowerCase ( ) === "true" , true ) ;
811+ state . typeTable . skipExtractingTypes = getEnvironmentVariable ( "CODEQL_EXTRACTOR_JAVASCRIPT_OPTION_SKIP_TYPES" , v => v . trim ( ) . toLowerCase ( ) === "true" , false ) ;
811812}
812813
813814function getEnvironmentVariable < T > ( name : string , parse : ( x : string ) => T , defaultValue : T ) {
@@ -886,6 +887,7 @@ if (process.argv.length > 2) {
886887 if ( argument === "--version" ) {
887888 console . log ( "parser-wrapper with TypeScript " + ts . version ) ;
888889 } else if ( pathlib . basename ( argument ) === "tsconfig.json" ) {
890+ reset ( ) ;
889891 handleOpenProjectCommand ( {
890892 command : "open-project" ,
891893 tsConfig : argument ,
@@ -895,7 +897,7 @@ if (process.argv.length > 2) {
895897 virtualSourceRoot : null ,
896898 } ) ;
897899 for ( let sf of state . project . program . getSourceFiles ( ) ) {
898- if ( pathlib . basename ( sf . fileName ) === "lib.d.ts" ) continue ;
900+ if ( / l i b \. . * \. d \. t s / . test ( pathlib . basename ( sf . fileName ) ) || pathlib . basename ( sf . fileName ) === "lib.d.ts" ) continue ;
899901 handleParseCommand ( {
900902 command : "parse" ,
901903 filename : sf . fileName ,
0 commit comments