@typescript-deploys/pr-build 4.9.0-pr-50309-2 → 4.9.0-pr-50329-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.
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-insiders.20220815";
92
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220817";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -7017,7 +7017,6 @@ var ts;
7017
7017
  // not actually work.
7018
7018
  var byteOrderMarkIndicator = "\uFEFF";
7019
7019
  function getNodeSystem() {
7020
- var _a;
7021
7020
  var nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/;
7022
7021
  var _fs = require("fs");
7023
7022
  var _path = require("path");
@@ -7027,7 +7026,7 @@ var ts;
7027
7026
  try {
7028
7027
  _crypto = require("crypto");
7029
7028
  }
7030
- catch (_b) {
7029
+ catch (_a) {
7031
7030
  _crypto = undefined;
7032
7031
  }
7033
7032
  var activeSession;
@@ -7038,10 +7037,10 @@ var ts;
7038
7037
  var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
7039
7038
  var platform = _os.platform();
7040
7039
  var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
7041
- var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
7040
+ var fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
7042
7041
  var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
7043
7042
  var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
7044
- var _c = createSystemWatchFunctions({
7043
+ var _b = createSystemWatchFunctions({
7045
7044
  pollingWatchFile: createSingleFileWatcherPerName(fsWatchFileWorker, useCaseSensitiveFileNames),
7046
7045
  getModifiedTime: getModifiedTime,
7047
7046
  setTimeout: setTimeout,
@@ -7061,7 +7060,7 @@ var ts;
7061
7060
  defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
7062
7061
  inodeWatching: isLinuxOrMacOs,
7063
7062
  sysLog: sysLog,
7064
- }), watchFile = _c.watchFile, watchDirectory = _c.watchDirectory;
7063
+ }), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory;
7065
7064
  var nodeSystem = {
7066
7065
  args: process.argv.slice(2),
7067
7066
  newLine: _os.EOL,
@@ -7454,9 +7453,12 @@ var ts;
7454
7453
  function getDirectories(path) {
7455
7454
  return getAccessibleFileSystemEntries(path).directories.slice();
7456
7455
  }
7456
+ function fsRealPathHandlingLongPath(path) {
7457
+ return path.length < 260 ? _fs.realpathSync.native(path) : _fs.realpathSync(path);
7458
+ }
7457
7459
  function realpath(path) {
7458
7460
  try {
7459
- return realpathSync(path);
7461
+ return fsRealpath(path);
7460
7462
  }
7461
7463
  catch (_a) {
7462
7464
  return path;
@@ -65663,6 +65665,38 @@ var ts;
65663
65665
  }
65664
65666
  return 0 /* False */;
65665
65667
  }
65668
+ // Before normalization: Intersections applied to unions create an explosion of types when normalized -
65669
+ // handling those inner intersections can be very costly, so it can be beneficial to factor them out early.
65670
+ // If both the source and target are intersections, we can remove the common types from them before formal normalization,
65671
+ // and run a simplified comparison without those common members.
65672
+ if (originalSource.flags & originalTarget.flags & 2097152 /* Intersection */) {
65673
+ var combinedTypeSet_1 = new ts.Map();
65674
+ ts.forEach(originalSource.types, function (t) { return combinedTypeSet_1.set(getTypeId(t), 1); });
65675
+ var hasOverlap_1 = false;
65676
+ ts.forEach(originalTarget.types, function (t) {
65677
+ var id = getTypeId(t);
65678
+ if (combinedTypeSet_1.has(id)) {
65679
+ combinedTypeSet_1.set(getTypeId(t), 2);
65680
+ hasOverlap_1 = true;
65681
+ }
65682
+ });
65683
+ if (hasOverlap_1) {
65684
+ var filteredSource = ts.filter(originalSource.types, function (t) { return combinedTypeSet_1.get(getTypeId(t)) !== 2; });
65685
+ var filteredTarget = ts.filter(originalTarget.types, function (t) { return combinedTypeSet_1.get(getTypeId(t)) !== 2; });
65686
+ if (!ts.length(filteredTarget)) {
65687
+ return -1 /* True */; // Source has all parts of target
65688
+ }
65689
+ if (ts.length(filteredSource)) {
65690
+ var result_7;
65691
+ if (result_7 = isRelatedTo(getIntersectionType(filteredSource), getIntersectionType(filteredTarget), recursionFlags, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
65692
+ return result_7;
65693
+ }
65694
+ // In the false case, we may still be assignable at the structural level, rather than the algebraic level
65695
+ }
65696
+ // Even if every member of the source is in the target but the target still has members left, the source may still be assignable
65697
+ // to the target, either if some member of the original source is assignable to the other members of the target, or if there is structural assignability
65698
+ }
65699
+ }
65666
65700
  // Normalize the source and target types: Turn fresh literal types into regular literal types,
65667
65701
  // turn deferred type references into regular type references, simplify indexed access and
65668
65702
  // conditional types, and resolve substitution types to either the substitution (on the source
@@ -65713,7 +65747,8 @@ var ts;
65713
65747
  return 0 /* False */;
65714
65748
  }
65715
65749
  }
65716
- var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
65750
+ var isPerformingCommonPropertyChecks = (relation !== comparableRelation || relation === comparableRelation && isLiteralType(source)) &&
65751
+ !(intersectionState & 2 /* Target */) &&
65717
65752
  source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
65718
65753
  target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
65719
65754
  (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
@@ -65737,7 +65772,7 @@ var ts;
65737
65772
  traceUnionsOrIntersectionsTooLarge(source, target);
65738
65773
  var skipCaching = source.flags & 1048576 /* Union */ && source.types.length < 4 && !(target.flags & 1048576 /* Union */) ||
65739
65774
  target.flags & 1048576 /* Union */ && target.types.length < 4 && !(source.flags & 469499904 /* StructuredOrInstantiable */);
65740
- var result_7 = skipCaching ?
65775
+ var result_8 = skipCaching ?
65741
65776
  unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
65742
65777
  recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
65743
65778
  // For certain combinations involving intersections and optional, excess, or mismatched properties we need
@@ -65755,14 +65790,14 @@ var ts;
65755
65790
  //
65756
65791
  // We suppress recursive intersection property checks because they can generate lots of work when relating
65757
65792
  // recursive intersections that are structurally similar but not exactly identical. See #37854.
65758
- if (result_7 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
65793
+ if (result_8 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
65759
65794
  isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 262144 /* NonInferrableType */); }))) {
65760
65795
  inPropertyCheck = true;
65761
- result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
65796
+ result_8 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
65762
65797
  inPropertyCheck = false;
65763
65798
  }
65764
- if (result_7) {
65765
- return result_7;
65799
+ if (result_8) {
65800
+ return result_8;
65766
65801
  }
65767
65802
  }
65768
65803
  if (reportErrors) {
@@ -66151,6 +66186,9 @@ var ts;
66151
66186
  // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion
66152
66187
  // and issue an error. Otherwise, actually compare the structure of the two types.
66153
66188
  function recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags) {
66189
+ if (relation.size > Math.pow(2, 20)) {
66190
+ debugger;
66191
+ }
66154
66192
  if (overflow) {
66155
66193
  return 0 /* False */;
66156
66194
  }
@@ -66309,11 +66347,11 @@ var ts;
66309
66347
  if (relation === identityRelation) {
66310
66348
  // We've already checked that source.flags and target.flags are identical
66311
66349
  if (sourceFlags & 3145728 /* UnionOrIntersection */) {
66312
- var result_8 = eachTypeRelatedToSomeType(source, target);
66313
- if (result_8) {
66314
- result_8 &= eachTypeRelatedToSomeType(target, source);
66350
+ var result_9 = eachTypeRelatedToSomeType(source, target);
66351
+ if (result_9) {
66352
+ result_9 &= eachTypeRelatedToSomeType(target, source);
66315
66353
  }
66316
- return result_8;
66354
+ return result_9;
66317
66355
  }
66318
66356
  if (sourceFlags & 4194304 /* Index */) {
66319
66357
  return isRelatedTo(source.type, target.type, 3 /* Both */, /*reportErrors*/ false);
@@ -66490,7 +66528,7 @@ var ts;
66490
66528
  // create a new chain for the constraint error
66491
66529
  resetErrorInfo(saveErrorInfo);
66492
66530
  }
66493
- if (result = isRelatedTo(source, constraint, 2 /* Target */, reportErrors)) {
66531
+ if (result = isRelatedTo(source, constraint, 2 /* Target */, reportErrors, /* headMessage */ undefined, intersectionState)) {
66494
66532
  return result;
66495
66533
  }
66496
66534
  // prefer the shorter chain of the constraint comparison chain, and the direct comparison chain
@@ -66802,9 +66840,9 @@ var ts;
66802
66840
  if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 1048576 /* Union */) {
66803
66841
  var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
66804
66842
  if (objectOnlyTarget.flags & 1048576 /* Union */) {
66805
- var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
66806
- if (result_9) {
66807
- return result_9;
66843
+ var result_10 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
66844
+ if (result_10) {
66845
+ return result_10;
66808
66846
  }
66809
66847
  }
66810
66848
  }
@@ -66864,13 +66902,13 @@ var ts;
66864
66902
  var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
66865
66903
  getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
66866
66904
  if (modifiersRelated) {
66867
- var result_10;
66905
+ var result_11;
66868
66906
  var targetConstraint = getConstraintTypeFromMappedType(target);
66869
66907
  var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMapper : reportUnreliableMapper);
66870
- if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
66908
+ if (result_11 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
66871
66909
  var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
66872
66910
  if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
66873
- return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
66911
+ return result_11 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
66874
66912
  }
66875
66913
  }
66876
66914
  }
@@ -68196,7 +68234,7 @@ var ts;
68196
68234
  if (!isLiteralOfContextualType(type, contextualType)) {
68197
68235
  type = getWidenedUniqueESSymbolType(getWidenedLiteralType(type));
68198
68236
  }
68199
- return type;
68237
+ return getRegularTypeOfLiteralType(type);
68200
68238
  }
68201
68239
  function getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded(type, contextualSignatureReturnType, isAsync) {
68202
68240
  if (type && isUnitType(type)) {
@@ -78221,10 +78259,10 @@ var ts;
78221
78259
  hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
78222
78260
  hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
78223
78261
  if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
78224
- var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
78225
- result_11.objectFlags |= 8388608 /* InstantiationExpressionType */;
78226
- result_11.node = node;
78227
- return result_11;
78262
+ var result_12 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
78263
+ result_12.objectFlags |= 8388608 /* InstantiationExpressionType */;
78264
+ result_12.node = node;
78265
+ return result_12;
78228
78266
  }
78229
78267
  }
78230
78268
  else if (type.flags & 58982400 /* InstantiableNonPrimitive */) {
@@ -82059,12 +82097,12 @@ var ts;
82059
82097
  case 265 /* ImportEqualsDeclaration */:
82060
82098
  case 268 /* NamespaceImport */:
82061
82099
  case 267 /* ImportClause */:
82062
- var result_12 = 0 /* None */;
82100
+ var result_13 = 0 /* None */;
82063
82101
  var target = resolveAlias(getSymbolOfNode(d));
82064
82102
  ts.forEach(target.declarations, function (d) {
82065
- result_12 |= getDeclarationSpaces(d);
82103
+ result_13 |= getDeclarationSpaces(d);
82066
82104
  });
82067
- return result_12;
82105
+ return result_13;
82068
82106
  case 254 /* VariableDeclaration */:
82069
82107
  case 203 /* BindingElement */:
82070
82108
  case 256 /* FunctionDeclaration */:
@@ -99245,8 +99283,8 @@ var ts;
99245
99283
  function convertJsxChildrenToChildrenPropAssignment(children) {
99246
99284
  var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
99247
99285
  if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
99248
- var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
99249
- return result_13 && factory.createPropertyAssignment("children", result_13);
99286
+ var result_14 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
99287
+ return result_14 && factory.createPropertyAssignment("children", result_14);
99250
99288
  }
99251
99289
  var result = ts.mapDefined(children, transformJsxChildToExpression);
99252
99290
  return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
@@ -118501,15 +118539,15 @@ var ts;
118501
118539
  // which per above occurred during the current program creation.
118502
118540
  // Since we assume the filesystem does not change during program creation,
118503
118541
  // it is safe to reuse resolutions from the earlier call.
118504
- var result_14 = [];
118542
+ var result_15 = [];
118505
118543
  var i = 0;
118506
118544
  for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
118507
118545
  var moduleName = moduleNames_1[_i];
118508
118546
  var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
118509
118547
  i++;
118510
- result_14.push(resolvedModule);
118548
+ result_15.push(resolvedModule);
118511
118549
  }
118512
- return result_14;
118550
+ return result_15;
118513
118551
  }
118514
118552
  // At this point, we know at least one of the following hold:
118515
118553
  // - file has local declarations for ambient modules
@@ -121969,14 +122007,14 @@ var ts;
121969
122007
  fileNames_1.push(relativeToBuildInfo(sourceFile.resolvedPath));
121970
122008
  fileInfos_1.push(sourceFile.version);
121971
122009
  });
121972
- var result_15 = {
122010
+ var result_16 = {
121973
122011
  fileNames: fileNames_1,
121974
122012
  fileInfos: fileInfos_1,
121975
122013
  options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
121976
122014
  outSignature: state.outSignature,
121977
122015
  latestChangedDtsFile: latestChangedDtsFile,
121978
122016
  };
121979
- return result_15;
122017
+ return result_16;
121980
122018
  }
121981
122019
  var fileNames = [];
121982
122020
  var fileNameToFileId = new ts.Map();
@@ -123914,9 +123952,9 @@ var ts;
123914
123952
  if (!preferSymlinks) {
123915
123953
  // Symlinks inside ignored paths are already filtered out of the symlink cache,
123916
123954
  // so we only need to remove them from the realpath filenames.
123917
- var result_16 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
123918
- if (result_16)
123919
- return result_16;
123955
+ var result_17 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
123956
+ if (result_17)
123957
+ return result_17;
123920
123958
  }
123921
123959
  var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
123922
123960
  var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
@@ -123936,10 +123974,10 @@ var ts;
123936
123974
  for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
123937
123975
  var symlinkDirectory = symlinkDirectories_1[_i];
123938
123976
  var option = ts.resolvePath(symlinkDirectory, relative);
123939
- var result_17 = cb(option, target === referenceRedirect);
123977
+ var result_18 = cb(option, target === referenceRedirect);
123940
123978
  shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
123941
- if (result_17)
123942
- return result_17;
123979
+ if (result_18)
123980
+ return result_18;
123943
123981
  }
123944
123982
  });
123945
123983
  });
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": "4.9.0-pr-50309-2",
5
+ "version": "4.9.0-pr-50329-13",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [