@@ -83,33 +83,33 @@ namespace ts {
83
83
export const optionsForWatch : CommandLineOption [ ] = [
84
84
{
85
85
name : "watchFile" ,
86
- type : createMapFromTemplate ( {
86
+ type : new Map ( getEntries ( {
87
87
fixedpollinginterval : WatchFileKind . FixedPollingInterval ,
88
88
prioritypollinginterval : WatchFileKind . PriorityPollingInterval ,
89
89
dynamicprioritypolling : WatchFileKind . DynamicPriorityPolling ,
90
90
usefsevents : WatchFileKind . UseFsEvents ,
91
91
usefseventsonparentdirectory : WatchFileKind . UseFsEventsOnParentDirectory ,
92
- } ) ,
92
+ } ) ) ,
93
93
category : Diagnostics . Advanced_Options ,
94
94
description : Diagnostics . Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_UseFsEvents_UseFsEventsOnParentDirectory ,
95
95
} ,
96
96
{
97
97
name : "watchDirectory" ,
98
- type : createMapFromTemplate ( {
98
+ type : new Map ( getEntries ( {
99
99
usefsevents : WatchDirectoryKind . UseFsEvents ,
100
100
fixedpollinginterval : WatchDirectoryKind . FixedPollingInterval ,
101
101
dynamicprioritypolling : WatchDirectoryKind . DynamicPriorityPolling ,
102
- } ) ,
102
+ } ) ) ,
103
103
category : Diagnostics . Advanced_Options ,
104
104
description : Diagnostics . Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling ,
105
105
} ,
106
106
{
107
107
name : "fallbackPolling" ,
108
- type : createMapFromTemplate ( {
108
+ type : new Map ( getEntries ( {
109
109
fixedinterval : PollingWatchKind . FixedInterval ,
110
110
priorityinterval : PollingWatchKind . PriorityInterval ,
111
111
dynamicpriority : PollingWatchKind . DynamicPriority ,
112
- } ) ,
112
+ } ) ) ,
113
113
category : Diagnostics . Advanced_Options ,
114
114
description : Diagnostics . Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority ,
115
115
} ,
@@ -286,7 +286,7 @@ namespace ts {
286
286
{
287
287
name : "target" ,
288
288
shortName : "t" ,
289
- type : createMapFromTemplate ( {
289
+ type : new Map ( getEntries ( {
290
290
es3 : ScriptTarget . ES3 ,
291
291
es5 : ScriptTarget . ES5 ,
292
292
es6 : ScriptTarget . ES2015 ,
@@ -297,7 +297,7 @@ namespace ts {
297
297
es2019 : ScriptTarget . ES2019 ,
298
298
es2020 : ScriptTarget . ES2020 ,
299
299
esnext : ScriptTarget . ESNext ,
300
- } ) ,
300
+ } ) ) ,
301
301
affectsSourceFile : true ,
302
302
affectsModuleResolution : true ,
303
303
affectsEmit : true ,
@@ -309,7 +309,7 @@ namespace ts {
309
309
{
310
310
name : "module" ,
311
311
shortName : "m" ,
312
- type : createMapFromTemplate ( {
312
+ type : new Map ( getEntries ( {
313
313
none : ModuleKind . None ,
314
314
commonjs : ModuleKind . CommonJS ,
315
315
amd : ModuleKind . AMD ,
@@ -319,7 +319,7 @@ namespace ts {
319
319
es2015 : ModuleKind . ES2015 ,
320
320
es2020 : ModuleKind . ES2020 ,
321
321
esnext : ModuleKind . ESNext
322
- } ) ,
322
+ } ) ) ,
323
323
affectsModuleResolution : true ,
324
324
affectsEmit : true ,
325
325
paramType : Diagnostics . KIND ,
@@ -356,11 +356,11 @@ namespace ts {
356
356
} ,
357
357
{
358
358
name : "jsx" ,
359
- type : createMapFromTemplate ( {
359
+ type : new Map ( getEntries ( {
360
360
"preserve" : JsxEmit . Preserve ,
361
361
"react-native" : JsxEmit . ReactNative ,
362
362
"react" : JsxEmit . React
363
- } ) ,
363
+ } ) ) ,
364
364
affectsSourceFile : true ,
365
365
paramType : Diagnostics . KIND ,
366
366
showInSimplifiedHelpView : true ,
@@ -476,11 +476,11 @@ namespace ts {
476
476
} ,
477
477
{
478
478
name : "importsNotUsedAsValues" ,
479
- type : createMapFromTemplate ( {
479
+ type : new Map ( getEntries ( {
480
480
remove : ImportsNotUsedAsValues . Remove ,
481
481
preserve : ImportsNotUsedAsValues . Preserve ,
482
482
error : ImportsNotUsedAsValues . Error
483
- } ) ,
483
+ } ) ) ,
484
484
affectsEmit : true ,
485
485
affectsSemanticDiagnostics : true ,
486
486
category : Diagnostics . Advanced_Options ,
@@ -610,10 +610,10 @@ namespace ts {
610
610
// Module Resolution
611
611
{
612
612
name : "moduleResolution" ,
613
- type : createMapFromTemplate ( {
613
+ type : new Map ( getEntries ( {
614
614
node : ModuleResolutionKind . NodeJs ,
615
615
classic : ModuleResolutionKind . Classic ,
616
- } ) ,
616
+ } ) ) ,
617
617
affectsModuleResolution : true ,
618
618
paramType : Diagnostics . STRATEGY ,
619
619
category : Diagnostics . Module_Resolution_Options ,
@@ -818,10 +818,10 @@ namespace ts {
818
818
} ,
819
819
{
820
820
name : "newLine" ,
821
- type : createMapFromTemplate ( {
821
+ type : new Map ( getEntries ( {
822
822
crlf : NewLineKind . CarriageReturnLineFeed ,
823
823
lf : NewLineKind . LineFeed
824
- } ) ,
824
+ } ) ) ,
825
825
affectsEmit : true ,
826
826
paramType : Diagnostics . NEWLINE ,
827
827
category : Diagnostics . Advanced_Options ,
@@ -1096,8 +1096,8 @@ namespace ts {
1096
1096
1097
1097
/*@internal */
1098
1098
export function createOptionNameMap ( optionDeclarations : readonly CommandLineOption [ ] ) : OptionsNameMap {
1099
- const optionsNameMap = createMap < CommandLineOption > ( ) ;
1100
- const shortOptionNames = createMap < string > ( ) ;
1099
+ const optionsNameMap = new Map < string , CommandLineOption > ( ) ;
1100
+ const shortOptionNames = new Map < string , string > ( ) ;
1101
1101
forEach ( optionDeclarations , option => {
1102
1102
optionsNameMap . set ( option . name . toLowerCase ( ) , option ) ;
1103
1103
if ( option . shortName ) {
@@ -2032,7 +2032,7 @@ namespace ts {
2032
2032
{ optionsNameMap } : OptionsNameMap ,
2033
2033
pathOptions ?: { configFilePath : string , useCaseSensitiveFileNames : boolean }
2034
2034
) : Map < string , CompilerOptionsValue > {
2035
- const result = createMap < CompilerOptionsValue > ( ) ;
2035
+ const result = new Map < string , CompilerOptionsValue > ( ) ;
2036
2036
const getCanonicalFileName = pathOptions && createGetCanonicalFileName ( pathOptions . useCaseSensitiveFileNames ) ;
2037
2037
2038
2038
for ( const name in options ) {
@@ -2962,17 +2962,17 @@ namespace ts {
2962
2962
// Literal file names (provided via the "files" array in tsconfig.json) are stored in a
2963
2963
// file map with a possibly case insensitive key. We use this map later when when including
2964
2964
// wildcard paths.
2965
- const literalFileMap = createMap < string > ( ) ;
2965
+ const literalFileMap = new Map < string , string > ( ) ;
2966
2966
2967
2967
// Wildcard paths (provided via the "includes" array in tsconfig.json) are stored in a
2968
2968
// file map with a possibly case insensitive key. We use this map to store paths matched
2969
2969
// via wildcard, and to handle extension priority.
2970
- const wildcardFileMap = createMap < string > ( ) ;
2970
+ const wildcardFileMap = new Map < string , string > ( ) ;
2971
2971
2972
2972
// Wildcard paths of json files (provided via the "includes" array in tsconfig.json) are stored in a
2973
2973
// file map with a possibly case insensitive key. We use this map to store paths matched
2974
2974
// via wildcard of *.json kind
2975
- const wildCardJsonFileMap = createMap < string > ( ) ;
2975
+ const wildCardJsonFileMap = new Map < string , string > ( ) ;
2976
2976
const { filesSpecs, validatedIncludeSpecs, validatedExcludeSpecs, wildcardDirectories } = spec ;
2977
2977
2978
2978
// Rather than requery this for each file and filespec, we query the supported extensions
0 commit comments