typescript 5.9.0-dev.20250624 → 5.9.0-dev.20250625

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.9";
21
- var version = `${versionMajorMinor}.0-dev.20250624`;
21
+ var version = `${versionMajorMinor}.0-dev.20250625`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -17198,8 +17198,14 @@ function base64encode(host, input) {
17198
17198
  function readJsonOrUndefined(path, hostOrText) {
17199
17199
  const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path);
17200
17200
  if (!jsonText) return void 0;
17201
- const result = parseConfigFileTextToJson(path, jsonText);
17202
- return !result.error ? result.config : void 0;
17201
+ let result = tryParseJson(jsonText);
17202
+ if (result === void 0) {
17203
+ const looseResult = parseConfigFileTextToJson(path, jsonText);
17204
+ if (!looseResult.error) {
17205
+ result = looseResult.config;
17206
+ }
17207
+ }
17208
+ return result;
17203
17209
  }
17204
17210
  function readJson(path, host) {
17205
17211
  return readJsonOrUndefined(path, host) || {};
@@ -31211,6 +31217,7 @@ var Parser;
31211
31217
  /*skipKeyword*/
31212
31218
  true
31213
31219
  );
31220
+ parseOptional(28 /* CommaToken */);
31214
31221
  if (!parseExpected(20 /* CloseBraceToken */)) {
31215
31222
  const lastError = lastOrUndefined(parseDiagnostics);
31216
31223
  if (lastError && lastError.code === Diagnostics._0_expected.code) {
@@ -67432,9 +67439,13 @@ function createTypeChecker(host) {
67432
67439
  return types[0];
67433
67440
  }
67434
67441
  const primaryTypes = strictNullChecks ? sameMap(types, (t) => filterType(t, (u) => !(u.flags & 98304 /* Nullable */))) : types;
67435
- const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : reduceLeft(primaryTypes, (s, t) => isTypeSubtypeOf(s, t) ? t : s);
67442
+ const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : getSingleCommonSupertype(primaryTypes);
67436
67443
  return primaryTypes === types ? superTypeOrUnion : getNullableType(superTypeOrUnion, getCombinedTypeFlags(types) & 98304 /* Nullable */);
67437
67444
  }
67445
+ function getSingleCommonSupertype(types) {
67446
+ const candidate = reduceLeft(types, (s, t) => isTypeStrictSubtypeOf(s, t) ? t : s);
67447
+ return every(types, (t) => t === candidate || isTypeStrictSubtypeOf(t, candidate)) ? candidate : reduceLeft(types, (s, t) => isTypeSubtypeOf(s, t) ? t : s);
67448
+ }
67438
67449
  function getCommonSubtype(types) {
67439
67450
  return reduceLeft(types, (s, t) => isTypeSubtypeOf(t, s) ? t : s);
67440
67451
  }
package/lib/typescript.js CHANGED
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
2285
2285
 
2286
2286
  // src/compiler/corePublic.ts
2287
2287
  var versionMajorMinor = "5.9";
2288
- var version = `${versionMajorMinor}.0-dev.20250624`;
2288
+ var version = `${versionMajorMinor}.0-dev.20250625`;
2289
2289
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2290
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2291
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -21084,8 +21084,14 @@ function base64decode(host, input) {
21084
21084
  function readJsonOrUndefined(path, hostOrText) {
21085
21085
  const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path);
21086
21086
  if (!jsonText) return void 0;
21087
- const result = parseConfigFileTextToJson(path, jsonText);
21088
- return !result.error ? result.config : void 0;
21087
+ let result = tryParseJson(jsonText);
21088
+ if (result === void 0) {
21089
+ const looseResult = parseConfigFileTextToJson(path, jsonText);
21090
+ if (!looseResult.error) {
21091
+ result = looseResult.config;
21092
+ }
21093
+ }
21094
+ return result;
21089
21095
  }
21090
21096
  function readJson(path, host) {
21091
21097
  return readJsonOrUndefined(path, host) || {};
@@ -35472,6 +35478,7 @@ var Parser;
35472
35478
  /*skipKeyword*/
35473
35479
  true
35474
35480
  );
35481
+ parseOptional(28 /* CommaToken */);
35475
35482
  if (!parseExpected(20 /* CloseBraceToken */)) {
35476
35483
  const lastError = lastOrUndefined(parseDiagnostics);
35477
35484
  if (lastError && lastError.code === Diagnostics._0_expected.code) {
@@ -72043,9 +72050,13 @@ function createTypeChecker(host) {
72043
72050
  return types[0];
72044
72051
  }
72045
72052
  const primaryTypes = strictNullChecks ? sameMap(types, (t) => filterType(t, (u) => !(u.flags & 98304 /* Nullable */))) : types;
72046
- const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : reduceLeft(primaryTypes, (s, t) => isTypeSubtypeOf(s, t) ? t : s);
72053
+ const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : getSingleCommonSupertype(primaryTypes);
72047
72054
  return primaryTypes === types ? superTypeOrUnion : getNullableType(superTypeOrUnion, getCombinedTypeFlags(types) & 98304 /* Nullable */);
72048
72055
  }
72056
+ function getSingleCommonSupertype(types) {
72057
+ const candidate = reduceLeft(types, (s, t) => isTypeStrictSubtypeOf(s, t) ? t : s);
72058
+ return every(types, (t) => t === candidate || isTypeStrictSubtypeOf(t, candidate)) ? candidate : reduceLeft(types, (s, t) => isTypeSubtypeOf(s, t) ? t : s);
72059
+ }
72049
72060
  function getCommonSubtype(types) {
72050
72061
  return reduceLeft(types, (s, t) => isTypeSubtypeOf(t, s) ? t : s);
72051
72062
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.9.0-dev.20250624",
5
+ "version": "5.9.0-dev.20250625",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -116,5 +116,5 @@
116
116
  "node": "20.1.0",
117
117
  "npm": "8.19.4"
118
118
  },
119
- "gitHead": "78c16795cdee70b9d9f0f248b6dbb6ba50994a59"
119
+ "gitHead": "e6a50a78619632bba7af4f23b2e7e4940b9cf788"
120
120
  }