@@ -1951,17 +1951,11 @@ namespace ts {
1951
1951
1952
1952
let commandLineOptionsStringToEnum : CommandLineOptionOfCustomType [ ] ;
1953
1953
1954
- /**
1955
- * Convert an option's string name of enum-value in compiler-options, "options", into its corresponding enum value if possible.
1956
- * This is necessary because JS users may pass in string values for enum compiler options (e.g. ModuleKind).
1957
- *
1958
- * @param options a compiler-options used in transpilation which can contain string value to specify instead of enum values
1959
- * @param diagnostics a list of Diagnostic which occur during conversion (e.g invalid option's value)
1960
- */
1961
- function ConvertStringForEnumNameInCompilerOptionsToEnumValue ( options : CompilerOptions , diagnostics : Diagnostic [ ] ) : CompilerOptions {
1954
+ /** JS users may pass in string values for enum compiler options (such as ModuleKind), so convert. */
1955
+ function fixupCompilerOptions ( options : CompilerOptions , diagnostics : Diagnostic [ ] ) : CompilerOptions {
1962
1956
// Lazily create this value to fix module loading errors.
1963
1957
commandLineOptionsStringToEnum = commandLineOptionsStringToEnum || < CommandLineOptionOfCustomType [ ] > filter ( optionDeclarations , o =>
1964
- typeof o . type === "object" && ! forEachValue ( < Map < number | string > > o . type , v => typeof v !== "number" ) ) ;
1958
+ typeof o . type === "object" && ! forEachValue ( < Map < any > > o . type , v => typeof v !== "number" ) ) ;
1965
1959
1966
1960
options = clone ( options ) ;
1967
1961
@@ -1999,7 +1993,7 @@ namespace ts {
1999
1993
export function transpileModule ( input : string , transpileOptions : TranspileOptions ) : TranspileOutput {
2000
1994
const diagnostics : Diagnostic [ ] = [ ] ;
2001
1995
2002
- const options : CompilerOptions = transpileOptions . compilerOptions ? ConvertStringForEnumNameInCompilerOptionsToEnumValue ( transpileOptions . compilerOptions , diagnostics ) : getDefaultCompilerOptions ( ) ;
1996
+ const options : CompilerOptions = transpileOptions . compilerOptions ? fixupCompilerOptions ( transpileOptions . compilerOptions , diagnostics ) : getDefaultCompilerOptions ( ) ;
2003
1997
2004
1998
options . isolatedModules = true ;
2005
1999
0 commit comments