@typescript-deploys/pr-build 5.8.0-pr-60910-2 → 5.8.0-pr-60812-15

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.8";
21
- var version = `${versionMajorMinor}.0-insiders.20250103`;
21
+ var version = `${versionMajorMinor}.0-insiders.20250108`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -5501,10 +5501,97 @@ function resolvePath(path, ...paths) {
5501
5501
  function getNormalizedPathComponents(path, currentDirectory) {
5502
5502
  return reducePathComponents(getPathComponents(path, currentDirectory));
5503
5503
  }
5504
- function getNormalizedAbsolutePath(fileName, currentDirectory) {
5505
- return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
5504
+ function getNormalizedAbsolutePath(path, currentDirectory) {
5505
+ let rootLength = getRootLength(path);
5506
+ if (rootLength === 0 && currentDirectory) {
5507
+ path = combinePaths(currentDirectory, path);
5508
+ rootLength = getRootLength(path);
5509
+ }
5510
+ const simple = simpleNormalizePath(path);
5511
+ if (simple !== void 0) {
5512
+ return simple;
5513
+ }
5514
+ const root = path.substring(0, rootLength);
5515
+ const normalizedRoot = root && normalizeSlashes(root);
5516
+ let normalized = normalizedRoot === root ? void 0 : normalizedRoot;
5517
+ let index = rootLength;
5518
+ let segmentStart = index;
5519
+ let normalizedUpTo = index;
5520
+ let seenNonDotDotSegment = rootLength !== 0;
5521
+ while (index < path.length) {
5522
+ segmentStart = index;
5523
+ let ch = path.charCodeAt(index);
5524
+ while (isAnyDirectorySeparator(ch) && index + 1 < path.length) {
5525
+ index++;
5526
+ ch = path.charCodeAt(index);
5527
+ }
5528
+ if (index > segmentStart) {
5529
+ if (normalized === void 0) {
5530
+ normalized = path.substring(0, segmentStart - 1);
5531
+ }
5532
+ segmentStart = index;
5533
+ }
5534
+ const sepIndex = path.indexOf(directorySeparator, index + 1);
5535
+ const altSepIndex = path.indexOf(altDirectorySeparator, index + 1);
5536
+ let segmentEnd = sepIndex === -1 ? altSepIndex : altSepIndex === -1 ? sepIndex : Math.min(sepIndex, altSepIndex);
5537
+ if (segmentEnd === -1) {
5538
+ segmentEnd = path.length;
5539
+ }
5540
+ if (segmentEnd === altSepIndex && normalized === void 0) {
5541
+ normalized = path.substring(0, segmentStart);
5542
+ }
5543
+ const segmentLength = segmentEnd - segmentStart;
5544
+ if (segmentLength === 1 && path.charCodeAt(index) === 46 /* dot */) {
5545
+ if (normalized === void 0) {
5546
+ normalized = path.substring(0, normalizedUpTo);
5547
+ }
5548
+ } else if (segmentLength === 2 && path.charCodeAt(index) === 46 /* dot */ && path.charCodeAt(index + 1) === 46 /* dot */) {
5549
+ if (!seenNonDotDotSegment) {
5550
+ if (normalized !== void 0) {
5551
+ normalized += normalized.length === rootLength ? ".." : "/..";
5552
+ } else {
5553
+ normalizedUpTo = index + 2;
5554
+ }
5555
+ } else if (normalized === void 0) {
5556
+ if (normalizedUpTo - 2 >= 0) {
5557
+ normalized = path.substring(0, Math.max(rootLength, path.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
5558
+ } else {
5559
+ normalized = path.substring(0, normalizedUpTo);
5560
+ }
5561
+ } else {
5562
+ const lastSlash = normalized.lastIndexOf(directorySeparator);
5563
+ if (lastSlash !== -1) {
5564
+ normalized = normalized.substring(0, Math.max(rootLength, lastSlash));
5565
+ } else {
5566
+ normalized = normalizedRoot;
5567
+ }
5568
+ if (normalized.length === rootLength) {
5569
+ seenNonDotDotSegment = rootLength !== 0;
5570
+ }
5571
+ }
5572
+ } else if (normalized !== void 0) {
5573
+ if (normalized.length !== rootLength) {
5574
+ normalized += directorySeparator;
5575
+ }
5576
+ seenNonDotDotSegment = true;
5577
+ normalized += path.substring(segmentStart, segmentEnd);
5578
+ } else {
5579
+ seenNonDotDotSegment = true;
5580
+ normalizedUpTo = segmentEnd;
5581
+ }
5582
+ index = segmentEnd + 1;
5583
+ }
5584
+ return normalized ?? (path.length > rootLength ? removeTrailingDirectorySeparator(path) : path);
5506
5585
  }
5507
5586
  function normalizePath(path) {
5587
+ let normalized = simpleNormalizePath(path);
5588
+ if (normalized !== void 0) {
5589
+ return normalized;
5590
+ }
5591
+ normalized = getNormalizedAbsolutePath(path, "");
5592
+ return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
5593
+ }
5594
+ function simpleNormalizePath(path) {
5508
5595
  path = normalizeSlashes(path);
5509
5596
  if (!relativePathSegmentRegExp.test(path)) {
5510
5597
  return path;
@@ -5516,8 +5603,7 @@ function normalizePath(path) {
5516
5603
  return path;
5517
5604
  }
5518
5605
  }
5519
- const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));
5520
- return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
5606
+ return void 0;
5521
5607
  }
5522
5608
  function getPathWithoutRoot(pathComponents2) {
5523
5609
  if (pathComponents2.length === 0) return "";
@@ -41407,7 +41493,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
41407
41493
  );
41408
41494
  }
41409
41495
  function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
41410
- const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ || state.conditions.includes("import") ? 99 /* ESNext */ : 1 /* CommonJS */;
41496
+ const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
41411
41497
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
41412
41498
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
41413
41499
  if (priorityExtensions) {
@@ -42534,7 +42620,9 @@ function createBinder() {
42534
42620
  case 36 /* ExclamationEqualsToken */:
42535
42621
  case 37 /* EqualsEqualsEqualsToken */:
42536
42622
  case 38 /* ExclamationEqualsEqualsToken */:
42537
- return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
42623
+ const left = skipParentheses(expr.left);
42624
+ const right = skipParentheses(expr.right);
42625
+ return isNarrowableOperand(left) || isNarrowableOperand(right) || isNarrowingTypeofOperands(right, left) || isNarrowingTypeofOperands(left, right) || (isBooleanLiteral(right) && isNarrowingExpression(left) || isBooleanLiteral(left) && isNarrowingExpression(right));
42538
42626
  case 104 /* InstanceOfKeyword */:
42539
42627
  return isNarrowableOperand(expr.left);
42540
42628
  case 103 /* InKeyword */:
package/lib/typescript.js CHANGED
@@ -2279,7 +2279,7 @@ module.exports = __toCommonJS(typescript_exports);
2279
2279
 
2280
2280
  // src/compiler/corePublic.ts
2281
2281
  var versionMajorMinor = "5.8";
2282
- var version = `${versionMajorMinor}.0-insiders.20250103`;
2282
+ var version = `${versionMajorMinor}.0-insiders.20250108`;
2283
2283
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2284
2284
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2285
2285
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8875,10 +8875,97 @@ function resolvePath(path, ...paths) {
8875
8875
  function getNormalizedPathComponents(path, currentDirectory) {
8876
8876
  return reducePathComponents(getPathComponents(path, currentDirectory));
8877
8877
  }
8878
- function getNormalizedAbsolutePath(fileName, currentDirectory) {
8879
- return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
8878
+ function getNormalizedAbsolutePath(path, currentDirectory) {
8879
+ let rootLength = getRootLength(path);
8880
+ if (rootLength === 0 && currentDirectory) {
8881
+ path = combinePaths(currentDirectory, path);
8882
+ rootLength = getRootLength(path);
8883
+ }
8884
+ const simple = simpleNormalizePath(path);
8885
+ if (simple !== void 0) {
8886
+ return simple;
8887
+ }
8888
+ const root = path.substring(0, rootLength);
8889
+ const normalizedRoot = root && normalizeSlashes(root);
8890
+ let normalized = normalizedRoot === root ? void 0 : normalizedRoot;
8891
+ let index = rootLength;
8892
+ let segmentStart = index;
8893
+ let normalizedUpTo = index;
8894
+ let seenNonDotDotSegment = rootLength !== 0;
8895
+ while (index < path.length) {
8896
+ segmentStart = index;
8897
+ let ch = path.charCodeAt(index);
8898
+ while (isAnyDirectorySeparator(ch) && index + 1 < path.length) {
8899
+ index++;
8900
+ ch = path.charCodeAt(index);
8901
+ }
8902
+ if (index > segmentStart) {
8903
+ if (normalized === void 0) {
8904
+ normalized = path.substring(0, segmentStart - 1);
8905
+ }
8906
+ segmentStart = index;
8907
+ }
8908
+ const sepIndex = path.indexOf(directorySeparator, index + 1);
8909
+ const altSepIndex = path.indexOf(altDirectorySeparator, index + 1);
8910
+ let segmentEnd = sepIndex === -1 ? altSepIndex : altSepIndex === -1 ? sepIndex : Math.min(sepIndex, altSepIndex);
8911
+ if (segmentEnd === -1) {
8912
+ segmentEnd = path.length;
8913
+ }
8914
+ if (segmentEnd === altSepIndex && normalized === void 0) {
8915
+ normalized = path.substring(0, segmentStart);
8916
+ }
8917
+ const segmentLength = segmentEnd - segmentStart;
8918
+ if (segmentLength === 1 && path.charCodeAt(index) === 46 /* dot */) {
8919
+ if (normalized === void 0) {
8920
+ normalized = path.substring(0, normalizedUpTo);
8921
+ }
8922
+ } else if (segmentLength === 2 && path.charCodeAt(index) === 46 /* dot */ && path.charCodeAt(index + 1) === 46 /* dot */) {
8923
+ if (!seenNonDotDotSegment) {
8924
+ if (normalized !== void 0) {
8925
+ normalized += normalized.length === rootLength ? ".." : "/..";
8926
+ } else {
8927
+ normalizedUpTo = index + 2;
8928
+ }
8929
+ } else if (normalized === void 0) {
8930
+ if (normalizedUpTo - 2 >= 0) {
8931
+ normalized = path.substring(0, Math.max(rootLength, path.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
8932
+ } else {
8933
+ normalized = path.substring(0, normalizedUpTo);
8934
+ }
8935
+ } else {
8936
+ const lastSlash = normalized.lastIndexOf(directorySeparator);
8937
+ if (lastSlash !== -1) {
8938
+ normalized = normalized.substring(0, Math.max(rootLength, lastSlash));
8939
+ } else {
8940
+ normalized = normalizedRoot;
8941
+ }
8942
+ if (normalized.length === rootLength) {
8943
+ seenNonDotDotSegment = rootLength !== 0;
8944
+ }
8945
+ }
8946
+ } else if (normalized !== void 0) {
8947
+ if (normalized.length !== rootLength) {
8948
+ normalized += directorySeparator;
8949
+ }
8950
+ seenNonDotDotSegment = true;
8951
+ normalized += path.substring(segmentStart, segmentEnd);
8952
+ } else {
8953
+ seenNonDotDotSegment = true;
8954
+ normalizedUpTo = segmentEnd;
8955
+ }
8956
+ index = segmentEnd + 1;
8957
+ }
8958
+ return normalized ?? (path.length > rootLength ? removeTrailingDirectorySeparator(path) : path);
8880
8959
  }
8881
8960
  function normalizePath(path) {
8961
+ let normalized = simpleNormalizePath(path);
8962
+ if (normalized !== void 0) {
8963
+ return normalized;
8964
+ }
8965
+ normalized = getNormalizedAbsolutePath(path, "");
8966
+ return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
8967
+ }
8968
+ function simpleNormalizePath(path) {
8882
8969
  path = normalizeSlashes(path);
8883
8970
  if (!relativePathSegmentRegExp.test(path)) {
8884
8971
  return path;
@@ -8890,8 +8977,7 @@ function normalizePath(path) {
8890
8977
  return path;
8891
8978
  }
8892
8979
  }
8893
- const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));
8894
- return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
8980
+ return void 0;
8895
8981
  }
8896
8982
  function getPathWithoutRoot(pathComponents2) {
8897
8983
  if (pathComponents2.length === 0) return "";
@@ -45893,7 +45979,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
45893
45979
  );
45894
45980
  }
45895
45981
  function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
45896
- const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ || state.conditions.includes("import") ? 99 /* ESNext */ : 1 /* CommonJS */;
45982
+ const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
45897
45983
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
45898
45984
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
45899
45985
  if (priorityExtensions) {
@@ -47038,7 +47124,9 @@ function createBinder() {
47038
47124
  case 36 /* ExclamationEqualsToken */:
47039
47125
  case 37 /* EqualsEqualsEqualsToken */:
47040
47126
  case 38 /* ExclamationEqualsEqualsToken */:
47041
- return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
47127
+ const left = skipParentheses(expr.left);
47128
+ const right = skipParentheses(expr.right);
47129
+ return isNarrowableOperand(left) || isNarrowableOperand(right) || isNarrowingTypeofOperands(right, left) || isNarrowingTypeofOperands(left, right) || (isBooleanLiteral(right) && isNarrowingExpression(left) || isBooleanLiteral(left) && isNarrowingExpression(right));
47042
47130
  case 104 /* InstanceOfKeyword */:
47043
47131
  return isNarrowableOperand(expr.left);
47044
47132
  case 103 /* InKeyword */:
@@ -195451,20 +195539,19 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
195451
195539
  try {
195452
195540
  codeActions = project.getLanguageService().getCodeFixesAtPosition(file, startPosition, endPosition, args.errorCodes, this.getFormatOptions(file), this.getPreferences(file));
195453
195541
  } catch (e) {
195542
+ const error2 = e instanceof Error ? e : new Error(e);
195454
195543
  const ls = project.getLanguageService();
195455
195544
  const existingDiagCodes = [
195456
195545
  ...ls.getSyntacticDiagnostics(file),
195457
195546
  ...ls.getSemanticDiagnostics(file),
195458
195547
  ...ls.getSuggestionDiagnostics(file)
195459
- ].map(
195460
- (d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length) && d.code
195461
- );
195548
+ ].filter((d) => decodedTextSpanIntersectsWith(startPosition, endPosition - startPosition, d.start, d.length)).map((d) => d.code);
195462
195549
  const badCode = args.errorCodes.find((c) => !existingDiagCodes.includes(c));
195463
195550
  if (badCode !== void 0) {
195464
- e.message = `BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")}); could have caused this error:
195465
- ${e.message}`;
195551
+ error2.message += `
195552
+ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range ${startPosition}..${endPosition} (found: ${existingDiagCodes.join(", ")})`;
195466
195553
  }
195467
- throw e;
195554
+ throw error2;
195468
195555
  }
195469
195556
  return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions;
195470
195557
  }
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.8.0-pr-60910-2",
5
+ "version": "5.8.0-pr-60812-15",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [