@typescript-deploys/pr-build 5.4.0-pr-56506-20 → 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 = [];
@@ -16061,7 +16061,6 @@ function Symbol4(flags, name) {
16061
16061
  this.exportSymbol = void 0;
16062
16062
  this.constEnumOnlyModule = void 0;
16063
16063
  this.isReferenced = void 0;
16064
- this.isAssigned = void 0;
16065
16064
  this.links = void 0;
16066
16065
  }
16067
16066
  function Type3(checker, flags) {
@@ -17526,6 +17525,10 @@ function hasResolutionModeOverride(node) {
17526
17525
  }
17527
17526
  return !!getResolutionModeOverride(node.attributes);
17528
17527
  }
17528
+ var stringReplace = String.prototype.replace;
17529
+ function replaceFirstStar(s, replacement) {
17530
+ return stringReplace.call(s, "*", replacement);
17531
+ }
17529
17532
 
17530
17533
  // src/compiler/factory/baseNodeFactory.ts
17531
17534
  function createBaseNodeFactory() {
@@ -39156,7 +39159,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
39156
39159
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
39157
39160
  }
39158
39161
  const resolved = forEach(paths[matchedPatternText], (subst) => {
39159
- const path = matchedStar ? subst.replace("*", matchedStar) : subst;
39162
+ const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
39160
39163
  const candidate = normalizePath(combinePaths(baseDirectory, path));
39161
39164
  if (state.traceEnabled) {
39162
39165
  trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
@@ -42793,7 +42796,7 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
42793
42796
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
42794
42797
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
42795
42798
  if (!pathIsRelative(matchedStar)) {
42796
- return key.replace("*", matchedStar);
42799
+ return replaceFirstStar(key, matchedStar);
42797
42800
  }
42798
42801
  }
42799
42802
  }
@@ -42841,11 +42844,11 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
42841
42844
  const trailingSlice = pathOrPattern.slice(starPos + 1);
42842
42845
  if (startsWith(targetFilePath, leadingSlice) && endsWith(targetFilePath, trailingSlice)) {
42843
42846
  const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
42844
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
42847
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
42845
42848
  }
42846
42849
  if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice) && endsWith(extensionSwappedTarget, trailingSlice)) {
42847
42850
  const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
42848
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
42851
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
42849
42852
  }
42850
42853
  break;
42851
42854
  }
@@ -65830,7 +65833,7 @@ function createTypeChecker(host) {
65830
65833
  case 80 /* Identifier */:
65831
65834
  if (!isThisInTypeQuery(node)) {
65832
65835
  const symbol = getResolvedSymbol(node);
65833
- return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
65836
+ return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSomeSymbolAssigned(getRootDeclaration(symbol.valueDeclaration));
65834
65837
  }
65835
65838
  break;
65836
65839
  case 211 /* PropertyAccessExpression */:
@@ -66919,11 +66922,8 @@ function createTypeChecker(host) {
66919
66922
  function getControlFlowContainer(node) {
66920
66923
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
66921
66924
  }
66922
- function isSymbolAssigned(symbol) {
66923
- if (!symbol.valueDeclaration) {
66924
- return false;
66925
- }
66926
- const parent = getRootDeclaration(symbol.valueDeclaration).parent;
66925
+ function isSomeSymbolAssigned(rootDeclaration) {
66926
+ const parent = rootDeclaration.parent;
66927
66927
  const links = getNodeLinks(parent);
66928
66928
  if (!(links.flags & 131072 /* AssignmentsMarked */)) {
66929
66929
  links.flags |= 131072 /* AssignmentsMarked */;
@@ -66931,7 +66931,7 @@ function createTypeChecker(host) {
66931
66931
  markNodeAssignments(parent);
66932
66932
  }
66933
66933
  }
66934
- return symbol.isAssigned || false;
66934
+ return getNodeLinks(rootDeclaration).someSymbolAssigned;
66935
66935
  }
66936
66936
  function hasParentWithAssignmentsMarked(node) {
66937
66937
  return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
@@ -66941,11 +66941,11 @@ function createTypeChecker(host) {
66941
66941
  if (isAssignmentTarget(node)) {
66942
66942
  const symbol = getResolvedSymbol(node);
66943
66943
  if (isParameterOrCatchClauseVariable(symbol)) {
66944
- symbol.isAssigned = true;
66944
+ return getNodeLinks(getRootDeclaration(symbol.valueDeclaration)).someSymbolAssigned = true;
66945
66945
  }
66946
66946
  }
66947
66947
  } else {
66948
- forEachChild(node, markNodeAssignments);
66948
+ return forEachChild(node, markNodeAssignments);
66949
66949
  }
66950
66950
  }
66951
66951
  function isConstantVariable(symbol) {
@@ -67046,7 +67046,7 @@ function createTypeChecker(host) {
67046
67046
  const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
67047
67047
  const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
67048
67048
  links.flags &= ~4194304 /* InCheckIdentifier */;
67049
- 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))) {
67050
67050
  const pattern = declaration.parent;
67051
67051
  const narrowedType = getFlowTypeOfReference(
67052
67052
  pattern,
@@ -67075,7 +67075,7 @@ function createTypeChecker(host) {
67075
67075
  const contextualSignature = getContextualSignature(func);
67076
67076
  if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
67077
67077
  const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
67078
- if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
67078
+ if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSomeSymbolAssigned(declaration)) {
67079
67079
  const narrowedType = getFlowTypeOfReference(
67080
67080
  func,
67081
67081
  restType,
@@ -67191,7 +67191,8 @@ function createTypeChecker(host) {
67191
67191
  return type;
67192
67192
  }
67193
67193
  type = getNarrowableTypeForReference(type, node, checkMode);
67194
- const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
67194
+ const rootDeclaration = getRootDeclaration(declaration);
67195
+ const isParameter2 = rootDeclaration.kind === 169 /* Parameter */;
67195
67196
  const declarationContainer = getControlFlowContainer(declaration);
67196
67197
  let flowContainer = getControlFlowContainer(node);
67197
67198
  const isOuterVariable = flowContainer !== declarationContainer;
@@ -67199,7 +67200,7 @@ function createTypeChecker(host) {
67199
67200
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
67200
67201
  const typeIsAutomatic = type === autoType || type === autoArrayType;
67201
67202
  const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
67202
- 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))) {
67203
67204
  flowContainer = getControlFlowContainer(flowContainer);
67204
67205
  }
67205
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 */;
package/lib/tsserver.js CHANGED
@@ -2052,6 +2052,7 @@ __export(server_exports, {
2052
2052
  removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
2053
2053
  repeatString: () => repeatString,
2054
2054
  replaceElement: () => replaceElement,
2055
+ replaceFirstStar: () => replaceFirstStar,
2055
2056
  resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
2056
2057
  resolveConfigFileProjectName: () => resolveConfigFileProjectName,
2057
2058
  resolveJSModule: () => resolveJSModule,
@@ -2332,7 +2333,7 @@ module.exports = __toCommonJS(server_exports);
2332
2333
 
2333
2334
  // src/compiler/corePublic.ts
2334
2335
  var versionMajorMinor = "5.4";
2335
- var version = `${versionMajorMinor}.0-insiders.20231205`;
2336
+ var version = `${versionMajorMinor}.0-insiders.20231206`;
2336
2337
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2337
2338
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2338
2339
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -20204,7 +20205,6 @@ function Symbol4(flags, name) {
20204
20205
  this.exportSymbol = void 0;
20205
20206
  this.constEnumOnlyModule = void 0;
20206
20207
  this.isReferenced = void 0;
20207
- this.isAssigned = void 0;
20208
20208
  this.links = void 0;
20209
20209
  }
20210
20210
  function Type3(checker, flags) {
@@ -21746,6 +21746,10 @@ function hasResolutionModeOverride(node) {
21746
21746
  }
21747
21747
  return !!getResolutionModeOverride(node.attributes);
21748
21748
  }
21749
+ var stringReplace = String.prototype.replace;
21750
+ function replaceFirstStar(s, replacement) {
21751
+ return stringReplace.call(s, "*", replacement);
21752
+ }
21749
21753
 
21750
21754
  // src/compiler/factory/baseNodeFactory.ts
21751
21755
  function createBaseNodeFactory() {
@@ -43000,7 +43004,7 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
43000
43004
  /*excludes*/
43001
43005
  void 0,
43002
43006
  [
43003
- isDeclarationFileName(target) ? target.replace("*", "**/*") : changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))
43007
+ isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
43004
43008
  ]
43005
43009
  ).forEach((entry) => {
43006
43010
  entrypoints = appendIfUnique(entrypoints, {
@@ -43820,7 +43824,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
43820
43824
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
43821
43825
  }
43822
43826
  const resolved = forEach(paths[matchedPatternText], (subst) => {
43823
- const path = matchedStar ? subst.replace("*", matchedStar) : subst;
43827
+ const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
43824
43828
  const candidate = normalizePath(combinePaths(baseDirectory, path));
43825
43829
  if (state.traceEnabled) {
43826
43830
  trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
@@ -47520,7 +47524,7 @@ function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, hos
47520
47524
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
47521
47525
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
47522
47526
  if (!pathIsRelative(matchedStar)) {
47523
- return key.replace("*", matchedStar);
47527
+ return replaceFirstStar(key, matchedStar);
47524
47528
  }
47525
47529
  }
47526
47530
  }
@@ -47568,11 +47572,11 @@ function tryGetModuleNameFromExports(options, targetFilePath, packageDirectory,
47568
47572
  const trailingSlice = pathOrPattern.slice(starPos + 1);
47569
47573
  if (startsWith(targetFilePath, leadingSlice) && endsWith(targetFilePath, trailingSlice)) {
47570
47574
  const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
47571
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
47575
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
47572
47576
  }
47573
47577
  if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice) && endsWith(extensionSwappedTarget, trailingSlice)) {
47574
47578
  const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
47575
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
47579
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
47576
47580
  }
47577
47581
  break;
47578
47582
  }
@@ -70557,7 +70561,7 @@ function createTypeChecker(host) {
70557
70561
  case 80 /* Identifier */:
70558
70562
  if (!isThisInTypeQuery(node)) {
70559
70563
  const symbol = getResolvedSymbol(node);
70560
- return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
70564
+ return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSomeSymbolAssigned(getRootDeclaration(symbol.valueDeclaration));
70561
70565
  }
70562
70566
  break;
70563
70567
  case 211 /* PropertyAccessExpression */:
@@ -71646,11 +71650,8 @@ function createTypeChecker(host) {
71646
71650
  function getControlFlowContainer(node) {
71647
71651
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
71648
71652
  }
71649
- function isSymbolAssigned(symbol) {
71650
- if (!symbol.valueDeclaration) {
71651
- return false;
71652
- }
71653
- const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
71653
+ function isSomeSymbolAssigned(rootDeclaration) {
71654
+ const parent2 = rootDeclaration.parent;
71654
71655
  const links = getNodeLinks(parent2);
71655
71656
  if (!(links.flags & 131072 /* AssignmentsMarked */)) {
71656
71657
  links.flags |= 131072 /* AssignmentsMarked */;
@@ -71658,7 +71659,7 @@ function createTypeChecker(host) {
71658
71659
  markNodeAssignments(parent2);
71659
71660
  }
71660
71661
  }
71661
- return symbol.isAssigned || false;
71662
+ return getNodeLinks(rootDeclaration).someSymbolAssigned;
71662
71663
  }
71663
71664
  function hasParentWithAssignmentsMarked(node) {
71664
71665
  return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
@@ -71668,11 +71669,11 @@ function createTypeChecker(host) {
71668
71669
  if (isAssignmentTarget(node)) {
71669
71670
  const symbol = getResolvedSymbol(node);
71670
71671
  if (isParameterOrCatchClauseVariable(symbol)) {
71671
- symbol.isAssigned = true;
71672
+ return getNodeLinks(getRootDeclaration(symbol.valueDeclaration)).someSymbolAssigned = true;
71672
71673
  }
71673
71674
  }
71674
71675
  } else {
71675
- forEachChild(node, markNodeAssignments);
71676
+ return forEachChild(node, markNodeAssignments);
71676
71677
  }
71677
71678
  }
71678
71679
  function isConstantVariable(symbol) {
@@ -71773,7 +71774,7 @@ function createTypeChecker(host) {
71773
71774
  const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
71774
71775
  const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
71775
71776
  links.flags &= ~4194304 /* InCheckIdentifier */;
71776
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
71777
+ if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
71777
71778
  const pattern = declaration.parent;
71778
71779
  const narrowedType = getFlowTypeOfReference(
71779
71780
  pattern,
@@ -71802,7 +71803,7 @@ function createTypeChecker(host) {
71802
71803
  const contextualSignature = getContextualSignature(func);
71803
71804
  if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
71804
71805
  const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
71805
- if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
71806
+ if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSomeSymbolAssigned(declaration)) {
71806
71807
  const narrowedType = getFlowTypeOfReference(
71807
71808
  func,
71808
71809
  restType,
@@ -71918,7 +71919,8 @@ function createTypeChecker(host) {
71918
71919
  return type;
71919
71920
  }
71920
71921
  type = getNarrowableTypeForReference(type, node, checkMode);
71921
- const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
71922
+ const rootDeclaration = getRootDeclaration(declaration);
71923
+ const isParameter2 = rootDeclaration.kind === 169 /* Parameter */;
71922
71924
  const declarationContainer = getControlFlowContainer(declaration);
71923
71925
  let flowContainer = getControlFlowContainer(node);
71924
71926
  const isOuterVariable = flowContainer !== declarationContainer;
@@ -71926,7 +71928,7 @@ function createTypeChecker(host) {
71926
71928
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
71927
71929
  const typeIsAutomatic = type === autoType || type === autoArrayType;
71928
71930
  const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
71929
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
71931
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSomeSymbolAssigned(rootDeclaration))) {
71930
71932
  flowContainer = getControlFlowContainer(flowContainer);
71931
71933
  }
71932
71934
  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 */;
@@ -133965,7 +133967,7 @@ function getContextualTypeFromParent(node, checker, contextFlags) {
133965
133967
  function quote(sourceFile, preferences, text) {
133966
133968
  const quotePreference = getQuotePreference(sourceFile, preferences);
133967
133969
  const quoted = JSON.stringify(text);
133968
- return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"')}'` : quoted;
133970
+ return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, () => "\\'").replace(/\\"/g, '"')}'` : quoted;
133969
133971
  }
133970
133972
  function isEqualityOperatorKind(kind) {
133971
133973
  switch (kind) {
@@ -175176,6 +175178,7 @@ __export(ts_exports2, {
175176
175178
  removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
175177
175179
  repeatString: () => repeatString,
175178
175180
  replaceElement: () => replaceElement,
175181
+ replaceFirstStar: () => replaceFirstStar,
175179
175182
  resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
175180
175183
  resolveConfigFileProjectName: () => resolveConfigFileProjectName,
175181
175184
  resolveJSModule: () => resolveJSModule,
@@ -189968,6 +189971,7 @@ start(initializeNodeSystem(), require("os").platform());
189968
189971
  removeTrailingDirectorySeparator,
189969
189972
  repeatString,
189970
189973
  replaceElement,
189974
+ replaceFirstStar,
189971
189975
  resolutionExtensionIsTSOrJson,
189972
189976
  resolveConfigFileProjectName,
189973
189977
  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-insiders.20231205`;
38
+ version = `${versionMajorMinor}.0-insiders.20231206`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -17501,7 +17501,6 @@ ${lanes.join("\n")}
17501
17501
  this.exportSymbol = void 0;
17502
17502
  this.constEnumOnlyModule = void 0;
17503
17503
  this.isReferenced = void 0;
17504
- this.isAssigned = void 0;
17505
17504
  this.links = void 0;
17506
17505
  }
17507
17506
  function Type3(checker, flags) {
@@ -18969,7 +18968,10 @@ ${lanes.join("\n")}
18969
18968
  }
18970
18969
  return !!getResolutionModeOverride(node.attributes);
18971
18970
  }
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;
18971
+ function replaceFirstStar(s, replacement) {
18972
+ return stringReplace.call(s, "*", replacement);
18973
+ }
18974
+ 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
18975
  var init_utilities = __esm({
18974
18976
  "src/compiler/utilities.ts"() {
18975
18977
  "use strict";
@@ -19544,6 +19546,7 @@ ${lanes.join("\n")}
19544
19546
  files: emptyArray,
19545
19547
  directories: emptyArray
19546
19548
  };
19549
+ stringReplace = String.prototype.replace;
19547
19550
  }
19548
19551
  });
19549
19552
 
@@ -40840,7 +40843,7 @@ ${lanes.join("\n")}
40840
40843
  /*excludes*/
40841
40844
  void 0,
40842
40845
  [
40843
- isDeclarationFileName(target) ? target.replace("*", "**/*") : changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))
40846
+ isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
40844
40847
  ]
40845
40848
  ).forEach((entry) => {
40846
40849
  entrypoints = appendIfUnique(entrypoints, {
@@ -41660,7 +41663,7 @@ ${lanes.join("\n")}
41660
41663
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
41661
41664
  }
41662
41665
  const resolved = forEach(paths[matchedPatternText], (subst) => {
41663
- const path = matchedStar ? subst.replace("*", matchedStar) : subst;
41666
+ const path = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
41664
41667
  const candidate = normalizePath(combinePaths(baseDirectory, path));
41665
41668
  if (state.traceEnabled) {
41666
41669
  trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path);
@@ -45381,7 +45384,7 @@ ${lanes.join("\n")}
45381
45384
  if (value.length >= prefix.length + suffix.length && startsWith(value, prefix) && endsWith(value, suffix) && validateEnding({ ending, value })) {
45382
45385
  const matchedStar = value.substring(prefix.length, value.length - suffix.length);
45383
45386
  if (!pathIsRelative(matchedStar)) {
45384
- return key.replace("*", matchedStar);
45387
+ return replaceFirstStar(key, matchedStar);
45385
45388
  }
45386
45389
  }
45387
45390
  }
@@ -45429,11 +45432,11 @@ ${lanes.join("\n")}
45429
45432
  const trailingSlice = pathOrPattern.slice(starPos + 1);
45430
45433
  if (startsWith(targetFilePath, leadingSlice) && endsWith(targetFilePath, trailingSlice)) {
45431
45434
  const starReplacement = targetFilePath.slice(leadingSlice.length, targetFilePath.length - trailingSlice.length);
45432
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
45435
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
45433
45436
  }
45434
45437
  if (extensionSwappedTarget && startsWith(extensionSwappedTarget, leadingSlice) && endsWith(extensionSwappedTarget, trailingSlice)) {
45435
45438
  const starReplacement = extensionSwappedTarget.slice(leadingSlice.length, extensionSwappedTarget.length - trailingSlice.length);
45436
- return { moduleFileToTry: packageName.replace("*", starReplacement) };
45439
+ return { moduleFileToTry: replaceFirstStar(packageName, starReplacement) };
45437
45440
  }
45438
45441
  break;
45439
45442
  }
@@ -68320,7 +68323,7 @@ ${lanes.join("\n")}
68320
68323
  case 80 /* Identifier */:
68321
68324
  if (!isThisInTypeQuery(node)) {
68322
68325
  const symbol = getResolvedSymbol(node);
68323
- return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
68326
+ return isConstantVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSomeSymbolAssigned(getRootDeclaration(symbol.valueDeclaration));
68324
68327
  }
68325
68328
  break;
68326
68329
  case 211 /* PropertyAccessExpression */:
@@ -69409,11 +69412,8 @@ ${lanes.join("\n")}
69409
69412
  function getControlFlowContainer(node) {
69410
69413
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
69411
69414
  }
69412
- function isSymbolAssigned(symbol) {
69413
- if (!symbol.valueDeclaration) {
69414
- return false;
69415
- }
69416
- const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
69415
+ function isSomeSymbolAssigned(rootDeclaration) {
69416
+ const parent2 = rootDeclaration.parent;
69417
69417
  const links = getNodeLinks(parent2);
69418
69418
  if (!(links.flags & 131072 /* AssignmentsMarked */)) {
69419
69419
  links.flags |= 131072 /* AssignmentsMarked */;
@@ -69421,7 +69421,7 @@ ${lanes.join("\n")}
69421
69421
  markNodeAssignments(parent2);
69422
69422
  }
69423
69423
  }
69424
- return symbol.isAssigned || false;
69424
+ return getNodeLinks(rootDeclaration).someSymbolAssigned;
69425
69425
  }
69426
69426
  function hasParentWithAssignmentsMarked(node) {
69427
69427
  return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
@@ -69431,11 +69431,11 @@ ${lanes.join("\n")}
69431
69431
  if (isAssignmentTarget(node)) {
69432
69432
  const symbol = getResolvedSymbol(node);
69433
69433
  if (isParameterOrCatchClauseVariable(symbol)) {
69434
- symbol.isAssigned = true;
69434
+ return getNodeLinks(getRootDeclaration(symbol.valueDeclaration)).someSymbolAssigned = true;
69435
69435
  }
69436
69436
  }
69437
69437
  } else {
69438
- forEachChild(node, markNodeAssignments);
69438
+ return forEachChild(node, markNodeAssignments);
69439
69439
  }
69440
69440
  }
69441
69441
  function isConstantVariable(symbol) {
@@ -69536,7 +69536,7 @@ ${lanes.join("\n")}
69536
69536
  const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
69537
69537
  const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
69538
69538
  links.flags &= ~4194304 /* InCheckIdentifier */;
69539
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
69539
+ if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 169 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
69540
69540
  const pattern = declaration.parent;
69541
69541
  const narrowedType = getFlowTypeOfReference(
69542
69542
  pattern,
@@ -69565,7 +69565,7 @@ ${lanes.join("\n")}
69565
69565
  const contextualSignature = getContextualSignature(func);
69566
69566
  if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
69567
69567
  const restType = getReducedApparentType(instantiateType(getTypeOfSymbol(contextualSignature.parameters[0]), (_a = getInferenceContext(func)) == null ? void 0 : _a.nonFixingMapper));
69568
- if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
69568
+ if (restType.flags & 1048576 /* Union */ && everyType(restType, isTupleType) && !isSomeSymbolAssigned(declaration)) {
69569
69569
  const narrowedType = getFlowTypeOfReference(
69570
69570
  func,
69571
69571
  restType,
@@ -69681,7 +69681,8 @@ ${lanes.join("\n")}
69681
69681
  return type;
69682
69682
  }
69683
69683
  type = getNarrowableTypeForReference(type, node, checkMode);
69684
- const isParameter2 = getRootDeclaration(declaration).kind === 169 /* Parameter */;
69684
+ const rootDeclaration = getRootDeclaration(declaration);
69685
+ const isParameter2 = rootDeclaration.kind === 169 /* Parameter */;
69685
69686
  const declarationContainer = getControlFlowContainer(declaration);
69686
69687
  let flowContainer = getControlFlowContainer(node);
69687
69688
  const isOuterVariable = flowContainer !== declarationContainer;
@@ -69689,7 +69690,7 @@ ${lanes.join("\n")}
69689
69690
  const isModuleExports = symbol.flags & 134217728 /* ModuleExports */;
69690
69691
  const typeIsAutomatic = type === autoType || type === autoArrayType;
69691
69692
  const isAutomaticTypeInNonNull = typeIsAutomatic && node.parent.kind === 235 /* NonNullExpression */;
69692
- while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSymbolAssigned(localOrExportSymbol))) {
69693
+ while (flowContainer !== declarationContainer && (flowContainer.kind === 218 /* FunctionExpression */ || flowContainer.kind === 219 /* ArrowFunction */ || isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) && (isConstantVariable(localOrExportSymbol) && type !== autoArrayType || isParameter2 && !isSomeSymbolAssigned(rootDeclaration))) {
69693
69694
  flowContainer = getControlFlowContainer(flowContainer);
69694
69695
  }
69695
69696
  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 */;
@@ -132226,7 +132227,7 @@ ${lanes.join("\n")}
132226
132227
  function quote(sourceFile, preferences, text) {
132227
132228
  const quotePreference = getQuotePreference(sourceFile, preferences);
132228
132229
  const quoted = JSON.stringify(text);
132229
- return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"')}'` : quoted;
132230
+ return quotePreference === 0 /* Single */ ? `'${stripQuotes(quoted).replace(/'/g, () => "\\'").replace(/\\"/g, '"')}'` : quoted;
132230
132231
  }
132231
132232
  function isEqualityOperatorKind(kind) {
132232
132233
  switch (kind) {
@@ -186734,6 +186735,7 @@ ${e.message}`;
186734
186735
  removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
186735
186736
  repeatString: () => repeatString,
186736
186737
  replaceElement: () => replaceElement,
186738
+ replaceFirstStar: () => replaceFirstStar,
186737
186739
  resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
186738
186740
  resolveConfigFileProjectName: () => resolveConfigFileProjectName,
186739
186741
  resolveJSModule: () => resolveJSModule,
@@ -189147,6 +189149,7 @@ ${e.message}`;
189147
189149
  removeTrailingDirectorySeparator: () => removeTrailingDirectorySeparator,
189148
189150
  repeatString: () => repeatString,
189149
189151
  replaceElement: () => replaceElement,
189152
+ replaceFirstStar: () => replaceFirstStar,
189150
189153
  resolutionExtensionIsTSOrJson: () => resolutionExtensionIsTSOrJson,
189151
189154
  resolveConfigFileProjectName: () => resolveConfigFileProjectName,
189152
189155
  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-insiders.20231205`;
57
+ var version = `${versionMajorMinor}.0-insiders.20231206`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -11119,7 +11119,6 @@ function Symbol4(flags, name) {
11119
11119
  this.exportSymbol = void 0;
11120
11120
  this.constEnumOnlyModule = void 0;
11121
11121
  this.isReferenced = void 0;
11122
- this.isAssigned = void 0;
11123
11122
  this.links = void 0;
11124
11123
  }
11125
11124
  function Type3(checker, flags) {
@@ -11744,6 +11743,10 @@ function getEscapedTextOfJsxNamespacedName(node) {
11744
11743
  function getTextOfJsxNamespacedName(node) {
11745
11744
  return `${idText(node.namespace)}:${idText(node.name)}`;
11746
11745
  }
11746
+ var stringReplace = String.prototype.replace;
11747
+ function replaceFirstStar(s, replacement) {
11748
+ return stringReplace.call(s, "*", replacement);
11749
+ }
11747
11750
 
11748
11751
  // src/compiler/factory/baseNodeFactory.ts
11749
11752
  function createBaseNodeFactory() {
@@ -29000,7 +29003,7 @@ function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, p
29000
29003
  trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText);
29001
29004
  }
29002
29005
  const resolved = forEach(paths[matchedPatternText], (subst) => {
29003
- const path2 = matchedStar ? subst.replace("*", matchedStar) : subst;
29006
+ const path2 = matchedStar ? replaceFirstStar(subst, matchedStar) : subst;
29004
29007
  const candidate = normalizePath(combinePaths(baseDirectory, path2));
29005
29008
  if (state.traceEnabled) {
29006
29009
  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-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.4.0-pr-56506-20",
5
+ "version": "5.4.0-pr-56313-12",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "b740dad4acd9ea1c57658474e00ea2b2495b7b5a"
118
+ "gitHead": "554d3cbbcae52969b8f41d473527c38b20935f28"
119
119
  }