@typescript-deploys/pr-build 6.0.0-pr-60121-19 → 6.0.0-pr-62350-6

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 = "6.0";
21
- var version = `${versionMajorMinor}.0-insiders.20250823`;
21
+ var version = `${versionMajorMinor}.0-insiders.20250903`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -14890,6 +14890,22 @@ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
14890
14890
  function isBindingElementOfBareOrAccessedRequire(node) {
14891
14891
  return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
14892
14892
  }
14893
+ function getModuleSpecifierOfBareOrAccessedRequire(node) {
14894
+ if (isVariableDeclarationInitializedToRequire(node)) {
14895
+ return node.initializer.arguments[0];
14896
+ }
14897
+ if (isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
14898
+ const leftmost = getLeftmostAccessExpression(node.initializer);
14899
+ if (isRequireCall(
14900
+ leftmost,
14901
+ /*requireStringLiteralLikeArgument*/
14902
+ true
14903
+ )) {
14904
+ return leftmost.arguments[0];
14905
+ }
14906
+ }
14907
+ return void 0;
14908
+ }
14893
14909
  function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
14894
14910
  return isVariableDeclaration(node) && !!node.initializer && isRequireCall(
14895
14911
  allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer,
@@ -17966,9 +17982,6 @@ var _computedOptions = createComputedCompilerOptions({
17966
17982
  let moduleResolution = compilerOptions.moduleResolution;
17967
17983
  if (moduleResolution === void 0) {
17968
17984
  switch (_computedOptions.module.computeValue(compilerOptions)) {
17969
- case 1 /* CommonJS */:
17970
- moduleResolution = 2 /* Node10 */;
17971
- break;
17972
17985
  case 100 /* Node16 */:
17973
17986
  case 101 /* Node18 */:
17974
17987
  case 102 /* Node20 */:
@@ -17977,6 +17990,7 @@ var _computedOptions = createComputedCompilerOptions({
17977
17990
  case 199 /* NodeNext */:
17978
17991
  moduleResolution = 99 /* NodeNext */;
17979
17992
  break;
17993
+ case 1 /* CommonJS */:
17980
17994
  case 200 /* Preserve */:
17981
17995
  moduleResolution = 100 /* Bundler */;
17982
17996
  break;
@@ -49409,11 +49423,7 @@ function createTypeChecker(host) {
49409
49423
  return ambientModule;
49410
49424
  }
49411
49425
  const currentSourceFile = getSourceFileOfNode(location);
49412
- const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
49413
- location.initializer,
49414
- /*requireStringLiteralLikeArgument*/
49415
- true
49416
- ) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
49426
+ const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || isVariableDeclarationInitializedToBareOrAccessedRequire(location) && getModuleSpecifierOfBareOrAccessedRequire(location) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
49417
49427
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
49418
49428
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
49419
49429
  const resolvedModule = (_f = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _f.resolvedModule;
@@ -55712,21 +55722,21 @@ function createTypeChecker(host) {
55712
55722
  function isErrorType(type) {
55713
55723
  return type === errorType || !!(type.flags & 1 /* Any */ && type.aliasSymbol);
55714
55724
  }
55715
- function getTypeForBindingElementParent(node, checkMode) {
55716
- if (checkMode !== 0 /* Normal */) {
55717
- return getTypeForVariableLikeDeclaration(
55718
- node,
55719
- /*includeOptionality*/
55720
- false,
55721
- checkMode
55722
- );
55725
+ function getTypeForBindingElementParent(node) {
55726
+ const grandparent = node.parent.parent;
55727
+ const rootParameter = tryGetRootParameterDeclaration(node);
55728
+ if (rootParameter) {
55729
+ const symbol = getSymbolOfDeclaration(grandparent);
55730
+ const contextualParameterType = symbol && getSymbolLinks(symbol).type;
55731
+ if (contextualParameterType) {
55732
+ return contextualParameterType;
55733
+ }
55723
55734
  }
55724
- const symbol = getSymbolOfDeclaration(node);
55725
- return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(
55726
- node,
55735
+ return getTypeForVariableLikeDeclaration(
55736
+ grandparent,
55727
55737
  /*includeOptionality*/
55728
55738
  false,
55729
- checkMode
55739
+ node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */
55730
55740
  );
55731
55741
  }
55732
55742
  function getRestType(source, properties, symbol) {
@@ -55831,8 +55841,7 @@ function createTypeChecker(host) {
55831
55841
  return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
55832
55842
  }
55833
55843
  function getTypeForBindingElement(declaration) {
55834
- const checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
55835
- const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
55844
+ const parentType = getTypeForBindingElementParent(declaration);
55836
55845
  return parentType && getBindingElementTypeFromParentType(
55837
55846
  declaration,
55838
55847
  parentType,
@@ -71853,22 +71862,22 @@ function createTypeChecker(host) {
71853
71862
  const type = getTypeOfSymbol(symbol);
71854
71863
  const declaration = symbol.valueDeclaration;
71855
71864
  if (declaration) {
71856
- if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
71865
+ if (isBindingElement(declaration) && !declaration.initializer && declaration.parent.elements.length >= 2) {
71857
71866
  const parent = declaration.parent.parent;
71858
71867
  const rootDeclaration = getRootDeclaration(parent);
71859
71868
  if (rootDeclaration.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 170 /* Parameter */) {
71860
71869
  const links = getNodeLinks(parent);
71861
71870
  if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
71862
71871
  links.flags |= 4194304 /* InCheckIdentifier */;
71863
- const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
71864
- const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
71872
+ const parentType = getTypeForBindingElementParent(declaration);
71873
+ const parentNarrowableType = parentType && getNarrowableTypeForReference(parentType, location);
71865
71874
  links.flags &= ~4194304 /* InCheckIdentifier */;
71866
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
71875
+ if (parentNarrowableType && parentNarrowableType.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
71867
71876
  const pattern = declaration.parent;
71868
71877
  const narrowedType = getFlowTypeOfReference(
71869
71878
  pattern,
71870
- parentTypeConstraint,
71871
- parentTypeConstraint,
71879
+ parentNarrowableType,
71880
+ parentNarrowableType,
71872
71881
  /*flowContainer*/
71873
71882
  void 0,
71874
71883
  location.flowNode
@@ -83207,12 +83216,8 @@ function createTypeChecker(host) {
83207
83216
  checkComputedPropertyName(node.propertyName);
83208
83217
  }
83209
83218
  const parent = node.parent.parent;
83210
- const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
83219
+ const parentType = getTypeForBindingElementParent(node);
83211
83220
  const name = node.propertyName || node.name;
83212
- let parentType = getTypeForBindingElementParent(parent, parentCheckMode);
83213
- if (parentType && !parent.initializer) {
83214
- parentType = checkNonNullType(parentType, parent);
83215
- }
83216
83221
  if (parentType && !isBindingPattern(name)) {
83217
83222
  const exprType = getLiteralTypeFromPropertyName(name);
83218
83223
  if (isTypeUsableAsPropertyName(exprType)) {
@@ -83252,15 +83257,16 @@ function createTypeChecker(host) {
83252
83257
  if (isInAmbientOrTypeNode(node)) {
83253
83258
  return;
83254
83259
  }
83255
- const needCheckInitializer = node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */;
83260
+ const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */;
83256
83261
  const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression));
83257
83262
  if (needCheckInitializer || needCheckWidenedType) {
83258
83263
  const widenedType = getWidenedTypeForVariableLikeDeclaration(node);
83259
83264
  if (needCheckInitializer) {
83265
+ const initializerType = checkExpressionCached(node.initializer);
83260
83266
  if (strictNullChecks && needCheckWidenedType) {
83261
- checkNonNullNonVoidType(checkExpressionCached(node.initializer), node);
83267
+ checkNonNullNonVoidType(initializerType, node);
83262
83268
  } else {
83263
- checkTypeAssignableToAndOptionallyElaborate(checkNonNullExpression(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
83269
+ checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
83264
83270
  }
83265
83271
  }
83266
83272
  if (needCheckWidenedType) {
@@ -124495,7 +124501,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
124495
124501
  function getIgnoreDeprecationsVersion() {
124496
124502
  const ignoreDeprecations = options.ignoreDeprecations;
124497
124503
  if (ignoreDeprecations) {
124498
- if (ignoreDeprecations === "5.0") {
124504
+ if (ignoreDeprecations === "5.0" || ignoreDeprecations === "6.0") {
124499
124505
  return new Version(ignoreDeprecations);
124500
124506
  }
124501
124507
  reportInvalidIgnoreDeprecations();
@@ -124604,6 +124610,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
124604
124610
  );
124605
124611
  }
124606
124612
  });
124613
+ checkDeprecations("6.0", "7.0", createDiagnostic, (createDeprecatedDiagnostic) => {
124614
+ if (options.moduleResolution === 2 /* Node10 */) {
124615
+ createDeprecatedDiagnostic("moduleResolution", "node10");
124616
+ }
124617
+ });
124607
124618
  }
124608
124619
  function verifyDeprecatedProjectReference(ref, parentFile, index) {
124609
124620
  function createDiagnostic(_name, _value, _useInstead, message, ...args) {
@@ -2530,6 +2530,7 @@ declare namespace ts {
2530
2530
  Node = "node",
2531
2531
  /** @deprecated Renamed to `Node10` */
2532
2532
  NodeJs = "node",
2533
+ /** @deprecated */
2533
2534
  Node10 = "node10",
2534
2535
  Node16 = "node16",
2535
2536
  NodeNext = "nodenext",
@@ -6958,6 +6959,9 @@ declare namespace ts {
6958
6959
  * Use the new name or consider switching to a modern module resolution target.
6959
6960
  */
6960
6961
  NodeJs = 2,
6962
+ /**
6963
+ * @deprecated
6964
+ */
6961
6965
  Node10 = 2,
6962
6966
  Node16 = 3,
6963
6967
  NodeNext = 99,
package/lib/typescript.js CHANGED
@@ -881,6 +881,7 @@ __export(typescript_exports, {
881
881
  getModuleInstanceState: () => getModuleInstanceState,
882
882
  getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt,
883
883
  getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
884
+ getModuleSpecifierOfBareOrAccessedRequire: () => getModuleSpecifierOfBareOrAccessedRequire,
884
885
  getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
885
886
  getNameForExportedSymbol: () => getNameForExportedSymbol,
886
887
  getNameFromImportAttribute: () => getNameFromImportAttribute,
@@ -2285,7 +2286,7 @@ module.exports = __toCommonJS(typescript_exports);
2285
2286
 
2286
2287
  // src/compiler/corePublic.ts
2287
2288
  var versionMajorMinor = "6.0";
2288
- var version = `${versionMajorMinor}.0-insiders.20250823`;
2289
+ var version = `${versionMajorMinor}.0-insiders.20250903`;
2289
2290
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2291
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2292
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -18580,6 +18581,22 @@ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
18580
18581
  function isBindingElementOfBareOrAccessedRequire(node) {
18581
18582
  return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
18582
18583
  }
18584
+ function getModuleSpecifierOfBareOrAccessedRequire(node) {
18585
+ if (isVariableDeclarationInitializedToRequire(node)) {
18586
+ return node.initializer.arguments[0];
18587
+ }
18588
+ if (isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
18589
+ const leftmost = getLeftmostAccessExpression(node.initializer);
18590
+ if (isRequireCall(
18591
+ leftmost,
18592
+ /*requireStringLiteralLikeArgument*/
18593
+ true
18594
+ )) {
18595
+ return leftmost.arguments[0];
18596
+ }
18597
+ }
18598
+ return void 0;
18599
+ }
18583
18600
  function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
18584
18601
  return isVariableDeclaration(node) && !!node.initializer && isRequireCall(
18585
18602
  allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer,
@@ -21921,9 +21938,6 @@ var _computedOptions = createComputedCompilerOptions({
21921
21938
  let moduleResolution = compilerOptions.moduleResolution;
21922
21939
  if (moduleResolution === void 0) {
21923
21940
  switch (_computedOptions.module.computeValue(compilerOptions)) {
21924
- case 1 /* CommonJS */:
21925
- moduleResolution = 2 /* Node10 */;
21926
- break;
21927
21941
  case 100 /* Node16 */:
21928
21942
  case 101 /* Node18 */:
21929
21943
  case 102 /* Node20 */:
@@ -21932,6 +21946,7 @@ var _computedOptions = createComputedCompilerOptions({
21932
21946
  case 199 /* NodeNext */:
21933
21947
  moduleResolution = 99 /* NodeNext */;
21934
21948
  break;
21949
+ case 1 /* CommonJS */:
21935
21950
  case 200 /* Preserve */:
21936
21951
  moduleResolution = 100 /* Bundler */;
21937
21952
  break;
@@ -54017,11 +54032,7 @@ function createTypeChecker(host) {
54017
54032
  return ambientModule;
54018
54033
  }
54019
54034
  const currentSourceFile = getSourceFileOfNode(location);
54020
- const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
54021
- location.initializer,
54022
- /*requireStringLiteralLikeArgument*/
54023
- true
54024
- ) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
54035
+ const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || isVariableDeclarationInitializedToBareOrAccessedRequire(location) && getModuleSpecifierOfBareOrAccessedRequire(location) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
54025
54036
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
54026
54037
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
54027
54038
  const resolvedModule = (_f = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _f.resolvedModule;
@@ -60320,21 +60331,21 @@ function createTypeChecker(host) {
60320
60331
  function isErrorType(type) {
60321
60332
  return type === errorType || !!(type.flags & 1 /* Any */ && type.aliasSymbol);
60322
60333
  }
60323
- function getTypeForBindingElementParent(node, checkMode) {
60324
- if (checkMode !== 0 /* Normal */) {
60325
- return getTypeForVariableLikeDeclaration(
60326
- node,
60327
- /*includeOptionality*/
60328
- false,
60329
- checkMode
60330
- );
60334
+ function getTypeForBindingElementParent(node) {
60335
+ const grandparent = node.parent.parent;
60336
+ const rootParameter = tryGetRootParameterDeclaration(node);
60337
+ if (rootParameter) {
60338
+ const symbol = getSymbolOfDeclaration(grandparent);
60339
+ const contextualParameterType = symbol && getSymbolLinks(symbol).type;
60340
+ if (contextualParameterType) {
60341
+ return contextualParameterType;
60342
+ }
60331
60343
  }
60332
- const symbol = getSymbolOfDeclaration(node);
60333
- return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(
60334
- node,
60344
+ return getTypeForVariableLikeDeclaration(
60345
+ grandparent,
60335
60346
  /*includeOptionality*/
60336
60347
  false,
60337
- checkMode
60348
+ node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */
60338
60349
  );
60339
60350
  }
60340
60351
  function getRestType(source, properties, symbol) {
@@ -60439,8 +60450,7 @@ function createTypeChecker(host) {
60439
60450
  return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
60440
60451
  }
60441
60452
  function getTypeForBindingElement(declaration) {
60442
- const checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
60443
- const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
60453
+ const parentType = getTypeForBindingElementParent(declaration);
60444
60454
  return parentType && getBindingElementTypeFromParentType(
60445
60455
  declaration,
60446
60456
  parentType,
@@ -76461,22 +76471,22 @@ function createTypeChecker(host) {
76461
76471
  const type = getTypeOfSymbol(symbol);
76462
76472
  const declaration = symbol.valueDeclaration;
76463
76473
  if (declaration) {
76464
- if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
76474
+ if (isBindingElement(declaration) && !declaration.initializer && declaration.parent.elements.length >= 2) {
76465
76475
  const parent2 = declaration.parent.parent;
76466
76476
  const rootDeclaration = getRootDeclaration(parent2);
76467
76477
  if (rootDeclaration.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 170 /* Parameter */) {
76468
76478
  const links = getNodeLinks(parent2);
76469
76479
  if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
76470
76480
  links.flags |= 4194304 /* InCheckIdentifier */;
76471
- const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
76472
- const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
76481
+ const parentType = getTypeForBindingElementParent(declaration);
76482
+ const parentNarrowableType = parentType && getNarrowableTypeForReference(parentType, location);
76473
76483
  links.flags &= ~4194304 /* InCheckIdentifier */;
76474
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
76484
+ if (parentNarrowableType && parentNarrowableType.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
76475
76485
  const pattern = declaration.parent;
76476
76486
  const narrowedType = getFlowTypeOfReference(
76477
76487
  pattern,
76478
- parentTypeConstraint,
76479
- parentTypeConstraint,
76488
+ parentNarrowableType,
76489
+ parentNarrowableType,
76480
76490
  /*flowContainer*/
76481
76491
  void 0,
76482
76492
  location.flowNode
@@ -87815,12 +87825,8 @@ function createTypeChecker(host) {
87815
87825
  checkComputedPropertyName(node.propertyName);
87816
87826
  }
87817
87827
  const parent2 = node.parent.parent;
87818
- const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
87828
+ const parentType = getTypeForBindingElementParent(node);
87819
87829
  const name = node.propertyName || node.name;
87820
- let parentType = getTypeForBindingElementParent(parent2, parentCheckMode);
87821
- if (parentType && !parent2.initializer) {
87822
- parentType = checkNonNullType(parentType, parent2);
87823
- }
87824
87830
  if (parentType && !isBindingPattern(name)) {
87825
87831
  const exprType = getLiteralTypeFromPropertyName(name);
87826
87832
  if (isTypeUsableAsPropertyName(exprType)) {
@@ -87860,15 +87866,16 @@ function createTypeChecker(host) {
87860
87866
  if (isInAmbientOrTypeNode(node)) {
87861
87867
  return;
87862
87868
  }
87863
- const needCheckInitializer = node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */;
87869
+ const needCheckInitializer = hasOnlyExpressionInitializer(node) && node.initializer && node.parent.parent.kind !== 250 /* ForInStatement */;
87864
87870
  const needCheckWidenedType = !some(node.name.elements, not(isOmittedExpression));
87865
87871
  if (needCheckInitializer || needCheckWidenedType) {
87866
87872
  const widenedType = getWidenedTypeForVariableLikeDeclaration(node);
87867
87873
  if (needCheckInitializer) {
87874
+ const initializerType = checkExpressionCached(node.initializer);
87868
87875
  if (strictNullChecks && needCheckWidenedType) {
87869
- checkNonNullNonVoidType(checkExpressionCached(node.initializer), node);
87876
+ checkNonNullNonVoidType(initializerType, node);
87870
87877
  } else {
87871
- checkTypeAssignableToAndOptionallyElaborate(checkNonNullExpression(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
87878
+ checkTypeAssignableToAndOptionallyElaborate(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, node.initializer);
87872
87879
  }
87873
87880
  }
87874
87881
  if (needCheckWidenedType) {
@@ -129342,7 +129349,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
129342
129349
  function getIgnoreDeprecationsVersion() {
129343
129350
  const ignoreDeprecations = options.ignoreDeprecations;
129344
129351
  if (ignoreDeprecations) {
129345
- if (ignoreDeprecations === "5.0") {
129352
+ if (ignoreDeprecations === "5.0" || ignoreDeprecations === "6.0") {
129346
129353
  return new Version(ignoreDeprecations);
129347
129354
  }
129348
129355
  reportInvalidIgnoreDeprecations();
@@ -129451,6 +129458,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
129451
129458
  );
129452
129459
  }
129453
129460
  });
129461
+ checkDeprecations("6.0", "7.0", createDiagnostic, (createDeprecatedDiagnostic) => {
129462
+ if (options.moduleResolution === 2 /* Node10 */) {
129463
+ createDeprecatedDiagnostic("moduleResolution", "node10");
129464
+ }
129465
+ });
129454
129466
  }
129455
129467
  function verifyDeprecatedProjectReference(ref, parentFile, index) {
129456
129468
  function createDiagnostic(_name, _value, _useInstead, message, ...args) {
@@ -169447,9 +169459,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
169447
169459
  return charactersFuzzyMatchInString(symbolName2, lowerCaseTokenText);
169448
169460
  },
169449
169461
  (info, symbolName2, isFromAmbientModule, exportMapKey) => {
169450
- if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) {
169451
- return;
169452
- }
169453
169462
  info = filter(info, isImportableExportInfo);
169454
169463
  if (!info.length) {
169455
169464
  return;
@@ -169460,6 +169469,9 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
169460
169469
  if (result !== "skipped") {
169461
169470
  ({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result);
169462
169471
  }
169472
+ if (detailsEntryId && (detailsEntryId.source !== moduleSpecifier && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name)))) {
169473
+ return;
169474
+ }
169463
169475
  const isDefaultExport = exportInfo2.exportKind === 1 /* Default */;
169464
169476
  const symbol = isDefaultExport && getLocalSymbolForExportDefault(Debug.checkDefined(exportInfo2.symbol)) || Debug.checkDefined(exportInfo2.symbol);
169465
169477
  pushAutoImportSymbol(symbol, {
@@ -171550,7 +171562,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171550
171562
  if (tryFileExists(host, packageFile)) {
171551
171563
  const packageJson = readJson(packageFile, host);
171552
171564
  const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : "");
171553
- exportsOrImportsLookup(
171565
+ if (exportsOrImportsLookup(
171554
171566
  packageJson.exports,
171555
171567
  fragmentSubpath,
171556
171568
  packageDirectory,
@@ -171558,8 +171570,9 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171558
171570
  true,
171559
171571
  /*isImports*/
171560
171572
  false
171561
- );
171562
- return;
171573
+ )) {
171574
+ return;
171575
+ }
171563
171576
  }
171564
171577
  return nodeModulesDirectoryOrImportsLookup(ancestor);
171565
171578
  };
@@ -171570,7 +171583,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171570
171583
  return arrayFrom(result.values());
171571
171584
  function exportsOrImportsLookup(lookupTable, fragment2, baseDirectory, isExports, isImports) {
171572
171585
  if (typeof lookupTable !== "object" || lookupTable === null) {
171573
- return;
171586
+ return lookupTable !== void 0;
171574
171587
  }
171575
171588
  const keys = getOwnKeys(lookupTable);
171576
171589
  const conditions = getConditions(compilerOptions, mode);
@@ -171594,6 +171607,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171594
171607
  },
171595
171608
  comparePatternKeys
171596
171609
  );
171610
+ return true;
171597
171611
  }
171598
171612
  }
171599
171613
  function getPatternFromFirstMatchingCondition(target, conditions) {
@@ -184093,6 +184107,7 @@ __export(ts_exports2, {
184093
184107
  getModuleInstanceState: () => getModuleInstanceState,
184094
184108
  getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt,
184095
184109
  getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
184110
+ getModuleSpecifierOfBareOrAccessedRequire: () => getModuleSpecifierOfBareOrAccessedRequire,
184096
184111
  getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
184097
184112
  getNameForExportedSymbol: () => getNameForExportedSymbol,
184098
184113
  getNameFromImportAttribute: () => getNameFromImportAttribute,
@@ -198854,6 +198869,7 @@ if (typeof console !== "undefined") {
198854
198869
  getModuleInstanceState,
198855
198870
  getModuleNameStringLiteralAt,
198856
198871
  getModuleSpecifierEndingPreference,
198872
+ getModuleSpecifierOfBareOrAccessedRequire,
198857
198873
  getModuleSpecifierResolverHost,
198858
198874
  getNameForExportedSymbol,
198859
198875
  getNameFromImportAttribute,
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": "6.0.0-pr-60121-19",
5
+ "version": "6.0.0-pr-62350-6",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [