File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1920,12 +1920,16 @@ namespace ts {
1920
1920
sourceMapText ?: string ;
1921
1921
}
1922
1922
1923
- const commandLineOptions_stringToEnum = < CommandLineOptionOfCustomType [ ] > filter ( optionDeclarations , o => {
1924
- return typeof o . type === "object" && ! forEachValue ( < Map < any > > o . type , v => typeof v !== "number" ) ;
1925
- } ) ;
1923
+
1924
+
1925
+ let commandLineOptions_stringToEnum : CommandLineOptionOfCustomType [ ] ;
1926
1926
1927
1927
/** JS users may pass in string values for enum compiler options (such as ModuleKind), so convert. */
1928
- function fixupCompilerOptions ( options : CompilerOptions , diagnostics : Diagnostic [ ] ) {
1928
+ function fixupCompilerOptions ( options : CompilerOptions , diagnostics : Diagnostic [ ] ) : CompilerOptions {
1929
+ // Lazily create this value to fix module loading errors.
1930
+ commandLineOptions_stringToEnum = commandLineOptions_stringToEnum || < CommandLineOptionOfCustomType [ ] > filter ( optionDeclarations , o =>
1931
+ typeof o . type === "object" && ! forEachValue ( < Map < any > > o . type , v => typeof v !== "number" ) ) ;
1932
+
1929
1933
options = clone ( options ) ;
1930
1934
1931
1935
for ( const opt of commandLineOptions_stringToEnum ) {
You can’t perform that action at this time.
0 commit comments