typescript 5.4.0-dev.20231205 → 5.4.0-dev.20231207

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-dev.20231205`;
21
+ var version = `${versionMajorMinor}.0-dev.20231207`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -13866,12 +13866,12 @@ function canHaveJSDoc(node) {
13866
13866
  function getJSDocCommentsAndTags(hostNode, noCache) {
13867
13867
  let result;
13868
13868
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
13869
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
13869
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
13870
13870
  }
13871
13871
  let node = hostNode;
13872
13872
  while (node && node.parent) {
13873
13873
  if (hasJSDocNodes(node)) {
13874
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
13874
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
13875
13875
  }
13876
13876
  if (node.kind === 169 /* Parameter */) {
13877
13877
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -13885,12 +13885,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
13885
13885
  }
13886
13886
  return result || emptyArray;
13887
13887
  }
13888
- function filterOwnedJSDocTags(hostNode, jsDoc) {
13889
- if (isJSDoc(jsDoc)) {
13890
- const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
13891
- return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
13892
- }
13893
- return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
13888
+ function filterOwnedJSDocTags(hostNode, comments) {
13889
+ const lastJsDoc = last(comments);
13890
+ return flatMap(comments, (jsDoc) => {
13891
+ if (jsDoc === lastJsDoc) {
13892
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
13893
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
13894
+ } else {
13895
+ return filter(jsDoc.tags, isJSDocOverloadTag);
13896
+ }
13897
+ });
13894
13898
  }
13895
13899
  function ownsJSDocTag(hostNode, tag) {
13896
13900
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -13929,6 +13933,9 @@ function getEffectiveContainerForJSDocTemplateTag(node) {
13929
13933
  }
13930
13934
  return getHostSignatureFromJSDoc(node);
13931
13935
  }
13936
+ function getJSDocOverloadTags(node) {
13937
+ return getAllJSDocTags(node, isJSDocOverloadTag);
13938
+ }
13932
13939
  function getHostSignatureFromJSDoc(node) {
13933
13940
  const host = getEffectiveJSDocHost(node);
13934
13941
  if (host) {
@@ -17526,6 +17533,10 @@ function hasResolutionModeOverride(node) {
17526
17533
  }
17527
17534
  return !!getResolutionModeOverride(node.attributes);
17528
17535
  }
17536
+ var stringReplace = String.prototype.replace;
17537
+ function replaceFirstStar(s, replacement) {
17538
+ return stringReplace.call(s, "*", replacement);
17539
+ }
17529
17540
 
17530
17541
  // src/compiler/factory/baseNodeFactory.ts
17531
17542
  function createBaseNodeFactory() {
@@ -28294,8 +28305,7 @@ var Parser;
28294
28305
  function parseJSDocFunctionType() {
28295
28306
  const pos = getNodePos();
28296
28307
  const hasJSDoc = hasPrecedingJSDocComment();
28297
- if (lookAhead(nextTokenIsOpenParen)) {
28298
- nextToken();
28308
+ if (tryParse(nextTokenIsOpenParen)) {
28299
28309
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
28300
28310
  const type = parseReturnType(
28301
28311
  59 /* ColonToken */,
@@ -39156,7 +39166,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
39156
39166
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
39157
39167
  }
39158
39168
  const resolved = forEach(paths[matchedPatternText], (subst) => {
39159
- const path = matchedStar ? subst.replace("*", matchedStar) : subst;
39169
+ const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
39160
39170
  const candidate = normalizePath(combinePaths(baseDirectory, path));
39161
39171
  if (state.traceEnabled) {
39162
39172
  trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
@@ -42793,7 +42803,7 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
42793
42803
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
42794
42804
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
42795
42805
  if (!pathIsRelative(matchedStar)) {
42796
- return key.replace("*", matchedStar);
42806
+ return replaceFirstStar(key, matchedStar);
42797
42807
  }
42798
42808
  }
42799
42809
  }
@@ -42841,11 +42851,11 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
42841
42851
  const trailingSlice = pathOrPattern.slice(starPos + 1);
42842
42852
  if (startsWith(targetFilePath, leadingSlice) && endsWith(targetFilePath, trailingSlice)) {
42843
42853
  const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
42844
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
42854
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
42845
42855
  }
42846
42856
  if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice) && endsWith(extensionSwappedTarget, trailingSlice)) {
42847
42857
  const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
42848
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
42858
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
42849
42859
  }
42850
42860
  break;
42851
42861
  }
@@ -55490,22 +55500,15 @@ function createTypeChecker(host) {
55490
55500
  }
55491
55501
  }
55492
55502
  if (isInJSFile(decl) && decl.jsDoc) {
55493
- let hasJSDocOverloads = false;
55494
- for (const node of decl.jsDoc) {
55495
- if (node.tags) {
55496
- for (const tag of node.tags) {
55497
- if (isJSDocOverloadTag(tag)) {
55498
- const jsDocSignature = tag.typeExpression;
55499
- if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
55500
- reportImplicitAny(jsDocSignature, anyType);
55501
- }
55502
- result.push(getSignatureFromDeclaration(jsDocSignature));
55503
- hasJSDocOverloads = true;
55504
- }
55503
+ const tags = getJSDocOverloadTags(decl);
55504
+ if (length(tags)) {
55505
+ for (const tag of tags) {
55506
+ const jsDocSignature = tag.typeExpression;
55507
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
55508
+ reportImplicitAny(jsDocSignature, anyType);
55505
55509
  }
55510
+ result.push(getSignatureFromDeclaration(jsDocSignature));
55506
55511
  }
55507
- }
55508
- if (hasJSDocOverloads) {
55509
55512
  continue;
55510
55513
  }
55511
55514
  }
@@ -73148,9 +73151,16 @@ function createTypeChecker(host) {
73148
73151
  const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
73149
73152
  for (let i = 0; i < len; i++) {
73150
73153
  const parameter = signature.parameters[i];
73151
- if (!getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) {
73152
- const contextualParameterType = tryGetTypeAtPosition(context, i);
73153
- assignParameterType(parameter, contextualParameterType);
73154
+ const declaration = parameter.valueDeclaration;
73155
+ if (!getEffectiveTypeAnnotationNode(declaration)) {
73156
+ let type = tryGetTypeAtPosition(context, i);
73157
+ if (type && declaration.initializer) {
73158
+ let initializerType = checkDeclarationInitializer(declaration, 0 /* Normal */);
73159
+ if (!isTypeAssignableTo(initializerType, type) && isTypeAssignableTo(type, initializerType = widenTypeInferredFromInitializer(declaration, initializerType))) {
73160
+ type = initializerType;
73161
+ }
73162
+ }
73163
+ assignParameterType(parameter, type);
73154
73164
  }
73155
73165
  }
73156
73166
  if (signatureHasRestParameter(signature)) {
@@ -76649,15 +76659,7 @@ function createTypeChecker(host) {
76649
76659
  }
76650
76660
  }
76651
76661
  if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
76652
- for (const node2 of current.jsDoc) {
76653
- if (node2.tags) {
76654
- for (const tag of node2.tags) {
76655
- if (isJSDocOverloadTag(tag)) {
76656
- hasOverloads = true;
76657
- }
76658
- }
76659
- }
76660
- }
76662
+ hasOverloads = length(getJSDocOverloadTags(current)) > 0;
76661
76663
  }
76662
76664
  }
76663
76665
  }
@@ -80047,7 +80049,7 @@ function createTypeChecker(host) {
80047
80049
  error(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
80048
80050
  } else {
80049
80051
  const text = getTextOfPropertyName(member.name);
80050
- if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
80052
+ if (isNumericLiteralName(text)) {
80051
80053
  error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
80052
80054
  }
80053
80055
  }
package/lib/tsserver.js CHANGED
@@ -822,6 +822,7 @@ __export(server_exports, {
822
822
  getJSDocEnumTag: () => getJSDocEnumTag,
823
823
  getJSDocHost: () => getJSDocHost,
824
824
  getJSDocImplementsTags: () => getJSDocImplementsTags,
825
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
825
826
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
826
827
  getJSDocParameterTags: () => getJSDocParameterTags,
827
828
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -2052,6 +2053,7 @@ __export(server_exports, {
2052
2053
  removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
2053
2054
  repeatString: () => repeatString,
2054
2055
  replaceElement: () => replaceElement,
2056
+ replaceFirstStar: () => replaceFirstStar,
2055
2057
  resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
2056
2058
  resolveConfigFileProjectName: () => resolveConfigFileProjectName,
2057
2059
  resolveJSModule: () => resolveJSModule,
@@ -2332,7 +2334,7 @@ module.exports = __toCommonJS(server_exports);
2332
2334
 
2333
2335
  // src/compiler/corePublic.ts
2334
2336
  var versionMajorMinor = "5.4";
2335
- var version = `${versionMajorMinor}.0-dev.20231205`;
2337
+ var version = `${versionMajorMinor}.0-dev.20231207`;
2336
2338
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2337
2339
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2338
2340
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -17756,12 +17758,12 @@ function canHaveJSDoc(node) {
17756
17758
  function getJSDocCommentsAndTags(hostNode, noCache) {
17757
17759
  let result;
17758
17760
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
17759
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
17761
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
17760
17762
  }
17761
17763
  let node = hostNode;
17762
17764
  while (node && node.parent) {
17763
17765
  if (hasJSDocNodes(node)) {
17764
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
17766
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
17765
17767
  }
17766
17768
  if (node.kind === 169 /* Parameter */) {
17767
17769
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -17775,12 +17777,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
17775
17777
  }
17776
17778
  return result || emptyArray;
17777
17779
  }
17778
- function filterOwnedJSDocTags(hostNode, jsDoc) {
17779
- if (isJSDoc(jsDoc)) {
17780
- const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
17781
- return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
17782
- }
17783
- return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
17780
+ function filterOwnedJSDocTags(hostNode, comments) {
17781
+ const lastJsDoc = last(comments);
17782
+ return flatMap(comments, (jsDoc) => {
17783
+ if (jsDoc === lastJsDoc) {
17784
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
17785
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
17786
+ } else {
17787
+ return filter(jsDoc.tags, isJSDocOverloadTag);
17788
+ }
17789
+ });
17784
17790
  }
17785
17791
  function ownsJSDocTag(hostNode, tag) {
17786
17792
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -17819,6 +17825,9 @@ function getEffectiveContainerForJSDocTemplateTag(node) {
17819
17825
  }
17820
17826
  return getHostSignatureFromJSDoc(node);
17821
17827
  }
17828
+ function getJSDocOverloadTags(node) {
17829
+ return getAllJSDocTags(node, isJSDocOverloadTag);
17830
+ }
17822
17831
  function getHostSignatureFromJSDoc(node) {
17823
17832
  const host = getEffectiveJSDocHost(node);
17824
17833
  if (host) {
@@ -21746,6 +21755,10 @@ function hasResolutionModeOverride(node) {
21746
21755
  }
21747
21756
  return !!getResolutionModeOverride(node.attributes);
21748
21757
  }
21758
+ var stringReplace = String.prototype.replace;
21759
+ function replaceFirstStar(s, replacement) {
21760
+ return stringReplace.call(s, "*", replacement);
21761
+ }
21749
21762
 
21750
21763
  // src/compiler/factory/baseNodeFactory.ts
21751
21764
  function createBaseNodeFactory() {
@@ -32721,8 +32734,7 @@ var Parser;
32721
32734
  function parseJSDocFunctionType() {
32722
32735
  const pos = getNodePos();
32723
32736
  const hasJSDoc = hasPrecedingJSDocComment();
32724
- if (lookAhead(nextTokenIsOpenParen)) {
32725
- nextToken();
32737
+ if (tryParse(nextTokenIsOpenParen)) {
32726
32738
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
32727
32739
  const type = parseReturnType(
32728
32740
  59 /* ColonToken */,
@@ -43000,7 +43012,7 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
43000
43012
  /*excludes*/
43001
43013
  void 0,
43002
43014
  [
43003
- isDeclarationFileName(target) ? target.replace("*", "**/*") : changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))
43015
+ isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
43004
43016
  ]
43005
43017
  ).forEach((entry) => {
43006
43018
  entrypoints = appendIfUnique(entrypoints, {
@@ -43820,7 +43832,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
43820
43832
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
43821
43833
  }
43822
43834
  const resolved = forEach(paths[matchedPatternText], (subst) => {
43823
- const path = matchedStar ? subst.replace("*", matchedStar) : subst;
43835
+ const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
43824
43836
  const candidate = normalizePath(combinePaths(baseDirectory, path));
43825
43837
  if (state.traceEnabled) {
43826
43838
  trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
@@ -47520,7 +47532,7 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
47520
47532
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
47521
47533
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
47522
47534
  if (!pathIsRelative(matchedStar)) {
47523
- return key.replace("*", matchedStar);
47535
+ return replaceFirstStar(key, matchedStar);
47524
47536
  }
47525
47537
  }
47526
47538
  }
@@ -47568,11 +47580,11 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
47568
47580
  const trailingSlice = pathOrPattern.slice(starPos + 1);
47569
47581
  if (startsWith(targetFilePath, leadingSlice) && endsWith(targetFilePath, trailingSlice)) {
47570
47582
  const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
47571
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
47583
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
47572
47584
  }
47573
47585
  if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice) && endsWith(extensionSwappedTarget, trailingSlice)) {
47574
47586
  const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
47575
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
47587
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
47576
47588
  }
47577
47589
  break;
47578
47590
  }
@@ -60217,22 +60229,15 @@ function createTypeChecker(host) {
60217
60229
  }
60218
60230
  }
60219
60231
  if (isInJSFile(decl) && decl.jsDoc) {
60220
- let hasJSDocOverloads = false;
60221
- for (const node of decl.jsDoc) {
60222
- if (node.tags) {
60223
- for (const tag of node.tags) {
60224
- if (isJSDocOverloadTag(tag)) {
60225
- const jsDocSignature = tag.typeExpression;
60226
- if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
60227
- reportImplicitAny(jsDocSignature, anyType);
60228
- }
60229
- result.push(getSignatureFromDeclaration(jsDocSignature));
60230
- hasJSDocOverloads = true;
60231
- }
60232
+ const tags = getJSDocOverloadTags(decl);
60233
+ if (length(tags)) {
60234
+ for (const tag of tags) {
60235
+ const jsDocSignature = tag.typeExpression;
60236
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
60237
+ reportImplicitAny(jsDocSignature, anyType);
60232
60238
  }
60239
+ result.push(getSignatureFromDeclaration(jsDocSignature));
60233
60240
  }
60234
- }
60235
- if (hasJSDocOverloads) {
60236
60241
  continue;
60237
60242
  }
60238
60243
  }
@@ -77875,9 +77880,16 @@ function createTypeChecker(host) {
77875
77880
  const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
77876
77881
  for (let i = 0; i < len; i++) {
77877
77882
  const parameter = signature.parameters[i];
77878
- if (!getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) {
77879
- const contextualParameterType = tryGetTypeAtPosition(context, i);
77880
- assignParameterType(parameter, contextualParameterType);
77883
+ const declaration = parameter.valueDeclaration;
77884
+ if (!getEffectiveTypeAnnotationNode(declaration)) {
77885
+ let type = tryGetTypeAtPosition(context, i);
77886
+ if (type && declaration.initializer) {
77887
+ let initializerType = checkDeclarationInitializer(declaration, 0 /* Normal */);
77888
+ if (!isTypeAssignableTo(initializerType, type) && isTypeAssignableTo(type, initializerType = widenTypeInferredFromInitializer(declaration, initializerType))) {
77889
+ type = initializerType;
77890
+ }
77891
+ }
77892
+ assignParameterType(parameter, type);
77881
77893
  }
77882
77894
  }
77883
77895
  if (signatureHasRestParameter(signature)) {
@@ -81376,15 +81388,7 @@ function createTypeChecker(host) {
81376
81388
  }
81377
81389
  }
81378
81390
  if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
81379
- for (const node2 of current.jsDoc) {
81380
- if (node2.tags) {
81381
- for (const tag of node2.tags) {
81382
- if (isJSDocOverloadTag(tag)) {
81383
- hasOverloads = true;
81384
- }
81385
- }
81386
- }
81387
- }
81391
+ hasOverloads = length(getJSDocOverloadTags(current)) > 0;
81388
81392
  }
81389
81393
  }
81390
81394
  }
@@ -84774,7 +84778,7 @@ function createTypeChecker(host) {
84774
84778
  error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
84775
84779
  } else {
84776
84780
  const text = getTextOfPropertyName(member.name);
84777
- if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
84781
+ if (isNumericLiteralName(text)) {
84778
84782
  error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
84779
84783
  }
84780
84784
  }
@@ -133958,7 +133962,7 @@ function getContextualTypeFromParent(node, checker, contextFlags) {
133958
133962
  function quote(sourceFile, preferences, text) {
133959
133963
  const quotePreference = getQuotePreference(sourceFile, preferences);
133960
133964
  const quoted = JSON.stringify(text);
133961
- return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"')}'` : quoted;
133965
+ return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, () => "\\'").replace(/\\"/g, '"')}'` : quoted;
133962
133966
  }
133963
133967
  function isEqualityOperatorKind(kind) {
133964
133968
  switch (kind) {
@@ -173939,6 +173943,7 @@ __export(ts_exports2, {
173939
173943
  getJSDocEnumTag: () => getJSDocEnumTag,
173940
173944
  getJSDocHost: () => getJSDocHost,
173941
173945
  getJSDocImplementsTags: () => getJSDocImplementsTags,
173946
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
173942
173947
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
173943
173948
  getJSDocParameterTags: () => getJSDocParameterTags,
173944
173949
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -175169,6 +175174,7 @@ __export(ts_exports2, {
175169
175174
  removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
175170
175175
  repeatString: () => repeatString,
175171
175176
  replaceElement: () => replaceElement,
175177
+ replaceFirstStar: () => replaceFirstStar,
175172
175178
  resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
175173
175179
  resolveConfigFileProjectName: () => resolveConfigFileProjectName,
175174
175180
  resolveJSModule: () => resolveJSModule,
@@ -188731,6 +188737,7 @@ start(initializeNodeSystem(), require("os").platform());
188731
188737
  getJSDocEnumTag,
188732
188738
  getJSDocHost,
188733
188739
  getJSDocImplementsTags,
188740
+ getJSDocOverloadTags,
188734
188741
  getJSDocOverrideTagNoCache,
188735
188742
  getJSDocParameterTags,
188736
188743
  getJSDocParameterTagsNoCache,
@@ -189961,6 +189968,7 @@ start(initializeNodeSystem(), require("os").platform());
189961
189968
  removeTrailingDirectorySeparator,
189962
189969
  repeatString,
189963
189970
  replaceElement,
189971
+ replaceFirstStar,
189964
189972
  resolutionExtensionIsTSOrJson,
189965
189973
  resolveConfigFileProjectName,
189966
189974
  resolveJSModule,
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.4";
38
- version = `${versionMajorMinor}.0-dev.20231205`;
38
+ version = `${versionMajorMinor}.0-dev.20231207`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -15135,12 +15135,12 @@ ${lanes.join("\n")}
15135
15135
  function getJSDocCommentsAndTags(hostNode, noCache) {
15136
15136
  let result;
15137
15137
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
15138
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
15138
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
15139
15139
  }
15140
15140
  let node = hostNode;
15141
15141
  while (node && node.parent) {
15142
15142
  if (hasJSDocNodes(node)) {
15143
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
15143
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
15144
15144
  }
15145
15145
  if (node.kind === 169 /* Parameter */) {
15146
15146
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -15154,12 +15154,16 @@ ${lanes.join("\n")}
15154
15154
  }
15155
15155
  return result || emptyArray;
15156
15156
  }
15157
- function filterOwnedJSDocTags(hostNode, jsDoc) {
15158
- if (isJSDoc(jsDoc)) {
15159
- const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
15160
- return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
15161
- }
15162
- return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
15157
+ function filterOwnedJSDocTags(hostNode, comments) {
15158
+ const lastJsDoc = last(comments);
15159
+ return flatMap(comments, (jsDoc) => {
15160
+ if (jsDoc === lastJsDoc) {
15161
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
15162
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
15163
+ } else {
15164
+ return filter(jsDoc.tags, isJSDocOverloadTag);
15165
+ }
15166
+ });
15163
15167
  }
15164
15168
  function ownsJSDocTag(hostNode, tag) {
15165
15169
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -15198,6 +15202,9 @@ ${lanes.join("\n")}
15198
15202
  }
15199
15203
  return getHostSignatureFromJSDoc(node);
15200
15204
  }
15205
+ function getJSDocOverloadTags(node) {
15206
+ return getAllJSDocTags(node, isJSDocOverloadTag);
15207
+ }
15201
15208
  function getHostSignatureFromJSDoc(node) {
15202
15209
  const host = getEffectiveJSDocHost(node);
15203
15210
  if (host) {
@@ -18969,7 +18976,10 @@ ${lanes.join("\n")}
18969
18976
  }
18970
18977
  return !!getResolutionModeOverride(node.attributes);
18971
18978
  }
18972
- var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
18979
+ function replaceFirstStar(s, replacement) {
18980
+ return stringReplace.call(s, "*", replacement);
18981
+ }
18982
+ var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries, stringReplace;
18973
18983
  var init_utilities = __esm({
18974
18984
  "src/compiler/utilities.ts"() {
18975
18985
  "use strict";
@@ -19544,6 +19554,7 @@ ${lanes.join("\n")}
19544
19554
  files: emptyArray,
19545
19555
  directories: emptyArray
19546
19556
  };
19557
+ stringReplace = String.prototype.replace;
19547
19558
  }
19548
19559
  });
19549
19560
 
@@ -30789,8 +30800,7 @@ ${lanes.join("\n")}
30789
30800
  function parseJSDocFunctionType() {
30790
30801
  const pos = getNodePos();
30791
30802
  const hasJSDoc = hasPrecedingJSDocComment();
30792
- if (lookAhead(nextTokenIsOpenParen)) {
30793
- nextToken();
30803
+ if (tryParse(nextTokenIsOpenParen)) {
30794
30804
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
30795
30805
  const type = parseReturnType(
30796
30806
  59 /* ColonToken */,
@@ -40840,7 +40850,7 @@ ${lanes.join("\n")}
40840
40850
  /*excludes*/
40841
40851
  void 0,
40842
40852
  [
40843
- isDeclarationFileName(target) ? target.replace("*", "**/*") : changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))
40853
+ isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
40844
40854
  ]
40845
40855
  ).forEach((entry) => {
40846
40856
  entrypoints = appendIfUnique(entrypoints, {
@@ -41660,7 +41670,7 @@ ${lanes.join("\n")}
41660
41670
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
41661
41671
  }
41662
41672
  const resolved = forEach(paths[matchedPatternText], (subst) => {
41663
- const path = matchedStar ? subst.replace("*", matchedStar) : subst;
41673
+ const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
41664
41674
  const candidate = normalizePath(combinePaths(baseDirectory, path));
41665
41675
  if (state.traceEnabled) {
41666
41676
  trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
@@ -45381,7 +45391,7 @@ ${lanes.join("\n")}
45381
45391
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
45382
45392
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
45383
45393
  if (!pathIsRelative(matchedStar)) {
45384
- return key.replace("*", matchedStar);
45394
+ return replaceFirstStar(key, matchedStar);
45385
45395
  }
45386
45396
  }
45387
45397
  }
@@ -45429,11 +45439,11 @@ ${lanes.join("\n")}
45429
45439
  const trailingSlice = pathOrPattern.slice(starPos + 1);
45430
45440
  if (startsWith(targetFilePath, leadingSlice) && endsWith(targetFilePath, trailingSlice)) {
45431
45441
  const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
45432
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
45442
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
45433
45443
  }
45434
45444
  if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice) && endsWith(extensionSwappedTarget, trailingSlice)) {
45435
45445
  const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
45436
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
45446
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
45437
45447
  }
45438
45448
  break;
45439
45449
  }
@@ -57980,22 +57990,15 @@ ${lanes.join("\n")}
57980
57990
  }
57981
57991
  }
57982
57992
  if (isInJSFile(decl) && decl.jsDoc) {
57983
- let hasJSDocOverloads = false;
57984
- for (const node of decl.jsDoc) {
57985
- if (node.tags) {
57986
- for (const tag of node.tags) {
57987
- if (isJSDocOverloadTag(tag)) {
57988
- const jsDocSignature = tag.typeExpression;
57989
- if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
57990
- reportImplicitAny(jsDocSignature, anyType);
57991
- }
57992
- result.push(getSignatureFromDeclaration(jsDocSignature));
57993
- hasJSDocOverloads = true;
57994
- }
57993
+ const tags = getJSDocOverloadTags(decl);
57994
+ if (length(tags)) {
57995
+ for (const tag of tags) {
57996
+ const jsDocSignature = tag.typeExpression;
57997
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
57998
+ reportImplicitAny(jsDocSignature, anyType);
57995
57999
  }
58000
+ result.push(getSignatureFromDeclaration(jsDocSignature));
57996
58001
  }
57997
- }
57998
- if (hasJSDocOverloads) {
57999
58002
  continue;
58000
58003
  }
58001
58004
  }
@@ -75638,9 +75641,16 @@ ${lanes.join("\n")}
75638
75641
  const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
75639
75642
  for (let i = 0; i < len; i++) {
75640
75643
  const parameter = signature.parameters[i];
75641
- if (!getEffectiveTypeAnnotationNode(parameter.valueDeclaration)) {
75642
- const contextualParameterType = tryGetTypeAtPosition(context, i);
75643
- assignParameterType(parameter, contextualParameterType);
75644
+ const declaration = parameter.valueDeclaration;
75645
+ if (!getEffectiveTypeAnnotationNode(declaration)) {
75646
+ let type = tryGetTypeAtPosition(context, i);
75647
+ if (type && declaration.initializer) {
75648
+ let initializerType = checkDeclarationInitializer(declaration, 0 /* Normal */);
75649
+ if (!isTypeAssignableTo(initializerType, type) && isTypeAssignableTo(type, initializerType = widenTypeInferredFromInitializer(declaration, initializerType))) {
75650
+ type = initializerType;
75651
+ }
75652
+ }
75653
+ assignParameterType(parameter, type);
75644
75654
  }
75645
75655
  }
75646
75656
  if (signatureHasRestParameter(signature)) {
@@ -79139,15 +79149,7 @@ ${lanes.join("\n")}
79139
79149
  }
79140
79150
  }
79141
79151
  if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
79142
- for (const node2 of current.jsDoc) {
79143
- if (node2.tags) {
79144
- for (const tag of node2.tags) {
79145
- if (isJSDocOverloadTag(tag)) {
79146
- hasOverloads = true;
79147
- }
79148
- }
79149
- }
79150
- }
79152
+ hasOverloads = length(getJSDocOverloadTags(current)) > 0;
79151
79153
  }
79152
79154
  }
79153
79155
  }
@@ -82537,7 +82539,7 @@ ${lanes.join("\n")}
82537
82539
  error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
82538
82540
  } else {
82539
82541
  const text = getTextOfPropertyName(member.name);
82540
- if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
82542
+ if (isNumericLiteralName(text)) {
82541
82543
  error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
82542
82544
  }
82543
82545
  }
@@ -132219,7 +132221,7 @@ ${lanes.join("\n")}
132219
132221
  function quote(sourceFile, preferences, text) {
132220
132222
  const quotePreference = getQuotePreference(sourceFile, preferences);
132221
132223
  const quoted = JSON.stringify(text);
132222
- return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"')}'` : quoted;
132224
+ return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, () => "\\'").replace(/\\"/g, '"')}'` : quoted;
132223
132225
  }
132224
132226
  function isEqualityOperatorKind(kind) {
132225
132227
  switch (kind) {
@@ -185497,6 +185499,7 @@ ${e.message}`;
185497
185499
  getJSDocEnumTag: () => getJSDocEnumTag,
185498
185500
  getJSDocHost: () => getJSDocHost,
185499
185501
  getJSDocImplementsTags: () => getJSDocImplementsTags,
185502
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
185500
185503
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
185501
185504
  getJSDocParameterTags: () => getJSDocParameterTags,
185502
185505
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -186727,6 +186730,7 @@ ${e.message}`;
186727
186730
  removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
186728
186731
  repeatString: () => repeatString,
186729
186732
  replaceElement: () => replaceElement,
186733
+ replaceFirstStar: () => replaceFirstStar,
186730
186734
  resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
186731
186735
  resolveConfigFileProjectName: () => resolveConfigFileProjectName,
186732
186736
  resolveJSModule: () => resolveJSModule,
@@ -187910,6 +187914,7 @@ ${e.message}`;
187910
187914
  getJSDocEnumTag: () => getJSDocEnumTag,
187911
187915
  getJSDocHost: () => getJSDocHost,
187912
187916
  getJSDocImplementsTags: () => getJSDocImplementsTags,
187917
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
187913
187918
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
187914
187919
  getJSDocParameterTags: () => getJSDocParameterTags,
187915
187920
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -189140,6 +189145,7 @@ ${e.message}`;
189140
189145
  removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
189141
189146
  repeatString: () => repeatString,
189142
189147
  replaceElement: () => replaceElement,
189148
+ replaceFirstStar: () => replaceFirstStar,
189143
189149
  resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
189144
189150
  resolveConfigFileProjectName: () => resolveConfigFileProjectName,
189145
189151
  resolveJSModule: () => resolveJSModule,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-dev.20231205`;
57
+ var version = `${versionMajorMinor}.0-dev.20231207`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -10581,12 +10581,12 @@ function canHaveJSDoc(node) {
10581
10581
  function getJSDocCommentsAndTags(hostNode, noCache) {
10582
10582
  let result;
10583
10583
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
10584
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
10584
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
10585
10585
  }
10586
10586
  let node = hostNode;
10587
10587
  while (node && node.parent) {
10588
10588
  if (hasJSDocNodes(node)) {
10589
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
10589
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
10590
10590
  }
10591
10591
  if (node.kind === 169 /* Parameter */) {
10592
10592
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -10600,12 +10600,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
10600
10600
  }
10601
10601
  return result || emptyArray;
10602
10602
  }
10603
- function filterOwnedJSDocTags(hostNode, jsDoc) {
10604
- if (isJSDoc(jsDoc)) {
10605
- const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
10606
- return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
10607
- }
10608
- return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
10603
+ function filterOwnedJSDocTags(hostNode, comments) {
10604
+ const lastJsDoc = last(comments);
10605
+ return flatMap(comments, (jsDoc) => {
10606
+ if (jsDoc === lastJsDoc) {
10607
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
10608
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
10609
+ } else {
10610
+ return filter(jsDoc.tags, isJSDocOverloadTag);
10611
+ }
10612
+ });
10609
10613
  }
10610
10614
  function ownsJSDocTag(hostNode, tag) {
10611
10615
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -11744,6 +11748,10 @@ function getEscapedTextOfJsxNamespacedName(node) {
11744
11748
  function getTextOfJsxNamespacedName(node) {
11745
11749
  return `${idText(node.namespace)}:${idText(node.name)}`;
11746
11750
  }
11751
+ var stringReplace = String.prototype.replace;
11752
+ function replaceFirstStar(s, replacement) {
11753
+ return stringReplace.call(s, "*", replacement);
11754
+ }
11747
11755
 
11748
11756
  // src/compiler/factory/baseNodeFactory.ts
11749
11757
  function createBaseNodeFactory() {
@@ -17340,6 +17348,9 @@ function isJSDocReadonlyTag(node) {
17340
17348
  function isJSDocOverrideTag(node) {
17341
17349
  return node.kind === 344 /* JSDocOverrideTag */;
17342
17350
  }
17351
+ function isJSDocOverloadTag(node) {
17352
+ return node.kind === 346 /* JSDocOverloadTag */;
17353
+ }
17343
17354
  function isJSDocDeprecatedTag(node) {
17344
17355
  return node.kind === 338 /* JSDocDeprecatedTag */;
17345
17356
  }
@@ -20108,8 +20119,7 @@ var Parser;
20108
20119
  function parseJSDocFunctionType() {
20109
20120
  const pos = getNodePos();
20110
20121
  const hasJSDoc = hasPrecedingJSDocComment();
20111
- if (lookAhead(nextTokenIsOpenParen)) {
20112
- nextToken();
20122
+ if (tryParse(nextTokenIsOpenParen)) {
20113
20123
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
20114
20124
  const type = parseReturnType(
20115
20125
  59 /* ColonToken */,
@@ -29000,7 +29010,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
29000
29010
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
29001
29011
  }
29002
29012
  const resolved = forEach(paths[matchedPatternText], (subst) => {
29003
- const path2 = matchedStar ? subst.replace("*", matchedStar) : subst;
29013
+ const path2 = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
29004
29014
  const candidate = normalizePath(combinePaths(baseDirectory, path2));
29005
29015
  if (state.traceEnabled) {
29006
29016
  trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path2);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.4.0-dev.20231205",
5
+ "version": "5.4.0-dev.20231207",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "6c0687e493e23bfd054bf9ae1fc37a7cb75229ad"
117
+ "gitHead": "20c0f4052681cdbdba3357a50822915b6ef4c3d6"
118
118
  }