@typescript-deploys/pr-build 5.8.0-pr-60755-11 → 5.8.0-pr-60718-47

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
@@ -5502,21 +5502,7 @@ function getNormalizedPathComponents(path, currentDirectory) {
5502
5502
  return reducePathComponents(getPathComponents(path, currentDirectory));
5503
5503
  }
5504
5504
  function getNormalizedAbsolutePath(fileName, currentDirectory) {
5505
- fileName = normalizeSlashes(fileName);
5506
- if (isNotNormalizedOrAbsolute(fileName)) {
5507
- return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
5508
- }
5509
- return fileName;
5510
- }
5511
- function isNotNormalizedOrAbsolute(s) {
5512
- if (getEncodedRootLength(s) === 0) {
5513
- return true;
5514
- }
5515
- const lastChar = s.charCodeAt(s.length - 1);
5516
- if (lastChar === 47 /* slash */) {
5517
- return true;
5518
- }
5519
- return relativePathSegmentRegExp.test(s);
5505
+ return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
5520
5506
  }
5521
5507
  function normalizePath(path) {
5522
5508
  path = normalizeSlashes(path);
@@ -45144,9 +45130,7 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
45144
45130
  if (!baseUrl && !paths && !getResolvePackageJsonImports(compilerOptions) || relativePreference === 0 /* Relative */) {
45145
45131
  return pathsOnly ? void 0 : relativePath;
45146
45132
  }
45147
- const currentDirectory = host.getCurrentDirectory();
45148
- const basePath = getPathsBasePath(compilerOptions, host) ?? baseUrl ?? currentDirectory;
45149
- const baseDirectory = getNormalizedAbsolutePath(basePath, currentDirectory);
45133
+ const baseDirectory = getNormalizedAbsolutePath(getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory());
45150
45134
  const relativeToBaseUrl = getRelativePathIfInSameVolume(moduleFileName, baseDirectory, getCanonicalFileName);
45151
45135
  if (!relativeToBaseUrl) {
45152
45136
  return pathsOnly ? void 0 : relativePath;
@@ -58143,6 +58127,9 @@ function createTypeChecker(host) {
58143
58127
  if (isLiteralType(type) || isPatternLiteralType(type)) {
58144
58128
  checkFlags |= 128 /* HasLiteralType */;
58145
58129
  }
58130
+ if (type.flags & 402784252 /* Primitive */) {
58131
+ checkFlags |= 2097152 /* HasPrimitiveType */;
58132
+ }
58146
58133
  if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
58147
58134
  checkFlags |= 131072 /* HasNeverType */;
58148
58135
  }
@@ -68461,14 +68448,20 @@ function createTypeChecker(host) {
68461
68448
  }
68462
68449
  return false;
68463
68450
  }
68464
- function isDiscriminantProperty(type, name) {
68451
+ function isDiscriminantProperty(type, name, considerNonUniformPrimitivePropDiscriminant = false) {
68452
+ var _a;
68465
68453
  if (type && type.flags & 1048576 /* Union */) {
68466
68454
  const prop = getUnionOrIntersectionProperty(type, name);
68467
68455
  if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) {
68468
- if (prop.links.isDiscriminantProperty === void 0) {
68469
- prop.links.isDiscriminantProperty = (prop.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
68456
+ const propType = getTypeOfSymbol(prop);
68457
+ const transientSymbol = prop;
68458
+ (_a = transientSymbol.links).isDiscriminantProperty ?? (_a.isDiscriminantProperty = /* @__PURE__ */ new Map());
68459
+ let isDiscriminant = transientSymbol.links.isDiscriminantProperty.get(considerNonUniformPrimitivePropDiscriminant);
68460
+ if (isDiscriminant === void 0) {
68461
+ isDiscriminant = ((transientSymbol.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ || !!(considerNonUniformPrimitivePropDiscriminant && transientSymbol.links.checkFlags & (64 /* HasNonUniformType */ | 2097152 /* HasPrimitiveType */))) && !isGenericType(propType);
68462
+ transientSymbol.links.isDiscriminantProperty.set(considerNonUniformPrimitivePropDiscriminant, isDiscriminant);
68470
68463
  }
68471
- return !!prop.links.isDiscriminantProperty;
68464
+ return isDiscriminant;
68472
68465
  }
68473
68466
  }
68474
68467
  return false;
@@ -69716,7 +69709,12 @@ function createTypeChecker(host) {
69716
69709
  const name = getAccessedPropertyName(access);
69717
69710
  if (name) {
69718
69711
  const type = declaredType.flags & 1048576 /* Union */ && isTypeSubsetOf(computedType, declaredType) ? declaredType : computedType;
69719
- if (isDiscriminantProperty(type, name)) {
69712
+ if (isDiscriminantProperty(
69713
+ type,
69714
+ name,
69715
+ /*considerNonUniformPrimitivePropDiscriminant*/
69716
+ true
69717
+ )) {
69720
69718
  return access;
69721
69719
  }
69722
69720
  }
@@ -125390,7 +125388,7 @@ function getBuildInfo2(state) {
125390
125388
  var _a, _b;
125391
125389
  const currentDirectory = state.program.getCurrentDirectory();
125392
125390
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
125393
- const latestChangedDtsFile = state.latestChangedDtsFile ? relativePathToBuildInfo(state.latestChangedDtsFile) : void 0;
125391
+ const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
125394
125392
  const fileNames = [];
125395
125393
  const fileNameToFileId = /* @__PURE__ */ new Map();
125396
125394
  const rootFileNames = new Set(state.program.getRootFileNames().map((f) => toPath(f, currentDirectory, state.program.getCanonicalFileName)));
@@ -125532,15 +125530,9 @@ function getBuildInfo2(state) {
125532
125530
  version
125533
125531
  };
125534
125532
  return buildInfo;
125535
- function relativePathToBuildInfo(path) {
125533
+ function relativeToBuildInfoEnsuringAbsolutePath(path) {
125536
125534
  return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
125537
125535
  }
125538
- function relativePathToBuildInfoOrOriginalValue(path) {
125539
- if (typeof path === "string") {
125540
- return relativePathToBuildInfo(path);
125541
- }
125542
- return void 0;
125543
- }
125544
125536
  function relativeToBuildInfo(path) {
125545
125537
  return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, state.program.getCanonicalFileName));
125546
125538
  }
@@ -125605,10 +125597,10 @@ function getBuildInfo2(state) {
125605
125597
  if (option.type === "list") {
125606
125598
  const values = value;
125607
125599
  if (option.element.isFilePath && values.length) {
125608
- return mapDefined(values, relativePathToBuildInfoOrOriginalValue);
125600
+ return values.map(relativeToBuildInfoEnsuringAbsolutePath);
125609
125601
  }
125610
125602
  } else if (option.isFilePath) {
125611
- return relativePathToBuildInfoOrOriginalValue(value);
125603
+ return relativeToBuildInfoEnsuringAbsolutePath(value);
125612
125604
  }
125613
125605
  }
125614
125606
  return value;
@@ -4990,7 +4990,7 @@ declare namespace ts {
4990
4990
  readonly modifiers?: NodeArray<Modifier>;
4991
4991
  readonly equalsGreaterThanToken: EqualsGreaterThanToken;
4992
4992
  readonly body: ConciseBody;
4993
- readonly name: never;
4993
+ readonly name?: never;
4994
4994
  }
4995
4995
  interface LiteralLikeNode extends Node {
4996
4996
  text: string;
package/lib/typescript.js CHANGED
@@ -6363,6 +6363,7 @@ var CheckFlags = /* @__PURE__ */ ((CheckFlags2) => {
6363
6363
  CheckFlags2[CheckFlags2["Mapped"] = 262144] = "Mapped";
6364
6364
  CheckFlags2[CheckFlags2["StripOptional"] = 524288] = "StripOptional";
6365
6365
  CheckFlags2[CheckFlags2["Unresolved"] = 1048576] = "Unresolved";
6366
+ CheckFlags2[CheckFlags2["HasPrimitiveType"] = 2097152] = "HasPrimitiveType";
6366
6367
  CheckFlags2[CheckFlags2["Synthetic"] = 6] = "Synthetic";
6367
6368
  CheckFlags2[CheckFlags2["Discriminant"] = 192] = "Discriminant";
6368
6369
  CheckFlags2[CheckFlags2["Partial"] = 48] = "Partial";
@@ -8876,21 +8877,7 @@ function getNormalizedPathComponents(path, currentDirectory) {
8876
8877
  return reducePathComponents(getPathComponents(path, currentDirectory));
8877
8878
  }
8878
8879
  function getNormalizedAbsolutePath(fileName, currentDirectory) {
8879
- fileName = normalizeSlashes(fileName);
8880
- if (isNotNormalizedOrAbsolute(fileName)) {
8881
- return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
8882
- }
8883
- return fileName;
8884
- }
8885
- function isNotNormalizedOrAbsolute(s) {
8886
- if (getEncodedRootLength(s) === 0) {
8887
- return true;
8888
- }
8889
- const lastChar = s.charCodeAt(s.length - 1);
8890
- if (lastChar === 47 /* slash */) {
8891
- return true;
8892
- }
8893
- return relativePathSegmentRegExp.test(s);
8880
+ return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
8894
8881
  }
8895
8882
  function normalizePath(path) {
8896
8883
  path = normalizeSlashes(path);
@@ -49733,9 +49720,7 @@ function getLocalModuleSpecifier(moduleFileName, info, compilerOptions, host, im
49733
49720
  if (!baseUrl && !paths && !getResolvePackageJsonImports(compilerOptions) || relativePreference === 0 /* Relative */) {
49734
49721
  return pathsOnly ? void 0 : relativePath;
49735
49722
  }
49736
- const currentDirectory = host.getCurrentDirectory();
49737
- const basePath = getPathsBasePath(compilerOptions, host) ?? baseUrl ?? currentDirectory;
49738
- const baseDirectory = getNormalizedAbsolutePath(basePath, currentDirectory);
49723
+ const baseDirectory = getNormalizedAbsolutePath(getPathsBasePath(compilerOptions, host) || baseUrl, host.getCurrentDirectory());
49739
49724
  const relativeToBaseUrl = getRelativePathIfInSameVolume(moduleFileName, baseDirectory, getCanonicalFileName);
49740
49725
  if (!relativeToBaseUrl) {
49741
49726
  return pathsOnly ? void 0 : relativePath;
@@ -62747,6 +62732,9 @@ function createTypeChecker(host) {
62747
62732
  if (isLiteralType(type) || isPatternLiteralType(type)) {
62748
62733
  checkFlags |= 128 /* HasLiteralType */;
62749
62734
  }
62735
+ if (type.flags & 402784252 /* Primitive */) {
62736
+ checkFlags |= 2097152 /* HasPrimitiveType */;
62737
+ }
62750
62738
  if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
62751
62739
  checkFlags |= 131072 /* HasNeverType */;
62752
62740
  }
@@ -73065,14 +73053,20 @@ function createTypeChecker(host) {
73065
73053
  }
73066
73054
  return false;
73067
73055
  }
73068
- function isDiscriminantProperty(type, name) {
73056
+ function isDiscriminantProperty(type, name, considerNonUniformPrimitivePropDiscriminant = false) {
73057
+ var _a;
73069
73058
  if (type && type.flags & 1048576 /* Union */) {
73070
73059
  const prop = getUnionOrIntersectionProperty(type, name);
73071
73060
  if (prop && getCheckFlags(prop) & 2 /* SyntheticProperty */) {
73072
- if (prop.links.isDiscriminantProperty === void 0) {
73073
- prop.links.isDiscriminantProperty = (prop.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ && !isGenericType(getTypeOfSymbol(prop));
73061
+ const propType = getTypeOfSymbol(prop);
73062
+ const transientSymbol = prop;
73063
+ (_a = transientSymbol.links).isDiscriminantProperty ?? (_a.isDiscriminantProperty = /* @__PURE__ */ new Map());
73064
+ let isDiscriminant = transientSymbol.links.isDiscriminantProperty.get(considerNonUniformPrimitivePropDiscriminant);
73065
+ if (isDiscriminant === void 0) {
73066
+ isDiscriminant = ((transientSymbol.links.checkFlags & 192 /* Discriminant */) === 192 /* Discriminant */ || !!(considerNonUniformPrimitivePropDiscriminant && transientSymbol.links.checkFlags & (64 /* HasNonUniformType */ | 2097152 /* HasPrimitiveType */))) && !isGenericType(propType);
73067
+ transientSymbol.links.isDiscriminantProperty.set(considerNonUniformPrimitivePropDiscriminant, isDiscriminant);
73074
73068
  }
73075
- return !!prop.links.isDiscriminantProperty;
73069
+ return isDiscriminant;
73076
73070
  }
73077
73071
  }
73078
73072
  return false;
@@ -74320,7 +74314,12 @@ function createTypeChecker(host) {
74320
74314
  const name = getAccessedPropertyName(access);
74321
74315
  if (name) {
74322
74316
  const type = declaredType.flags & 1048576 /* Union */ && isTypeSubsetOf(computedType, declaredType) ? declaredType : computedType;
74323
- if (isDiscriminantProperty(type, name)) {
74317
+ if (isDiscriminantProperty(
74318
+ type,
74319
+ name,
74320
+ /*considerNonUniformPrimitivePropDiscriminant*/
74321
+ true
74322
+ )) {
74324
74323
  return access;
74325
74324
  }
74326
74325
  }
@@ -130262,7 +130261,7 @@ function getBuildInfo2(state) {
130262
130261
  var _a, _b;
130263
130262
  const currentDirectory = state.program.getCurrentDirectory();
130264
130263
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
130265
- const latestChangedDtsFile = state.latestChangedDtsFile ? relativePathToBuildInfo(state.latestChangedDtsFile) : void 0;
130264
+ const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
130266
130265
  const fileNames = [];
130267
130266
  const fileNameToFileId = /* @__PURE__ */ new Map();
130268
130267
  const rootFileNames = new Set(state.program.getRootFileNames().map((f) => toPath(f, currentDirectory, state.program.getCanonicalFileName)));
@@ -130404,15 +130403,9 @@ function getBuildInfo2(state) {
130404
130403
  version
130405
130404
  };
130406
130405
  return buildInfo;
130407
- function relativePathToBuildInfo(path) {
130406
+ function relativeToBuildInfoEnsuringAbsolutePath(path) {
130408
130407
  return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
130409
130408
  }
130410
- function relativePathToBuildInfoOrOriginalValue(path) {
130411
- if (typeof path === "string") {
130412
- return relativePathToBuildInfo(path);
130413
- }
130414
- return void 0;
130415
- }
130416
130409
  function relativeToBuildInfo(path) {
130417
130410
  return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, state.program.getCanonicalFileName));
130418
130411
  }
@@ -130477,10 +130470,10 @@ function getBuildInfo2(state) {
130477
130470
  if (option.type === "list") {
130478
130471
  const values = value;
130479
130472
  if (option.element.isFilePath && values.length) {
130480
- return mapDefined(values, relativePathToBuildInfoOrOriginalValue);
130473
+ return values.map(relativeToBuildInfoEnsuringAbsolutePath);
130481
130474
  }
130482
130475
  } else if (option.isFilePath) {
130483
- return relativePathToBuildInfoOrOriginalValue(value);
130476
+ return relativeToBuildInfoEnsuringAbsolutePath(value);
130484
130477
  }
130485
130478
  }
130486
130479
  return value;
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-60755-11",
5
+ "version": "5.8.0-pr-60718-47",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -40,48 +40,48 @@
40
40
  ],
41
41
  "devDependencies": {
42
42
  "@dprint/formatter": "^0.4.1",
43
- "@dprint/typescript": "0.93.0",
43
+ "@dprint/typescript": "0.93.3",
44
44
  "@esfx/canceltoken": "^1.0.0",
45
- "@eslint/js": "^9.11.1",
45
+ "@eslint/js": "^9.17.0",
46
46
  "@octokit/rest": "^21.0.2",
47
47
  "@types/chai": "^4.3.20",
48
- "@types/diff": "^5.2.2",
48
+ "@types/diff": "^5.2.3",
49
49
  "@types/minimist": "^1.2.5",
50
- "@types/mocha": "^10.0.8",
50
+ "@types/mocha": "^10.0.10",
51
51
  "@types/ms": "^0.7.34",
52
52
  "@types/node": "latest",
53
53
  "@types/source-map-support": "^0.5.10",
54
54
  "@types/which": "^3.0.4",
55
- "@typescript-eslint/rule-tester": "^8.8.0",
56
- "@typescript-eslint/type-utils": "^8.8.0",
57
- "@typescript-eslint/utils": "^8.8.0",
55
+ "@typescript-eslint/rule-tester": "^8.18.1",
56
+ "@typescript-eslint/type-utils": "^8.18.1",
57
+ "@typescript-eslint/utils": "^8.18.1",
58
58
  "azure-devops-node-api": "^14.1.0",
59
- "c8": "^10.1.2",
59
+ "c8": "^10.1.3",
60
60
  "chai": "^4.5.0",
61
61
  "chalk": "^4.1.2",
62
62
  "chokidar": "^3.6.0",
63
63
  "diff": "^5.2.0",
64
- "dprint": "^0.47.2",
64
+ "dprint": "^0.47.6",
65
65
  "esbuild": "^0.24.0",
66
- "eslint": "^9.11.1",
66
+ "eslint": "^9.17.0",
67
67
  "eslint-formatter-autolinkable-stylish": "^1.4.0",
68
- "eslint-plugin-regexp": "^2.6.0",
69
- "fast-xml-parser": "^4.5.0",
68
+ "eslint-plugin-regexp": "^2.7.0",
69
+ "fast-xml-parser": "^4.5.1",
70
70
  "glob": "^10.4.5",
71
- "globals": "^15.9.0",
71
+ "globals": "^15.13.0",
72
72
  "hereby": "^1.10.0",
73
73
  "jsonc-parser": "^3.3.1",
74
- "knip": "^5.30.6",
74
+ "knip": "^5.41.0",
75
75
  "minimist": "^1.2.8",
76
- "mocha": "^10.7.3",
76
+ "mocha": "^10.8.2",
77
77
  "mocha-fivemat-progress-reporter": "^0.1.0",
78
- "monocart-coverage-reports": "^2.11.0",
78
+ "monocart-coverage-reports": "^2.11.4",
79
79
  "ms": "^2.1.3",
80
- "playwright": "^1.47.2",
80
+ "playwright": "^1.49.1",
81
81
  "source-map-support": "^0.5.21",
82
- "tslib": "^2.7.0",
83
- "typescript": "^5.6.2",
84
- "typescript-eslint": "^8.8.0",
82
+ "tslib": "^2.8.1",
83
+ "typescript": "^5.7.2",
84
+ "typescript-eslint": "^8.18.1",
85
85
  "which": "^3.0.1"
86
86
  },
87
87
  "overrides": {