@typescript-deploys/pr-build 5.2.0-pr-55224-27 → 5.2.0-pr-54188-13

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.2";
21
- var version = `${versionMajorMinor}.0-insiders.20230801`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230802`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -1302,31 +1302,6 @@ function trimEndImpl(s) {
1302
1302
  function isNodeLikeSystem() {
1303
1303
  return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
1304
1304
  }
1305
- function createStackSet() {
1306
- var set = /* @__PURE__ */ new Set();
1307
- var stack = [];
1308
- var end = 0;
1309
- return {
1310
- has(value) {
1311
- return set.has(value);
1312
- },
1313
- push(value) {
1314
- set.add(value);
1315
- stack[end] = value;
1316
- end++;
1317
- },
1318
- popAll(callback) {
1319
- while (end > 0) {
1320
- end--;
1321
- const value = stack[end];
1322
- set.delete(value);
1323
- if (callback(value)) {
1324
- break;
1325
- }
1326
- }
1327
- }
1328
- };
1329
- }
1330
1305
 
1331
1306
  // src/compiler/debug.ts
1332
1307
  var Debug;
@@ -34386,7 +34361,7 @@ var commandOptionsWithoutBuild = [
34386
34361
  strictFlag: true,
34387
34362
  category: Diagnostics.Type_Checking,
34388
34363
  description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
34389
- defaultValueDescription: false
34364
+ defaultValueDescription: Diagnostics.false_unless_strict_is_set
34390
34365
  },
34391
34366
  {
34392
34367
  name: "alwaysStrict",
@@ -56525,7 +56500,10 @@ function createTypeChecker(host) {
56525
56500
  }
56526
56501
  }
56527
56502
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
56528
- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
56503
+ const templates = filter(
56504
+ types,
56505
+ (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types))
56506
+ );
56529
56507
  if (templates.length) {
56530
56508
  let i = types.length;
56531
56509
  while (i > 0) {
@@ -56930,15 +56908,19 @@ function createTypeChecker(host) {
56930
56908
  function getConstituentCountOfTypes(types) {
56931
56909
  return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
56932
56910
  }
56933
- function areIntersectedTypesAvoidingPrimitiveReduction(t1, t2) {
56934
- return !!(t1.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) && t2 === emptyTypeLiteralType;
56911
+ function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
56912
+ if (types.length !== 2) {
56913
+ return false;
56914
+ }
56915
+ const [t1, t2] = types;
56916
+ return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
56935
56917
  }
56936
56918
  function getTypeFromIntersectionTypeNode(node) {
56937
56919
  const links = getNodeLinks(node);
56938
56920
  if (!links.resolvedType) {
56939
56921
  const aliasSymbol = getAliasSymbolForTypeNode(node);
56940
56922
  const types = map(node.types, getTypeFromTypeNode);
56941
- const noSupertypeReduction = types.length === 2 && (areIntersectedTypesAvoidingPrimitiveReduction(types[0], types[1]) || areIntersectedTypesAvoidingPrimitiveReduction(types[1], types[0]));
56923
+ const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
56942
56924
  links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
56943
56925
  }
56944
56926
  return links.resolvedType;
@@ -59830,6 +59812,7 @@ function createTypeChecker(host) {
59830
59812
  let maybeKeys;
59831
59813
  let sourceStack;
59832
59814
  let targetStack;
59815
+ let maybeCount = 0;
59833
59816
  let sourceDepth = 0;
59834
59817
  let targetDepth = 0;
59835
59818
  let expandingFlags = 0 /* None */;
@@ -60695,13 +60678,10 @@ function createTypeChecker(host) {
60695
60678
  }
60696
60679
  }
60697
60680
  if (!maybeKeys) {
60698
- maybeKeys = createStackSet();
60681
+ maybeKeys = [];
60699
60682
  sourceStack = [];
60700
60683
  targetStack = [];
60701
60684
  } else {
60702
- if (maybeKeys.has(id)) {
60703
- return 3 /* Maybe */;
60704
- }
60705
60685
  const broadestEquivalentId = id.startsWith("*") ? getRelationKey(
60706
60686
  source2,
60707
60687
  target2,
@@ -60710,15 +60690,19 @@ function createTypeChecker(host) {
60710
60690
  /*ignoreConstraints*/
60711
60691
  true
60712
60692
  ) : void 0;
60713
- if (broadestEquivalentId && maybeKeys.has(broadestEquivalentId)) {
60714
- return 3 /* Maybe */;
60693
+ for (let i = 0; i < maybeCount; i++) {
60694
+ if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
60695
+ return 3 /* Maybe */;
60696
+ }
60715
60697
  }
60716
60698
  if (sourceDepth === 100 || targetDepth === 100) {
60717
60699
  overflow = true;
60718
60700
  return 0 /* False */;
60719
60701
  }
60720
60702
  }
60721
- maybeKeys.push(id);
60703
+ const maybeStart = maybeCount;
60704
+ maybeKeys[maybeCount] = id;
60705
+ maybeCount++;
60722
60706
  const saveExpandingFlags = expandingFlags;
60723
60707
  if (recursionFlags & 1 /* Source */) {
60724
60708
  sourceStack[sourceDepth] = source2;
@@ -60770,17 +60754,15 @@ function createTypeChecker(host) {
60770
60754
  if (result2) {
60771
60755
  if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) {
60772
60756
  if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) {
60773
- maybeKeys.popAll((v) => {
60774
- relation.set(v, 1 /* Succeeded */ | propagatingVarianceFlags);
60775
- return v === id;
60776
- });
60777
- } else {
60778
- maybeKeys.popAll((v) => v === id);
60757
+ for (let i = maybeStart; i < maybeCount; i++) {
60758
+ relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
60759
+ }
60779
60760
  }
60761
+ maybeCount = maybeStart;
60780
60762
  }
60781
60763
  } else {
60782
60764
  relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
60783
- maybeKeys.popAll((v) => v === id);
60765
+ maybeCount = maybeStart;
60784
60766
  }
60785
60767
  return result2;
60786
60768
  }
@@ -63364,6 +63346,9 @@ function createTypeChecker(host) {
63364
63346
  if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
63365
63347
  return true;
63366
63348
  }
63349
+ if (target.flags & 2097152 /* Intersection */) {
63350
+ return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
63351
+ }
63367
63352
  if (source.flags & 128 /* StringLiteral */) {
63368
63353
  const value = source.value;
63369
63354
  return !!(target.flags & 8 /* Number */ && isValidNumberString(
@@ -63374,7 +63359,7 @@ function createTypeChecker(host) {
63374
63359
  value,
63375
63360
  /*roundTripOnly*/
63376
63361
  false
63377
- ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
63362
+ ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
63378
63363
  }
63379
63364
  if (source.flags & 134217728 /* TemplateLiteral */) {
63380
63365
  const texts = source.texts;
@@ -80607,7 +80592,7 @@ function createTypeChecker(host) {
80607
80592
  function copyLocallyVisibleExportSymbols(source, meaning2) {
80608
80593
  if (meaning2) {
80609
80594
  source.forEach((symbol) => {
80610
- if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */)) {
80595
+ if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) {
80611
80596
  copySymbol(symbol, meaning2);
80612
80597
  }
80613
80598
  });
package/lib/tsserver.js CHANGED
@@ -465,7 +465,6 @@ __export(server_exports, {
465
465
  createSourceFile: () => createSourceFile,
466
466
  createSourceMapGenerator: () => createSourceMapGenerator,
467
467
  createSourceMapSource: () => createSourceMapSource,
468
- createStackSet: () => createStackSet,
469
468
  createSuperAccessVariableStatement: () => createSuperAccessVariableStatement,
470
469
  createSymbolTable: () => createSymbolTable,
471
470
  createSymlinkCache: () => createSymlinkCache,
@@ -2332,7 +2331,7 @@ module.exports = __toCommonJS(server_exports);
2332
2331
 
2333
2332
  // src/compiler/corePublic.ts
2334
2333
  var versionMajorMinor = "5.2";
2335
- var version = `${versionMajorMinor}.0-insiders.20230801`;
2334
+ var version = `${versionMajorMinor}.0-insiders.20230802`;
2336
2335
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2337
2336
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2338
2337
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -4004,31 +4003,6 @@ function trimEndImpl(s) {
4004
4003
  function isNodeLikeSystem() {
4005
4004
  return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
4006
4005
  }
4007
- function createStackSet() {
4008
- var set = /* @__PURE__ */ new Set();
4009
- var stack = [];
4010
- var end = 0;
4011
- return {
4012
- has(value) {
4013
- return set.has(value);
4014
- },
4015
- push(value) {
4016
- set.add(value);
4017
- stack[end] = value;
4018
- end++;
4019
- },
4020
- popAll(callback) {
4021
- while (end > 0) {
4022
- end--;
4023
- const value = stack[end];
4024
- set.delete(value);
4025
- if (callback(value)) {
4026
- break;
4027
- }
4028
- }
4029
- }
4030
- };
4031
- }
4032
4006
 
4033
4007
  // src/compiler/debug.ts
4034
4008
  var LogLevel = /* @__PURE__ */ ((LogLevel3) => {
@@ -38789,7 +38763,7 @@ var commandOptionsWithoutBuild = [
38789
38763
  strictFlag: true,
38790
38764
  category: Diagnostics.Type_Checking,
38791
38765
  description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
38792
- defaultValueDescription: false
38766
+ defaultValueDescription: Diagnostics.false_unless_strict_is_set
38793
38767
  },
38794
38768
  {
38795
38769
  name: "alwaysStrict",
@@ -61237,7 +61211,10 @@ function createTypeChecker(host) {
61237
61211
  }
61238
61212
  }
61239
61213
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
61240
- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
61214
+ const templates = filter(
61215
+ types,
61216
+ (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types))
61217
+ );
61241
61218
  if (templates.length) {
61242
61219
  let i = types.length;
61243
61220
  while (i > 0) {
@@ -61642,15 +61619,19 @@ function createTypeChecker(host) {
61642
61619
  function getConstituentCountOfTypes(types) {
61643
61620
  return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
61644
61621
  }
61645
- function areIntersectedTypesAvoidingPrimitiveReduction(t1, t2) {
61646
- return !!(t1.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) && t2 === emptyTypeLiteralType;
61622
+ function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
61623
+ if (types.length !== 2) {
61624
+ return false;
61625
+ }
61626
+ const [t1, t2] = types;
61627
+ return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
61647
61628
  }
61648
61629
  function getTypeFromIntersectionTypeNode(node) {
61649
61630
  const links = getNodeLinks(node);
61650
61631
  if (!links.resolvedType) {
61651
61632
  const aliasSymbol = getAliasSymbolForTypeNode(node);
61652
61633
  const types = map(node.types, getTypeFromTypeNode);
61653
- const noSupertypeReduction = types.length === 2 && (areIntersectedTypesAvoidingPrimitiveReduction(types[0], types[1]) || areIntersectedTypesAvoidingPrimitiveReduction(types[1], types[0]));
61634
+ const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
61654
61635
  links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
61655
61636
  }
61656
61637
  return links.resolvedType;
@@ -64542,6 +64523,7 @@ function createTypeChecker(host) {
64542
64523
  let maybeKeys;
64543
64524
  let sourceStack;
64544
64525
  let targetStack;
64526
+ let maybeCount = 0;
64545
64527
  let sourceDepth = 0;
64546
64528
  let targetDepth = 0;
64547
64529
  let expandingFlags = 0 /* None */;
@@ -65407,13 +65389,10 @@ function createTypeChecker(host) {
65407
65389
  }
65408
65390
  }
65409
65391
  if (!maybeKeys) {
65410
- maybeKeys = createStackSet();
65392
+ maybeKeys = [];
65411
65393
  sourceStack = [];
65412
65394
  targetStack = [];
65413
65395
  } else {
65414
- if (maybeKeys.has(id)) {
65415
- return 3 /* Maybe */;
65416
- }
65417
65396
  const broadestEquivalentId = id.startsWith("*") ? getRelationKey(
65418
65397
  source2,
65419
65398
  target2,
@@ -65422,15 +65401,19 @@ function createTypeChecker(host) {
65422
65401
  /*ignoreConstraints*/
65423
65402
  true
65424
65403
  ) : void 0;
65425
- if (broadestEquivalentId && maybeKeys.has(broadestEquivalentId)) {
65426
- return 3 /* Maybe */;
65404
+ for (let i = 0; i < maybeCount; i++) {
65405
+ if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
65406
+ return 3 /* Maybe */;
65407
+ }
65427
65408
  }
65428
65409
  if (sourceDepth === 100 || targetDepth === 100) {
65429
65410
  overflow = true;
65430
65411
  return 0 /* False */;
65431
65412
  }
65432
65413
  }
65433
- maybeKeys.push(id);
65414
+ const maybeStart = maybeCount;
65415
+ maybeKeys[maybeCount] = id;
65416
+ maybeCount++;
65434
65417
  const saveExpandingFlags = expandingFlags;
65435
65418
  if (recursionFlags & 1 /* Source */) {
65436
65419
  sourceStack[sourceDepth] = source2;
@@ -65482,17 +65465,15 @@ function createTypeChecker(host) {
65482
65465
  if (result2) {
65483
65466
  if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) {
65484
65467
  if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) {
65485
- maybeKeys.popAll((v) => {
65486
- relation.set(v, 1 /* Succeeded */ | propagatingVarianceFlags);
65487
- return v === id;
65488
- });
65489
- } else {
65490
- maybeKeys.popAll((v) => v === id);
65468
+ for (let i = maybeStart; i < maybeCount; i++) {
65469
+ relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
65470
+ }
65491
65471
  }
65472
+ maybeCount = maybeStart;
65492
65473
  }
65493
65474
  } else {
65494
65475
  relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
65495
- maybeKeys.popAll((v) => v === id);
65476
+ maybeCount = maybeStart;
65496
65477
  }
65497
65478
  return result2;
65498
65479
  }
@@ -68076,6 +68057,9 @@ function createTypeChecker(host) {
68076
68057
  if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
68077
68058
  return true;
68078
68059
  }
68060
+ if (target.flags & 2097152 /* Intersection */) {
68061
+ return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
68062
+ }
68079
68063
  if (source.flags & 128 /* StringLiteral */) {
68080
68064
  const value = source.value;
68081
68065
  return !!(target.flags & 8 /* Number */ && isValidNumberString(
@@ -68086,7 +68070,7 @@ function createTypeChecker(host) {
68086
68070
  value,
68087
68071
  /*roundTripOnly*/
68088
68072
  false
68089
- ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
68073
+ ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
68090
68074
  }
68091
68075
  if (source.flags & 134217728 /* TemplateLiteral */) {
68092
68076
  const texts = source.texts;
@@ -85319,7 +85303,7 @@ function createTypeChecker(host) {
85319
85303
  function copyLocallyVisibleExportSymbols(source, meaning2) {
85320
85304
  if (meaning2) {
85321
85305
  source.forEach((symbol) => {
85322
- if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */)) {
85306
+ if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) {
85323
85307
  copySymbol(symbol, meaning2);
85324
85308
  }
85325
85309
  });
@@ -172402,7 +172386,6 @@ __export(ts_exports2, {
172402
172386
  createSourceFile: () => createSourceFile,
172403
172387
  createSourceMapGenerator: () => createSourceMapGenerator,
172404
172388
  createSourceMapSource: () => createSourceMapSource,
172405
- createStackSet: () => createStackSet,
172406
172389
  createSuperAccessVariableStatement: () => createSuperAccessVariableStatement,
172407
172390
  createSymbolTable: () => createSymbolTable,
172408
172391
  createSymlinkCache: () => createSymlinkCache,
@@ -186933,7 +186916,6 @@ start(initializeNodeSystem(), require("os").platform());
186933
186916
  createSourceFile,
186934
186917
  createSourceMapGenerator,
186935
186918
  createSourceMapSource,
186936
- createStackSet,
186937
186919
  createSuperAccessVariableStatement,
186938
186920
  createSymbolTable,
186939
186921
  createSymlinkCache,
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230801`;
38
+ version = `${versionMajorMinor}.0-insiders.20230802`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -1621,31 +1621,6 @@ var ts = (() => {
1621
1621
  function isNodeLikeSystem() {
1622
1622
  return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
1623
1623
  }
1624
- function createStackSet() {
1625
- var set = /* @__PURE__ */ new Set();
1626
- var stack = [];
1627
- var end = 0;
1628
- return {
1629
- has(value) {
1630
- return set.has(value);
1631
- },
1632
- push(value) {
1633
- set.add(value);
1634
- stack[end] = value;
1635
- end++;
1636
- },
1637
- popAll(callback) {
1638
- while (end > 0) {
1639
- end--;
1640
- const value = stack[end];
1641
- set.delete(value);
1642
- if (callback(value)) {
1643
- break;
1644
- }
1645
- }
1646
- }
1647
- };
1648
- }
1649
1624
  var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale, trimString, trimStringEnd, trimStringStart;
1650
1625
  var init_core = __esm({
1651
1626
  "src/compiler/core.ts"() {
@@ -38266,7 +38241,7 @@ ${lanes.join("\n")}
38266
38241
  strictFlag: true,
38267
38242
  category: Diagnostics.Type_Checking,
38268
38243
  description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
38269
- defaultValueDescription: false
38244
+ defaultValueDescription: Diagnostics.false_unless_strict_is_set
38270
38245
  },
38271
38246
  {
38272
38247
  name: "alwaysStrict",
@@ -58999,7 +58974,10 @@ ${lanes.join("\n")}
58999
58974
  }
59000
58975
  }
59001
58976
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
59002
- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
58977
+ const templates = filter(
58978
+ types,
58979
+ (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types))
58980
+ );
59003
58981
  if (templates.length) {
59004
58982
  let i = types.length;
59005
58983
  while (i > 0) {
@@ -59404,15 +59382,19 @@ ${lanes.join("\n")}
59404
59382
  function getConstituentCountOfTypes(types) {
59405
59383
  return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
59406
59384
  }
59407
- function areIntersectedTypesAvoidingPrimitiveReduction(t1, t2) {
59408
- return !!(t1.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) && t2 === emptyTypeLiteralType;
59385
+ function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
59386
+ if (types.length !== 2) {
59387
+ return false;
59388
+ }
59389
+ const [t1, t2] = types;
59390
+ return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
59409
59391
  }
59410
59392
  function getTypeFromIntersectionTypeNode(node) {
59411
59393
  const links = getNodeLinks(node);
59412
59394
  if (!links.resolvedType) {
59413
59395
  const aliasSymbol = getAliasSymbolForTypeNode(node);
59414
59396
  const types = map(node.types, getTypeFromTypeNode);
59415
- const noSupertypeReduction = types.length === 2 && (areIntersectedTypesAvoidingPrimitiveReduction(types[0], types[1]) || areIntersectedTypesAvoidingPrimitiveReduction(types[1], types[0]));
59397
+ const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
59416
59398
  links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
59417
59399
  }
59418
59400
  return links.resolvedType;
@@ -62304,6 +62286,7 @@ ${lanes.join("\n")}
62304
62286
  let maybeKeys;
62305
62287
  let sourceStack;
62306
62288
  let targetStack;
62289
+ let maybeCount = 0;
62307
62290
  let sourceDepth = 0;
62308
62291
  let targetDepth = 0;
62309
62292
  let expandingFlags = 0 /* None */;
@@ -63169,13 +63152,10 @@ ${lanes.join("\n")}
63169
63152
  }
63170
63153
  }
63171
63154
  if (!maybeKeys) {
63172
- maybeKeys = createStackSet();
63155
+ maybeKeys = [];
63173
63156
  sourceStack = [];
63174
63157
  targetStack = [];
63175
63158
  } else {
63176
- if (maybeKeys.has(id)) {
63177
- return 3 /* Maybe */;
63178
- }
63179
63159
  const broadestEquivalentId = id.startsWith("*") ? getRelationKey(
63180
63160
  source2,
63181
63161
  target2,
@@ -63184,15 +63164,19 @@ ${lanes.join("\n")}
63184
63164
  /*ignoreConstraints*/
63185
63165
  true
63186
63166
  ) : void 0;
63187
- if (broadestEquivalentId && maybeKeys.has(broadestEquivalentId)) {
63188
- return 3 /* Maybe */;
63167
+ for (let i = 0; i < maybeCount; i++) {
63168
+ if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
63169
+ return 3 /* Maybe */;
63170
+ }
63189
63171
  }
63190
63172
  if (sourceDepth === 100 || targetDepth === 100) {
63191
63173
  overflow = true;
63192
63174
  return 0 /* False */;
63193
63175
  }
63194
63176
  }
63195
- maybeKeys.push(id);
63177
+ const maybeStart = maybeCount;
63178
+ maybeKeys[maybeCount] = id;
63179
+ maybeCount++;
63196
63180
  const saveExpandingFlags = expandingFlags;
63197
63181
  if (recursionFlags & 1 /* Source */) {
63198
63182
  sourceStack[sourceDepth] = source2;
@@ -63244,17 +63228,15 @@ ${lanes.join("\n")}
63244
63228
  if (result2) {
63245
63229
  if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) {
63246
63230
  if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) {
63247
- maybeKeys.popAll((v) => {
63248
- relation.set(v, 1 /* Succeeded */ | propagatingVarianceFlags);
63249
- return v === id;
63250
- });
63251
- } else {
63252
- maybeKeys.popAll((v) => v === id);
63231
+ for (let i = maybeStart; i < maybeCount; i++) {
63232
+ relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
63233
+ }
63253
63234
  }
63235
+ maybeCount = maybeStart;
63254
63236
  }
63255
63237
  } else {
63256
63238
  relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
63257
- maybeKeys.popAll((v) => v === id);
63239
+ maybeCount = maybeStart;
63258
63240
  }
63259
63241
  return result2;
63260
63242
  }
@@ -65838,6 +65820,9 @@ ${lanes.join("\n")}
65838
65820
  if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
65839
65821
  return true;
65840
65822
  }
65823
+ if (target.flags & 2097152 /* Intersection */) {
65824
+ return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
65825
+ }
65841
65826
  if (source.flags & 128 /* StringLiteral */) {
65842
65827
  const value = source.value;
65843
65828
  return !!(target.flags & 8 /* Number */ && isValidNumberString(
@@ -65848,7 +65833,7 @@ ${lanes.join("\n")}
65848
65833
  value,
65849
65834
  /*roundTripOnly*/
65850
65835
  false
65851
- ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
65836
+ ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
65852
65837
  }
65853
65838
  if (source.flags & 134217728 /* TemplateLiteral */) {
65854
65839
  const texts = source.texts;
@@ -83081,7 +83066,7 @@ ${lanes.join("\n")}
83081
83066
  function copyLocallyVisibleExportSymbols(source, meaning2) {
83082
83067
  if (meaning2) {
83083
83068
  source.forEach((symbol) => {
83084
- if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */)) {
83069
+ if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) {
83085
83070
  copySymbol(symbol, meaning2);
83086
83071
  }
83087
83072
  });
@@ -183550,7 +183535,6 @@ ${e.message}`;
183550
183535
  createSourceFile: () => createSourceFile,
183551
183536
  createSourceMapGenerator: () => createSourceMapGenerator,
183552
183537
  createSourceMapSource: () => createSourceMapSource,
183553
- createStackSet: () => createStackSet,
183554
183538
  createSuperAccessVariableStatement: () => createSuperAccessVariableStatement,
183555
183539
  createSymbolTable: () => createSymbolTable,
183556
183540
  createSymlinkCache: () => createSymlinkCache,
@@ -185958,7 +185942,6 @@ ${e.message}`;
185958
185942
  createSourceFile: () => createSourceFile,
185959
185943
  createSourceMapGenerator: () => createSourceMapGenerator,
185960
185944
  createSourceMapSource: () => createSourceMapSource,
185961
- createStackSet: () => createStackSet,
185962
185945
  createSuperAccessVariableStatement: () => createSuperAccessVariableStatement,
185963
185946
  createSymbolTable: () => createSymbolTable,
185964
185947
  createSymlinkCache: () => createSymlinkCache,
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.2";
38
- version = `${versionMajorMinor}.0-insiders.20230801`;
38
+ version = `${versionMajorMinor}.0-insiders.20230802`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -1621,31 +1621,6 @@ var ts = (() => {
1621
1621
  function isNodeLikeSystem() {
1622
1622
  return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
1623
1623
  }
1624
- function createStackSet() {
1625
- var set = /* @__PURE__ */ new Set();
1626
- var stack = [];
1627
- var end = 0;
1628
- return {
1629
- has(value) {
1630
- return set.has(value);
1631
- },
1632
- push(value) {
1633
- set.add(value);
1634
- stack[end] = value;
1635
- end++;
1636
- },
1637
- popAll(callback) {
1638
- while (end > 0) {
1639
- end--;
1640
- const value = stack[end];
1641
- set.delete(value);
1642
- if (callback(value)) {
1643
- break;
1644
- }
1645
- }
1646
- }
1647
- };
1648
- }
1649
1624
  var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale, trimString, trimStringEnd, trimStringStart;
1650
1625
  var init_core = __esm({
1651
1626
  "src/compiler/core.ts"() {
@@ -38266,7 +38241,7 @@ ${lanes.join("\n")}
38266
38241
  strictFlag: true,
38267
38242
  category: Diagnostics.Type_Checking,
38268
38243
  description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
38269
- defaultValueDescription: false
38244
+ defaultValueDescription: Diagnostics.false_unless_strict_is_set
38270
38245
  },
38271
38246
  {
38272
38247
  name: "alwaysStrict",
@@ -58999,7 +58974,10 @@ ${lanes.join("\n")}
58999
58974
  }
59000
58975
  }
59001
58976
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
59002
- const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
58977
+ const templates = filter(
58978
+ types,
58979
+ (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types))
58980
+ );
59003
58981
  if (templates.length) {
59004
58982
  let i = types.length;
59005
58983
  while (i > 0) {
@@ -59404,15 +59382,19 @@ ${lanes.join("\n")}
59404
59382
  function getConstituentCountOfTypes(types) {
59405
59383
  return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
59406
59384
  }
59407
- function areIntersectedTypesAvoidingPrimitiveReduction(t1, t2) {
59408
- return !!(t1.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) && t2 === emptyTypeLiteralType;
59385
+ function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
59386
+ if (types.length !== 2) {
59387
+ return false;
59388
+ }
59389
+ const [t1, t2] = types;
59390
+ return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
59409
59391
  }
59410
59392
  function getTypeFromIntersectionTypeNode(node) {
59411
59393
  const links = getNodeLinks(node);
59412
59394
  if (!links.resolvedType) {
59413
59395
  const aliasSymbol = getAliasSymbolForTypeNode(node);
59414
59396
  const types = map(node.types, getTypeFromTypeNode);
59415
- const noSupertypeReduction = types.length === 2 && (areIntersectedTypesAvoidingPrimitiveReduction(types[0], types[1]) || areIntersectedTypesAvoidingPrimitiveReduction(types[1], types[0]));
59397
+ const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
59416
59398
  links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
59417
59399
  }
59418
59400
  return links.resolvedType;
@@ -62304,6 +62286,7 @@ ${lanes.join("\n")}
62304
62286
  let maybeKeys;
62305
62287
  let sourceStack;
62306
62288
  let targetStack;
62289
+ let maybeCount = 0;
62307
62290
  let sourceDepth = 0;
62308
62291
  let targetDepth = 0;
62309
62292
  let expandingFlags = 0 /* None */;
@@ -63169,13 +63152,10 @@ ${lanes.join("\n")}
63169
63152
  }
63170
63153
  }
63171
63154
  if (!maybeKeys) {
63172
- maybeKeys = createStackSet();
63155
+ maybeKeys = [];
63173
63156
  sourceStack = [];
63174
63157
  targetStack = [];
63175
63158
  } else {
63176
- if (maybeKeys.has(id)) {
63177
- return 3 /* Maybe */;
63178
- }
63179
63159
  const broadestEquivalentId = id.startsWith("*") ? getRelationKey(
63180
63160
  source2,
63181
63161
  target2,
@@ -63184,15 +63164,19 @@ ${lanes.join("\n")}
63184
63164
  /*ignoreConstraints*/
63185
63165
  true
63186
63166
  ) : void 0;
63187
- if (broadestEquivalentId && maybeKeys.has(broadestEquivalentId)) {
63188
- return 3 /* Maybe */;
63167
+ for (let i = 0; i < maybeCount; i++) {
63168
+ if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
63169
+ return 3 /* Maybe */;
63170
+ }
63189
63171
  }
63190
63172
  if (sourceDepth === 100 || targetDepth === 100) {
63191
63173
  overflow = true;
63192
63174
  return 0 /* False */;
63193
63175
  }
63194
63176
  }
63195
- maybeKeys.push(id);
63177
+ const maybeStart = maybeCount;
63178
+ maybeKeys[maybeCount] = id;
63179
+ maybeCount++;
63196
63180
  const saveExpandingFlags = expandingFlags;
63197
63181
  if (recursionFlags & 1 /* Source */) {
63198
63182
  sourceStack[sourceDepth] = source2;
@@ -63244,17 +63228,15 @@ ${lanes.join("\n")}
63244
63228
  if (result2) {
63245
63229
  if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) {
63246
63230
  if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) {
63247
- maybeKeys.popAll((v) => {
63248
- relation.set(v, 1 /* Succeeded */ | propagatingVarianceFlags);
63249
- return v === id;
63250
- });
63251
- } else {
63252
- maybeKeys.popAll((v) => v === id);
63231
+ for (let i = maybeStart; i < maybeCount; i++) {
63232
+ relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
63233
+ }
63253
63234
  }
63235
+ maybeCount = maybeStart;
63254
63236
  }
63255
63237
  } else {
63256
63238
  relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
63257
- maybeKeys.popAll((v) => v === id);
63239
+ maybeCount = maybeStart;
63258
63240
  }
63259
63241
  return result2;
63260
63242
  }
@@ -65838,6 +65820,9 @@ ${lanes.join("\n")}
65838
65820
  if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
65839
65821
  return true;
65840
65822
  }
65823
+ if (target.flags & 2097152 /* Intersection */) {
65824
+ return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
65825
+ }
65841
65826
  if (source.flags & 128 /* StringLiteral */) {
65842
65827
  const value = source.value;
65843
65828
  return !!(target.flags & 8 /* Number */ && isValidNumberString(
@@ -65848,7 +65833,7 @@ ${lanes.join("\n")}
65848
65833
  value,
65849
65834
  /*roundTripOnly*/
65850
65835
  false
65851
- ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
65836
+ ) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
65852
65837
  }
65853
65838
  if (source.flags & 134217728 /* TemplateLiteral */) {
65854
65839
  const texts = source.texts;
@@ -83081,7 +83066,7 @@ ${lanes.join("\n")}
83081
83066
  function copyLocallyVisibleExportSymbols(source, meaning2) {
83082
83067
  if (meaning2) {
83083
83068
  source.forEach((symbol) => {
83084
- if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */)) {
83069
+ if (!getDeclarationOfKind(symbol, 281 /* ExportSpecifier */) && !getDeclarationOfKind(symbol, 280 /* NamespaceExport */) && symbol.escapedName !== "default" /* Default */) {
83085
83070
  copySymbol(symbol, meaning2);
83086
83071
  }
83087
83072
  });
@@ -172159,7 +172144,6 @@ ${options.prefix}` : "\n" : options.prefix
172159
172144
  createSourceFile: () => createSourceFile,
172160
172145
  createSourceMapGenerator: () => createSourceMapGenerator,
172161
172146
  createSourceMapSource: () => createSourceMapSource,
172162
- createStackSet: () => createStackSet,
172163
172147
  createSuperAccessVariableStatement: () => createSuperAccessVariableStatement,
172164
172148
  createSymbolTable: () => createSymbolTable,
172165
172149
  createSymlinkCache: () => createSymlinkCache,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-insiders.20230801`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230802`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -26242,7 +26242,7 @@ var commandOptionsWithoutBuild = [
26242
26242
  strictFlag: true,
26243
26243
  category: Diagnostics.Type_Checking,
26244
26244
  description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
26245
- defaultValueDescription: false
26245
+ defaultValueDescription: Diagnostics.false_unless_strict_is_set
26246
26246
  },
26247
26247
  {
26248
26248
  name: "alwaysStrict",
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.2.0-pr-55224-27",
5
+ "version": "5.2.0-pr-54188-13",
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": "2bce9b69a6292db56b1749abfefef52ea0e8fcbb"
117
+ "gitHead": "08166eec11a10ac63736bafab1dd536724efd765"
118
118
  }