File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -375,9 +375,14 @@ namespace ts {
375375 }
376376 }
377377
378+ /**
379+ * Parses non quoted strings separated by comma e.g. "a,b" would result in string array ["a", "b"]
380+ * @param s
381+ * @param existingValue
382+ */
378383 function parseMultiValueStringArray ( s : string , existingValue : string [ ] ) {
379384 let value : string [ ] = existingValue || [ ] ;
380- let hasError : boolean ;
385+ let hasError = false ;
381386 let currentString = "" ;
382387 if ( s ) {
383388 for ( let i = 0 ; i < s . length ; i ++ ) {
@@ -480,8 +485,7 @@ namespace ts {
480485 }
481486 // Check if the value asked was string[] and value provided was not string[]
482487 else if ( expectedType !== "string[]" ||
483- typeof jsonValue !== "object" ||
484- typeof jsonValue . length !== "number" ||
488+ ! ( jsonValue instanceof Array ) ||
485489 forEach ( < string [ ] > jsonValue , individualValue => typeof individualValue !== "string" ) ) {
486490 // Not expectedType
487491 errors . push ( createCompilerDiagnostic ( Diagnostics . Compiler_option_0_requires_a_value_of_type_1 , opt . name , expectedType ) ) ;
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ namespace ts {
1414
1515 export const version = "1.7.0" ;
1616
17- export function findConfigFile ( searchPath : string , moduleResolutionHost : ModuleResolutionHost ) : string {
17+ export function findConfigFile ( searchPath : string , fileExists : ( fileName : string ) => boolean ) : string {
1818 let fileName = "tsconfig.json" ;
1919 while ( true ) {
20- if ( moduleResolutionHost . fileExists ( fileName ) ) {
20+ if ( fileExists ( fileName ) ) {
2121 return fileName ;
2222 }
2323 let parentPath = getDirectoryPath ( searchPath ) ;
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ namespace ts {
188188 }
189189 else if ( commandLine . fileNames . length === 0 && isJSONSupported ( ) ) {
190190 let searchPath = normalizePath ( sys . getCurrentDirectory ( ) ) ;
191- configFileName = findConfigFile ( searchPath , sys ) ;
191+ configFileName = findConfigFile ( searchPath , sys . fileExists ) ;
192192 }
193193
194194 if ( commandLine . fileNames . length === 0 && ! configFileName ) {
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ class ProjectRunner extends RunnerBase {
195195 assert ( ! inputFiles || inputFiles . length === 0 , "cannot specify input files and project option together" ) ;
196196 }
197197 else if ( ! inputFiles || inputFiles . length === 0 ) {
198- configFileName = ts . findConfigFile ( "" , { fileExists, readFile : getSourceFileText } ) ;
198+ configFileName = ts . findConfigFile ( "" , fileExists ) ;
199199 }
200200
201201 if ( configFileName ) {
You can’t perform that action at this time.
0 commit comments