@typescript-deploys/pr-build 5.4.0-pr-56681-3 → 5.4.0-pr-56313-12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.4";
21
- var version = `${versionMajorMinor}.0-insiders.20231205`;
21
+ var version = `${versionMajorMinor}.0-insiders.20231206`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -7353,9 +7353,6 @@ var Diagnostics = {
7353
7353
  Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
7354
7354
  Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
7355
7355
  Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
7356
- Specify_how_files_are_determined_to_be_ECMAScript_modules_or_CommonJS_modules: diag(6805, 3 /* Message */, "Specify_how_files_are_determined_to_be_ECMAScript_modules_or_CommonJS_modules_6805", "Specify how files are determined to be ECMAScript modules or CommonJS modules."),
7357
- Specify_the_target_runtime_s_rules_for_ESM_CommonJS_interoperation: diag(6806, 3 /* Message */, "Specify_the_target_runtime_s_rules_for_ESM_CommonJS_interoperation_6806", "Specify the target runtime's rules for ESM-CommonJS interoperation."),
7358
- Specify_defaults_for_module_options_suited_for_common_runtimes_and_bundlers: diag(6807, 3 /* Message */, "Specify_defaults_for_module_options_suited_for_common_runtimes_and_bundlers_6807", "Specify defaults for module options suited for common runtimes and bundlers."),
7359
7356
  one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
7360
7357
  one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
7361
7358
  type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"),
@@ -7388,8 +7385,6 @@ var Diagnostics = {
7388
7385
  Compiles_the_current_project_with_additional_settings: diag(6929, 3 /* Message */, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."),
7389
7386
  true_for_ES2022_and_above_including_ESNext: diag(6930, 3 /* Message */, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."),
7390
7387
  List_of_file_name_suffixes_to_search_when_resolving_a_module: diag(6931, 1 /* Error */, "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931", "List of file name suffixes to search when resolving a module."),
7391
- node16_when_module_is_node16_nodenext_when_module_is_nodenext_none_otherwise: diag(6932, 3 /* Message */, "node16_when_module_is_node16_nodenext_when_module_is_nodenext_none_otherwise_6932", "'node16' when 'module' is 'node16'; 'nodenext' when 'module' is 'nodenext'; 'none' otherwise."),
7392
- node16_when_module_is_node16_nodenext_when_module_is_nodenext_babel_otherwise: diag(6933, 3 /* Message */, "node16_when_module_is_node16_nodenext_when_module_is_nodenext_babel_otherwise_6933", "'node16' when 'module' is 'node16'; 'nodenext' when 'module' is 'nodenext'; 'babel' otherwise."),
7393
7388
  Variable_0_implicitly_has_an_1_type: diag(7005, 1 /* Error */, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."),
7394
7389
  Parameter_0_implicitly_has_an_1_type: diag(7006, 1 /* Error */, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."),
7395
7390
  Member_0_implicitly_has_an_1_type: diag(7008, 1 /* Error */, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."),
@@ -16066,7 +16061,6 @@ function Symbol4(flags, name) {
16066
16061
  this.exportSymbol = void 0;
16067
16062
  this.constEnumOnlyModule = void 0;
16068
16063
  this.isReferenced = void 0;
16069
- this.isAssigned = void 0;
16070
16064
  this.links = void 0;
16071
16065
  }
16072
16066
  function Type3(checker, flags) {
@@ -16364,46 +16358,11 @@ function getEmitScriptTarget(compilerOptions) {
16364
16358
  return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
16365
16359
  }
16366
16360
  function getEmitModuleKind(compilerOptions) {
16367
- if (typeof compilerOptions.module === "object" && compilerOptions.module.emit !== void 0) {
16368
- return compilerOptions.module.emit;
16369
- }
16370
16361
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
16371
16362
  }
16372
16363
  function emitModuleKindIsNonNodeESM(moduleKind) {
16373
16364
  return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
16374
16365
  }
16375
- function getModulePreset(compilerOptions) {
16376
- if (typeof compilerOptions.module === "object") {
16377
- return compilerOptions.module.preset;
16378
- }
16379
- return compilerOptions.module;
16380
- }
16381
- function getModuleFormatDetectionKind(compilerOptions) {
16382
- if (typeof compilerOptions.module === "object" && compilerOptions.module.formatDetection !== void 0) {
16383
- return compilerOptions.module.formatDetection;
16384
- }
16385
- switch (getModulePreset(compilerOptions)) {
16386
- case 100 /* Node16 */:
16387
- return 100 /* Node16 */;
16388
- case 199 /* NodeNext */:
16389
- return 199 /* NodeNext */;
16390
- default:
16391
- return 0 /* None */;
16392
- }
16393
- }
16394
- function getModuleFormatInteropKind(compilerOptions) {
16395
- if (typeof compilerOptions.module === "object" && compilerOptions.module.formatInterop !== void 0) {
16396
- return compilerOptions.module.formatInterop;
16397
- }
16398
- switch (getModulePreset(compilerOptions)) {
16399
- case 100 /* Node16 */:
16400
- return 100 /* Node16 */;
16401
- case 199 /* NodeNext */:
16402
- return 199 /* NodeNext */;
16403
- default:
16404
- return 1 /* Babel */;
16405
- }
16406
- }
16407
16366
  function getEmitModuleResolutionKind(compilerOptions) {
16408
16367
  let moduleResolution = compilerOptions.moduleResolution;
16409
16368
  if (moduleResolution === void 0) {
@@ -17566,6 +17525,10 @@ function hasResolutionModeOverride(node) {
17566
17525
  }
17567
17526
  return !!getResolutionModeOverride(node.attributes);
17568
17527
  }
17528
+ var stringReplace = String.prototype.replace;
17529
+ function replaceFirstStar(s, replacement) {
17530
+ return stringReplace.call(s, "*", replacement);
17531
+ }
17569
17532
 
17570
17533
  // src/compiler/factory/baseNodeFactory.ts
17571
17534
  function createBaseNodeFactory() {
@@ -34234,79 +34197,23 @@ var targetOptionDeclaration = {
34234
34197
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
34235
34198
  defaultValueDescription: 1 /* ES5 */
34236
34199
  };
34237
- var moduleKindMap = new Map(Object.entries({
34238
- none: 0 /* None */,
34239
- commonjs: 1 /* CommonJS */,
34240
- amd: 2 /* AMD */,
34241
- system: 4 /* System */,
34242
- umd: 3 /* UMD */,
34243
- es6: 5 /* ES2015 */,
34244
- es2015: 5 /* ES2015 */,
34245
- es2020: 6 /* ES2020 */,
34246
- es2022: 7 /* ES2022 */,
34247
- esnext: 99 /* ESNext */,
34248
- node16: 100 /* Node16 */,
34249
- nodenext: 199 /* NodeNext */
34250
- }));
34251
- var moduleSubOptionDeclarations = [
34252
- {
34253
- name: "preset",
34254
- type: moduleKindMap,
34255
- affectsSourceFile: true,
34256
- affectsBuildInfo: true,
34257
- affectsEmit: true,
34258
- affectsSemanticDiagnostics: true,
34259
- category: Diagnostics.Modules,
34260
- description: Diagnostics.Specify_defaults_for_module_options_suited_for_common_runtimes_and_bundlers,
34261
- defaultValueDescription: void 0,
34262
- getParentOption: getModuleOptionDeclaration
34263
- },
34264
- {
34265
- name: "formatDetection",
34266
- type: new Map(Object.entries({
34267
- none: 0 /* None */,
34268
- bundler: 1 /* Bundler */,
34269
- node16: 100 /* Node16 */,
34270
- nodenext: 199 /* NodeNext */
34271
- })),
34272
- affectsModuleResolution: true,
34273
- affectsSemanticDiagnostics: true,
34274
- affectsEmit: true,
34275
- category: Diagnostics.Modules,
34276
- description: Diagnostics.Specify_how_files_are_determined_to_be_ECMAScript_modules_or_CommonJS_modules,
34277
- defaultValueDescription: Diagnostics.node16_when_module_is_node16_nodenext_when_module_is_nodenext_none_otherwise,
34278
- getParentOption: getModuleOptionDeclaration
34279
- },
34280
- {
34281
- name: "formatInterop",
34282
- type: new Map(Object.entries({
34283
- babel: 1 /* Babel */,
34284
- bundlernode: 2 /* BundlerNode */,
34285
- node16: 100 /* Node16 */,
34286
- nodenext: 199 /* NodeNext */
34287
- })),
34288
- affectsSemanticDiagnostics: true,
34289
- category: Diagnostics.Modules,
34290
- description: Diagnostics.Specify_the_target_runtime_s_rules_for_ESM_CommonJS_interoperation,
34291
- defaultValueDescription: Diagnostics.node16_when_module_is_node16_nodenext_when_module_is_nodenext_babel_otherwise,
34292
- getParentOption: getModuleOptionDeclaration
34293
- },
34294
- {
34295
- name: "emit",
34296
- type: moduleKindMap,
34297
- affectsEmit: true,
34298
- category: Diagnostics.Modules,
34299
- description: Diagnostics.Specify_what_module_code_is_generated,
34300
- defaultValueDescription: void 0,
34301
- getParentOption: getModuleOptionDeclaration
34302
- }
34303
- ];
34304
34200
  var moduleOptionDeclaration = {
34305
34201
  name: "module",
34306
34202
  shortName: "m",
34307
- type: "objectOrShorthand",
34308
- shorthandType: moduleKindMap,
34309
- elementOptions: commandLineOptionsToMap(moduleSubOptionDeclarations),
34203
+ type: new Map(Object.entries({
34204
+ none: 0 /* None */,
34205
+ commonjs: 1 /* CommonJS */,
34206
+ amd: 2 /* AMD */,
34207
+ system: 4 /* System */,
34208
+ umd: 3 /* UMD */,
34209
+ es6: 5 /* ES2015 */,
34210
+ es2015: 5 /* ES2015 */,
34211
+ es2020: 6 /* ES2020 */,
34212
+ es2022: 7 /* ES2022 */,
34213
+ esnext: 99 /* ESNext */,
34214
+ node16: 100 /* Node16 */,
34215
+ nodenext: 199 /* NodeNext */
34216
+ })),
34310
34217
  affectsSourceFile: true,
34311
34218
  affectsModuleResolution: true,
34312
34219
  affectsEmit: true,
@@ -34317,9 +34224,6 @@ var moduleOptionDeclaration = {
34317
34224
  description: Diagnostics.Specify_what_module_code_is_generated,
34318
34225
  defaultValueDescription: void 0
34319
34226
  };
34320
- function getModuleOptionDeclaration() {
34321
- return moduleOptionDeclaration;
34322
- }
34323
34227
  var commandOptionsWithoutBuild = [
34324
34228
  // CommandLine only options
34325
34229
  {
@@ -34386,9 +34290,6 @@ var commandOptionsWithoutBuild = [
34386
34290
  // Basic
34387
34291
  targetOptionDeclaration,
34388
34292
  moduleOptionDeclaration,
34389
- // HEAD
34390
- //
34391
- // parent of 19e60f1a19 (Fix showConfig)
34392
34293
  {
34393
34294
  name: "lib",
34394
34295
  type: "list",
@@ -35385,16 +35286,10 @@ function createOptionNameMap(optionDeclarations2) {
35385
35286
  const optionsNameMap = /* @__PURE__ */ new Map();
35386
35287
  const shortOptionNames = /* @__PURE__ */ new Map();
35387
35288
  forEach(optionDeclarations2, (option) => {
35388
- const lowerCaseName = option.name.toLowerCase();
35389
- optionsNameMap.set(lowerCaseName, option);
35289
+ optionsNameMap.set(option.name.toLowerCase(), option);
35390
35290
  if (option.shortName) {
35391
35291
  shortOptionNames.set(option.shortName, option.name);
35392
35292
  }
35393
- if (option.type === "objectOrShorthand") {
35394
- forEachEntry(option.elementOptions, (subOption, subOptionName) => {
35395
- optionsNameMap.set(`${lowerCaseName}.${subOptionName.toLowerCase()}`, subOption);
35396
- });
35397
- }
35398
35293
  });
35399
35294
  return { optionsNameMap, shortOptionNames };
35400
35295
  }
@@ -35415,8 +35310,7 @@ var defaultInitCompilerOptions = {
35415
35310
  skipLibCheck: true
35416
35311
  };
35417
35312
  function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
35418
- const type = opt.type === "objectOrShorthand" ? opt.shorthandType : opt.type;
35419
- const namesOfType = arrayFrom(type.keys());
35313
+ const namesOfType = arrayFrom(opt.type.keys());
35420
35314
  const stringNames = (opt.deprecatedKeys ? namesOfType.filter((k) => !opt.deprecatedKeys.has(k)) : namesOfType).map((key) => `'${key}'`).join(", ");
35421
35315
  return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, stringNames);
35422
35316
  }
@@ -35539,7 +35433,6 @@ function parseCommandLineWorker(diagnostics, commandLine, readFile) {
35539
35433
  }
35540
35434
  }
35541
35435
  function parseOptionValue(args, i, diagnostics, opt, options, errors) {
35542
- var _a;
35543
35436
  if (opt.isTSConfigOnly) {
35544
35437
  const optValue = args[i];
35545
35438
  if (optValue === "null") {
@@ -35568,46 +35461,40 @@ function parseOptionValue(args, i, diagnostics, opt, options, errors) {
35568
35461
  if (!args[i] && opt.type !== "boolean") {
35569
35462
  errors.push(createCompilerDiagnostic(diagnostics.optionTypeMismatchDiagnostic, opt.name, getCompilerOptionValueTypeString(opt)));
35570
35463
  }
35571
- const parentOption = (_a = opt.getParentOption) == null ? void 0 : _a.call(opt);
35572
- const [base = {}, name] = parentOption ? [options[parentOption.name], opt.name] : [options, opt.name];
35573
- if (parentOption) {
35574
- options[parentOption.name] = base;
35575
- }
35576
35464
  if (args[i] !== "null") {
35577
- switch (opt.type === "objectOrShorthand" ? opt.shorthandType : opt.type) {
35465
+ switch (opt.type) {
35578
35466
  case "number":
35579
- base[name] = validateJsonOptionValue(opt, parseInt(args[i]), errors);
35467
+ options[opt.name] = validateJsonOptionValue(opt, parseInt(args[i]), errors);
35580
35468
  i++;
35581
35469
  break;
35582
35470
  case "boolean":
35583
35471
  const optValue = args[i];
35584
- base[name] = validateJsonOptionValue(opt, optValue !== "false", errors);
35472
+ options[opt.name] = validateJsonOptionValue(opt, optValue !== "false", errors);
35585
35473
  if (optValue === "false" || optValue === "true") {
35586
35474
  i++;
35587
35475
  }
35588
35476
  break;
35589
35477
  case "string":
35590
- base[name] = validateJsonOptionValue(opt, args[i] || "", errors);
35478
+ options[opt.name] = validateJsonOptionValue(opt, args[i] || "", errors);
35591
35479
  i++;
35592
35480
  break;
35593
35481
  case "list":
35594
35482
  const result = parseListTypeOption(opt, args[i], errors);
35595
- base[name] = result || [];
35483
+ options[opt.name] = result || [];
35596
35484
  if (result) {
35597
35485
  i++;
35598
35486
  }
35599
35487
  break;
35600
- case "object":
35601
35488
  case "listOrElement":
35602
- Debug.fail("listOrElement, object, and objectOrShorthand not supported here");
35489
+ Debug.fail("listOrElement not supported here");
35603
35490
  break;
35604
35491
  default:
35605
- base[name] = parseCustomTypeOption(opt, args[i], errors);
35492
+ options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
35606
35493
  i++;
35607
35494
  break;
35608
35495
  }
35609
35496
  } else {
35610
- base[name] = void 0;
35497
+ options[opt.name] = void 0;
35611
35498
  i++;
35612
35499
  }
35613
35500
  }
@@ -35973,23 +35860,17 @@ function isCompilerOptionsValue(option, value) {
35973
35860
  if (option) {
35974
35861
  if (isNullOrUndefined(value))
35975
35862
  return !option.disallowNullOrUndefined;
35976
- if (option.type === "listOrElement") {
35977
- return isCompilerOptionsValueWorker("list", value) || isCompilerOptionsValue(option.element, value);
35863
+ if (option.type === "list") {
35864
+ return isArray(value);
35978
35865
  }
35979
- if (option.type === "objectOrShorthand") {
35980
- return isCompilerOptionsValueWorker(option.shorthandType, value) || typeof value === "object";
35866
+ if (option.type === "listOrElement") {
35867
+ return isArray(value) || isCompilerOptionsValue(option.element, value);
35981
35868
  }
35982
- return isCompilerOptionsValueWorker(option.type, value);
35869
+ const expectedType = isString(option.type) ? option.type : "string";
35870
+ return typeof value === expectedType;
35983
35871
  }
35984
35872
  return false;
35985
35873
  }
35986
- function isCompilerOptionsValueWorker(type, value) {
35987
- if (type === "list") {
35988
- return isArray(value);
35989
- }
35990
- const expectedType = isString(type) ? type : "string";
35991
- return typeof value === expectedType;
35992
- }
35993
35874
  function convertToTSConfig(configParseResult, configFileName, host) {
35994
35875
  var _a, _b, _c;
35995
35876
  const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames);
@@ -36073,8 +35954,6 @@ function getCustomTypeMapOfCommandLineOption(optionDefinition) {
36073
35954
  case "list":
36074
35955
  case "listOrElement":
36075
35956
  return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
36076
- case "objectOrShorthand":
36077
- return typeof optionDefinition.shorthandType === "object" ? optionDefinition.shorthandType : void 0;
36078
35957
  default:
36079
35958
  return optionDefinition.type;
36080
35959
  }
@@ -36573,7 +36452,6 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
36573
36452
  const options = getDefaultCompilerOptions(configFileName);
36574
36453
  let typeAcquisition;
36575
36454
  let watchOptions;
36576
- let moduleOption;
36577
36455
  let extendedConfigPath;
36578
36456
  let rootCompilerOptions;
36579
36457
  const rootOptions = getTsconfigRootOptionsMap();
@@ -36601,8 +36479,6 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
36601
36479
  currentOption = watchOptions ?? (watchOptions = {});
36602
36480
  else if (parentOption === typeAcquisitionDeclaration)
36603
36481
  currentOption = typeAcquisition ?? (typeAcquisition = getDefaultTypeAcquisition(configFileName));
36604
- else if (parentOption === moduleOptionDeclaration)
36605
- currentOption = moduleOption ?? (moduleOption = {});
36606
36482
  else
36607
36483
  Debug.fail("Unknown option");
36608
36484
  currentOption[option.name] = value;
@@ -36764,16 +36640,6 @@ function convertJsonOption(opt, value, basePath, errors, propertyAssignment, val
36764
36640
  return convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile);
36765
36641
  } else if (optType === "listOrElement") {
36766
36642
  return isArray(value) ? convertJsonOptionOfListType(opt, value, basePath, errors, propertyAssignment, valueExpression, sourceFile) : convertJsonOption(opt.element, value, basePath, errors, propertyAssignment, valueExpression, sourceFile);
36767
- } else if (optType === "objectOrShorthand") {
36768
- if (!value || typeof value !== "object") {
36769
- if (!isString(opt.shorthandType)) {
36770
- return convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sourceFile);
36771
- }
36772
- const validatedValue2 = validateJsonOptionValue(opt, value, errors, valueExpression, sourceFile);
36773
- return isNullOrUndefined(validatedValue2) ? validatedValue2 : normalizeNonListOptionValue(opt, basePath, validatedValue2);
36774
- } else {
36775
- return {};
36776
- }
36777
36643
  } else if (!isString(opt.type)) {
36778
36644
  return convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sourceFile);
36779
36645
  }
@@ -36806,8 +36672,7 @@ function convertJsonOptionOfCustomType(opt, value, errors, valueExpression, sour
36806
36672
  if (isNullOrUndefined(value))
36807
36673
  return void 0;
36808
36674
  const key = value.toLowerCase();
36809
- const type = opt.type === "objectOrShorthand" ? opt.shorthandType : opt.type;
36810
- const val = type.get(key);
36675
+ const val = opt.type.get(key);
36811
36676
  if (val !== void 0) {
36812
36677
  return validateJsonOptionValue(opt, val, errors, valueExpression, sourceFile);
36813
36678
  } else {
@@ -37034,8 +36899,7 @@ function removeWildcardFilesWithLowerPriorityExtension(file, wildcardFiles, exte
37034
36899
  }
37035
36900
  }
37036
36901
  function getDefaultValueForOption(option) {
37037
- const type = option.type === "objectOrShorthand" ? option.shorthandType : option.type;
37038
- switch (type) {
36902
+ switch (option.type) {
37039
36903
  case "number":
37040
36904
  return 1;
37041
36905
  case "boolean":
@@ -39295,7 +39159,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
39295
39159
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
39296
39160
  }
39297
39161
  const resolved = forEach(paths[matchedPatternText], (subst) => {
39298
- const path = matchedStar ? subst.replace("*", matchedStar) : subst;
39162
+ const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
39299
39163
  const candidate = normalizePath(combinePaths(baseDirectory, path));
39300
39164
  if (state.traceEnabled) {
39301
39165
  trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
@@ -42932,7 +42796,7 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
42932
42796
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
42933
42797
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
42934
42798
  if (!pathIsRelative(matchedStar)) {
42935
- return key.replace("*", matchedStar);
42799
+ return replaceFirstStar(key, matchedStar);
42936
42800
  }
42937
42801
  }
42938
42802
  }
@@ -42980,11 +42844,11 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
42980
42844
  const trailingSlice = pathOrPattern.slice(starPos + 1);
42981
42845
  if (startsWith(targetFilePath, leadingSlice) && endsWith(targetFilePath, trailingSlice)) {
42982
42846
  const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
42983
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
42847
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
42984
42848
  }
42985
42849
  if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice) && endsWith(extensionSwappedTarget, trailingSlice)) {
42986
42850
  const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
42987
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
42851
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
42988
42852
  }
42989
42853
  break;
42990
42854
  }
@@ -45772,16 +45636,19 @@ function createTypeChecker(host) {
45772
45636
  return isStringLiteralLike(usage) ? getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
45773
45637
  }
45774
45638
  function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
45775
- return usageMode === 99 /* ESNext */ && targetMode !== 99 /* ESNext */;
45639
+ return usageMode === 99 /* ESNext */ && targetMode === 1 /* CommonJS */;
45776
45640
  }
45777
45641
  function isOnlyImportedAsDefault(usage) {
45778
45642
  const usageMode = getUsageModeForExpression(usage);
45779
45643
  return usageMode === 99 /* ESNext */ && endsWith(usage.text, ".json" /* Json */);
45780
45644
  }
45781
45645
  function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
45782
- const usageMode = file && getModuleFormatInteropKind(compilerOptions) !== 1 /* Babel */ && getUsageModeForExpression(usage);
45783
- if (usageMode === 99 /* ESNext */) {
45784
- return isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
45646
+ const usageMode = file && getUsageModeForExpression(usage);
45647
+ if (file && usageMode !== void 0) {
45648
+ const result = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
45649
+ if (usageMode === 99 /* ESNext */ || result) {
45650
+ return result;
45651
+ }
45785
45652
  }
45786
45653
  if (!allowSyntheticDefaultImports) {
45787
45654
  return false;
@@ -46674,7 +46541,6 @@ function createTypeChecker(host) {
46674
46541
  const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
46675
46542
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
46676
46543
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
46677
- const moduleFormatInterop = getModuleFormatInteropKind(compilerOptions);
46678
46544
  const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
46679
46545
  const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
46680
46546
  const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
@@ -46710,7 +46576,7 @@ function createTypeChecker(host) {
46710
46576
  moduleReference
46711
46577
  );
46712
46578
  }
46713
- if (moduleFormatInterop === 100 /* Node16 */ || moduleFormatInterop === 199 /* NodeNext */) {
46579
+ if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
46714
46580
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
46715
46581
  const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
46716
46582
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
@@ -65967,7 +65833,7 @@ function createTypeChecker(host) {
65967
65833
  case 80 /* Identifier */:
65968
65834
  if (!isThisInTypeQuery(node)) {
65969
65835
  const symbol = getResolvedSymbol(node);
65970
- return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
65836
+ return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSomeSymbolAssigned(getRootDeclaration(symbol.valueDeclaration));
65971
65837
  }
65972
65838
  break;
65973
65839
  case 211 /* PropertyAccessExpression */:
@@ -67056,11 +66922,8 @@ function createTypeChecker(host) {
67056
66922
  function getControlFlowContainer(node) {
67057
66923
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
67058
66924
  }
67059
- function isSymbolAssigned(symbol) {
67060
- if (!symbol.valueDeclaration) {
67061
- return false;
67062
- }
67063
- const parent = getRootDeclaration(symbol.valueDeclaration).parent;
66925
+ function isSomeSymbolAssigned(rootDeclaration) {
66926
+ const parent = rootDeclaration.parent;
67064
66927
  const links = getNodeLinks(parent);
67065
66928
  if (!(links.flags & 131072 /* AssignmentsMarked */)) {
67066
66929
  links.flags |= 131072 /* AssignmentsMarked */;
@@ -67068,7 +66931,7 @@ function createTypeChecker(host) {
67068
66931
  markNodeAssignments(parent);
67069
66932
  }
67070
66933
  }
67071
- return symbol.isAssigned || false;
66934
+ return getNodeLinks(rootDeclaration).someSymbolAssigned;
67072
66935
  }
67073
66936
  function hasParentWithAssignmentsMarked(node) {
67074
66937
  return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
@@ -67078,11 +66941,11 @@ function createTypeChecker(host) {
67078
66941
  if (isAssignmentTarget(node)) {
67079
66942
  const symbol = getResolvedSymbol(node);
67080
66943
  if (isParameterOrCatchClauseVariable(symbol)) {
67081
- symbol.isAssigned = true;
66944
+ return getNodeLinks(getRootDeclaration(symbol.valueDeclaration)).someSymbolAssigned = true;
67082
66945
  }
67083
66946
  }
67084
66947
  } else {
67085
- forEachChild(node, markNodeAssignments);
66948
+ return forEachChild(node, markNodeAssignments);
67086
66949
  }
67087
66950
  }
67088
66951
  function isConstantVariable(symbol) {
@@ -67183,7 +67046,7 @@ function createTypeChecker(host) {
67183
67046
  const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
67184
67047
  const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
67185
67048
  links.flags &= ~4194304 /* InCheckIdentifier */;
67186
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
67049
+ if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
67187
67050
  const pattern = declaration.parent;
67188
67051
  const narrowedType = getFlowTypeOfReference(
67189
67052
  pattern,
@@ -67212,7 +67075,7 @@ function createTypeChecker(host) {
67212
67075
  const contextualSignature = getContextualSignature(func);
67213
67076
  if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
67214
67077
  const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
67215
- if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
67078
+ if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSomeSymbolAssigned(declaration)) {
67216
67079
  const narrowedType = getFlowTypeOfReference(
67217
67080
  func,
67218
67081
  restType,
@@ -67328,7 +67191,8 @@ function createTypeChecker(host) {
67328
67191
  return type;
67329
67192
  }
67330
67193
  type = getNarrowableTypeForReference(type, node, checkMode);
67331
- const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
67194
+ const rootDeclaration = getRootDeclaration(declaration);
67195
+ const isParameter2 = rootDeclaration.kind === 169 /* Parameter */;
67332
67196
  const declarationContainer = getControlFlowContainer(declaration);
67333
67197
  let flowContainer = getControlFlowContainer(node);
67334
67198
  const isOuterVariable = flowContainer !== declarationContainer;
@@ -67336,7 +67200,7 @@ function createTypeChecker(host) {
67336
67200
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
67337
67201
  const typeIsAutomatic = type === autoType || type === autoArrayType;
67338
67202
  const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
67339
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
67203
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSomeSymbolAssigned(rootDeclaration))) {
67340
67204
  flowContainer = getControlFlowContainer(flowContainer);
67341
67205
  }
67342
67206
  const assumeInitialized = isParameter2 || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* AnyOrUnknown */ | 16384 /* Void */)) !== 0 || isInTypeQuery(node) || isInAmbientOrTypeNode(node) || node.parent.kind === 281 /* ExportSpecifier */) || node.parent.kind === 235 /* NonNullExpression */ || declaration.kind === 260 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 33554432 /* Ambient */;
@@ -107484,7 +107348,7 @@ function transformECMAScriptModule(context) {
107484
107348
  return node.isExportEquals ? void 0 : node;
107485
107349
  }
107486
107350
  function visitExportDeclaration(node) {
107487
- if (getEmitModuleKind(compilerOptions) > 5 /* ES2015 */) {
107351
+ if (compilerOptions.module !== void 0 && compilerOptions.module > 5 /* ES2015 */) {
107488
107352
  return node;
107489
107353
  }
107490
107354
  if (!node.exportClause || !isNamespaceExport(node.exportClause) || !node.moduleSpecifier) {
@@ -116674,25 +116538,20 @@ function getConfigFileParsingDiagnostics(configFileParseResult) {
116674
116538
  return configFileParseResult.options.configFile ? [...configFileParseResult.options.configFile.parseDiagnostics, ...configFileParseResult.errors] : configFileParseResult.errors;
116675
116539
  }
116676
116540
  function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) {
116677
- const formatDetection = getModuleFormatDetectionKind(options);
116678
- switch (formatDetection) {
116679
- case 1 /* Bundler */:
116680
- case 100 /* Node16 */:
116681
- case 199 /* NodeNext */:
116682
- case 2 /* DefaultModule */:
116683
- case 3 /* DefaultCommonJS */:
116684
- const defaultFormat = formatDetection === 1 /* Bundler */ ? void 0 : formatDetection === 2 /* DefaultModule */ ? 99 /* ESNext */ : 1 /* CommonJS */;
116685
- return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson(defaultFormat) : void 0;
116541
+ switch (getEmitModuleResolutionKind(options)) {
116542
+ case 3 /* Node16 */:
116543
+ case 99 /* NodeNext */:
116544
+ return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
116686
116545
  default:
116687
116546
  return void 0;
116688
116547
  }
116689
- function lookupFromPackageJson(defaultFormat) {
116548
+ function lookupFromPackageJson() {
116690
116549
  const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options);
116691
116550
  const packageJsonLocations = [];
116692
116551
  state.failedLookupLocations = packageJsonLocations;
116693
116552
  state.affectingLocations = packageJsonLocations;
116694
116553
  const packageJsonScope = getPackageScopeForPath(fileName, state);
116695
- const impliedNodeFormat = (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? 99 /* ESNext */ : (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "commonjs" ? 1 /* CommonJS */ : defaultFormat;
116554
+ const impliedNodeFormat = (packageJsonScope == null ? void 0 : packageJsonScope.contents.packageJsonContent.type) === "module" ? 99 /* ESNext */ : 1 /* CommonJS */;
116696
116555
  return { impliedNodeFormat, packageJsonLocations, packageJsonScope };
116697
116556
  }
116698
116557
  }
@@ -126471,12 +126330,11 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
126471
126330
  }
126472
126331
  function getPossibleValues(option3) {
126473
126332
  let possibleValues;
126474
- const type = option3.type === "objectOrShorthand" ? option3.shorthandType : option3.type;
126475
- switch (type) {
126333
+ switch (option3.type) {
126476
126334
  case "string":
126477
126335
  case "number":
126478
126336
  case "boolean":
126479
- possibleValues = type;
126337
+ possibleValues = option3.type;
126480
126338
  break;
126481
126339
  case "list":
126482
126340
  case "listOrElement":
@@ -126487,7 +126345,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
126487
126345
  break;
126488
126346
  default:
126489
126347
  const inverted = {};
126490
- type.forEach((value, name2) => {
126348
+ option3.type.forEach((value, name2) => {
126491
126349
  var _a2;
126492
126350
  if (!((_a2 = option3.deprecatedKeys) == null ? void 0 : _a2.has(name2))) {
126493
126351
  (inverted[value] || (inverted[value] = [])).push(name2);