typescript 4.9.0-dev.20220927 → 4.9.0-dev.20220929

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.
@@ -239,9 +239,9 @@ interface String {
239
239
  match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;
240
240
 
241
241
  /**
242
- * Replaces first match with string or all matches with RegExp.
243
- * @param searchValue A string or RegExp search value.
244
- * @param replaceValue A string containing the text to replace for match.
242
+ * Passes a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm.
243
+ * @param searchValue An object that supports searching for and replacing matches within a string.
244
+ * @param replaceValue The replacement text.
245
245
  */
246
246
  replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;
247
247
 
package/lib/lib.es5.d.ts CHANGED
@@ -443,8 +443,8 @@ interface String {
443
443
 
444
444
  /**
445
445
  * Replaces text in a string, using a regular expression or search string.
446
- * @param searchValue A string to search for.
447
- * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
446
+ * @param searchValue A string or regular expression to search for.
447
+ * @param replaceValue A string containing the text to replace. When the {@linkcode searchValue} is a `RegExp`, all matches are replaced if the `g` flag is set (or only those matches at the beginning, if the `y` flag is also present). Otherwise, only the first match of {@linkcode searchValue} is replaced.
448
448
  */
449
449
  replace(searchValue: string | RegExp, replaceValue: string): string;
450
450
 
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.9";
72
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220927");
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220929");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -2744,7 +2744,9 @@ var ts;
2744
2744
  (function (ts) {
2745
2745
  var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
2746
2746
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
2747
+ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
2747
2748
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
2749
+ var buildPartRegExp = /^[a-z0-9-]+$/i;
2748
2750
  var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
2749
2751
  var Version = (function () {
2750
2752
  function Version(major, minor, patch, prerelease, build) {
@@ -2759,13 +2761,15 @@ var ts;
2759
2761
  ts.Debug.assert(major >= 0, "Invalid argument: major");
2760
2762
  ts.Debug.assert(minor >= 0, "Invalid argument: minor");
2761
2763
  ts.Debug.assert(patch >= 0, "Invalid argument: patch");
2762
- ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
2763
- ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
2764
+ var prereleaseArray = prerelease ? ts.isArray(prerelease) ? prerelease : prerelease.split(".") : ts.emptyArray;
2765
+ var buildArray = build ? ts.isArray(build) ? build : build.split(".") : ts.emptyArray;
2766
+ ts.Debug.assert(ts.every(prereleaseArray, function (s) { return prereleasePartRegExp.test(s); }), "Invalid argument: prerelease");
2767
+ ts.Debug.assert(ts.every(buildArray, function (s) { return buildPartRegExp.test(s); }), "Invalid argument: build");
2764
2768
  this.major = major;
2765
2769
  this.minor = minor;
2766
2770
  this.patch = patch;
2767
- this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
2768
- this.build = build ? build.split(".") : ts.emptyArray;
2771
+ this.prerelease = prereleaseArray;
2772
+ this.build = buildArray;
2769
2773
  }
2770
2774
  Version.tryParse = function (text) {
2771
2775
  var result = tryParseComponents(text);
@@ -2792,6 +2796,10 @@ var ts;
2792
2796
  default: return ts.Debug.assertNever(field);
2793
2797
  }
2794
2798
  };
2799
+ Version.prototype.with = function (fields) {
2800
+ var _a = fields.major, major = _a === void 0 ? this.major : _a, _b = fields.minor, minor = _b === void 0 ? this.minor : _b, _c = fields.patch, patch = _c === void 0 ? this.patch : _c, _d = fields.prerelease, prerelease = _d === void 0 ? this.prerelease : _d, _e = fields.build, build = _e === void 0 ? this.build : _e;
2801
+ return new Version(major, minor, patch, prerelease, build);
2802
+ };
2795
2803
  Version.prototype.toString = function () {
2796
2804
  var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
2797
2805
  if (ts.some(this.prerelease))
@@ -2800,7 +2808,7 @@ var ts;
2800
2808
  result += "+".concat(this.build.join("."));
2801
2809
  return result;
2802
2810
  };
2803
- Version.zero = new Version(0, 0, 0);
2811
+ Version.zero = new Version(0, 0, 0, ["0"]);
2804
2812
  return Version;
2805
2813
  }());
2806
2814
  ts.Version = Version;
@@ -2950,19 +2958,20 @@ var ts;
2950
2958
  break;
2951
2959
  case "<":
2952
2960
  case ">=":
2953
- comparators.push(createComparator(operator, version));
2961
+ comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version.with({ prerelease: "0" })) :
2962
+ createComparator(operator, version));
2954
2963
  break;
2955
2964
  case "<=":
2956
2965
  case ">":
2957
- comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major")) :
2958
- isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor")) :
2966
+ comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major").with({ prerelease: "0" })) :
2967
+ isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor").with({ prerelease: "0" })) :
2959
2968
  createComparator(operator, version));
2960
2969
  break;
2961
2970
  case "=":
2962
2971
  case undefined:
2963
2972
  if (isWildcard(minor) || isWildcard(patch)) {
2964
- comparators.push(createComparator(">=", version));
2965
- comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor")));
2973
+ comparators.push(createComparator(">=", version.with({ prerelease: "0" })));
2974
+ comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
2966
2975
  }
2967
2976
  else {
2968
2977
  comparators.push(createComparator("=", version));
@@ -55942,7 +55951,7 @@ var ts;
55942
55951
  if (relation === comparableRelation && sourceFlags & 262144) {
55943
55952
  var constraint = getConstraintOfTypeParameter(source);
55944
55953
  if (constraint && hasNonCircularBaseConstraint(source)) {
55945
- while (constraint && constraint.flags & 262144) {
55954
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144); })) {
55946
55955
  if (result = isRelatedTo(constraint, target, 1, false)) {
55947
55956
  return result;
55948
55957
  }
@@ -101579,7 +101588,7 @@ var ts;
101579
101588
  var canCopyEmitSignatures = compilerOptions.composite &&
101580
101589
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
101581
101590
  !outFilePath &&
101582
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
101591
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
101583
101592
  if (useOldState) {
101584
101593
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
101585
101594
  if (!outFilePath && oldState.affectedFilesPendingEmit) {
@@ -106393,7 +106402,9 @@ var ts;
106393
106402
  }
106394
106403
  if (buildInfo.program) {
106395
106404
  if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
106396
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
106405
+ (!project.options.noEmit ?
106406
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
106407
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
106397
106408
  return {
106398
106409
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
106399
106410
  buildInfoFile: buildInfoPath
package/lib/tsserver.js CHANGED
@@ -109,7 +109,7 @@ var ts;
109
109
  // The following is baselined as a literal template type without intervention
110
110
  /** The version of the TypeScript compiler release */
111
111
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
112
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220927");
112
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220929");
113
113
  /* @internal */
114
114
  var Comparison;
115
115
  (function (Comparison) {
@@ -3215,11 +3215,13 @@ var ts;
3215
3215
  // > alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers
3216
3216
  // > MUST NOT include leading zeroes.
3217
3217
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
3218
+ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
3218
3219
  // https://semver.org/#spec-item-10
3219
3220
  // > Build metadata MAY be denoted by appending a plus sign and a series of dot separated
3220
3221
  // > identifiers immediately following the patch or pre-release version. Identifiers MUST
3221
3222
  // > comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty.
3222
3223
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
3224
+ var buildPartRegExp = /^[a-z0-9-]+$/i;
3223
3225
  // https://semver.org/#spec-item-9
3224
3226
  // > Numeric identifiers MUST NOT include leading zeroes.
3225
3227
  var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
@@ -3239,13 +3241,15 @@ var ts;
3239
3241
  ts.Debug.assert(major >= 0, "Invalid argument: major");
3240
3242
  ts.Debug.assert(minor >= 0, "Invalid argument: minor");
3241
3243
  ts.Debug.assert(patch >= 0, "Invalid argument: patch");
3242
- ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
3243
- ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
3244
+ var prereleaseArray = prerelease ? ts.isArray(prerelease) ? prerelease : prerelease.split(".") : ts.emptyArray;
3245
+ var buildArray = build ? ts.isArray(build) ? build : build.split(".") : ts.emptyArray;
3246
+ ts.Debug.assert(ts.every(prereleaseArray, function (s) { return prereleasePartRegExp.test(s); }), "Invalid argument: prerelease");
3247
+ ts.Debug.assert(ts.every(buildArray, function (s) { return buildPartRegExp.test(s); }), "Invalid argument: build");
3244
3248
  this.major = major;
3245
3249
  this.minor = minor;
3246
3250
  this.patch = patch;
3247
- this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
3248
- this.build = build ? build.split(".") : ts.emptyArray;
3251
+ this.prerelease = prereleaseArray;
3252
+ this.build = buildArray;
3249
3253
  }
3250
3254
  Version.tryParse = function (text) {
3251
3255
  var result = tryParseComponents(text);
@@ -3284,6 +3288,10 @@ var ts;
3284
3288
  default: return ts.Debug.assertNever(field);
3285
3289
  }
3286
3290
  };
3291
+ Version.prototype.with = function (fields) {
3292
+ var _a = fields.major, major = _a === void 0 ? this.major : _a, _b = fields.minor, minor = _b === void 0 ? this.minor : _b, _c = fields.patch, patch = _c === void 0 ? this.patch : _c, _d = fields.prerelease, prerelease = _d === void 0 ? this.prerelease : _d, _e = fields.build, build = _e === void 0 ? this.build : _e;
3293
+ return new Version(major, minor, patch, prerelease, build);
3294
+ };
3287
3295
  Version.prototype.toString = function () {
3288
3296
  var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
3289
3297
  if (ts.some(this.prerelease))
@@ -3292,7 +3300,7 @@ var ts;
3292
3300
  result += "+".concat(this.build.join("."));
3293
3301
  return result;
3294
3302
  };
3295
- Version.zero = new Version(0, 0, 0);
3303
+ Version.zero = new Version(0, 0, 0, ["0"]);
3296
3304
  return Version;
3297
3305
  }());
3298
3306
  ts.Version = Version;
@@ -3375,6 +3383,10 @@ var ts;
3375
3383
  }
3376
3384
  return undefined;
3377
3385
  };
3386
+ /**
3387
+ * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`.
3388
+ * in `node-semver`.
3389
+ */
3378
3390
  VersionRange.prototype.test = function (version) {
3379
3391
  if (typeof version === "string")
3380
3392
  version = new Version(version);
@@ -3485,19 +3497,20 @@ var ts;
3485
3497
  break;
3486
3498
  case "<":
3487
3499
  case ">=":
3488
- comparators.push(createComparator(operator, version));
3500
+ comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version.with({ prerelease: "0" })) :
3501
+ createComparator(operator, version));
3489
3502
  break;
3490
3503
  case "<=":
3491
3504
  case ">":
3492
- comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major")) :
3493
- isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor")) :
3505
+ comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major").with({ prerelease: "0" })) :
3506
+ isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor").with({ prerelease: "0" })) :
3494
3507
  createComparator(operator, version));
3495
3508
  break;
3496
3509
  case "=":
3497
3510
  case undefined:
3498
3511
  if (isWildcard(minor) || isWildcard(patch)) {
3499
- comparators.push(createComparator(">=", version));
3500
- comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor")));
3512
+ comparators.push(createComparator(">=", version.with({ prerelease: "0" })));
3513
+ comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
3501
3514
  }
3502
3515
  else {
3503
3516
  comparators.push(createComparator("=", version));
@@ -67011,7 +67024,7 @@ var ts;
67011
67024
  // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
67012
67025
  var constraint = getConstraintOfTypeParameter(source);
67013
67026
  if (constraint && hasNonCircularBaseConstraint(source)) {
67014
- while (constraint && constraint.flags & 262144 /* TypeFlags.TypeParameter */) {
67027
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144 /* TypeFlags.TypeParameter */); })) {
67015
67028
  if (result = isRelatedTo(constraint, target, 1 /* RecursionFlags.Source */, /*reportErrors*/ false)) {
67016
67029
  return result;
67017
67030
  }
@@ -122557,10 +122570,16 @@ var ts;
122557
122570
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
122558
122571
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
122559
122572
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
122573
+ // We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
122574
+ // which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
122575
+ // We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
122576
+ // oldCompilerOptions can be undefined if there was change in say module from None to some other option
122577
+ // which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
122578
+ // but that option change does not affect d.ts file name so emitSignatures should still be reused.
122560
122579
  var canCopyEmitSignatures = compilerOptions.composite &&
122561
122580
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
122562
122581
  !outFilePath &&
122563
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
122582
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
122564
122583
  if (useOldState) {
122565
122584
  // Copy old state's changed files set
122566
122585
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
@@ -127995,8 +128014,15 @@ var ts;
127995
128014
  }
127996
128015
  if (buildInfo.program) {
127997
128016
  // If there are pending changes that are not emitted, project is out of date
128017
+ // When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
128018
+ // But in case of semantic error we need special treatment.
128019
+ // Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
128020
+ // But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
128021
+ // So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
127998
128022
  if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
127999
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
128023
+ (!project.options.noEmit ?
128024
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
128025
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
128000
128026
  return {
128001
128027
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
128002
128028
  buildInfoFile: buildInfoPath
@@ -108,7 +108,7 @@ var ts;
108
108
  // The following is baselined as a literal template type without intervention
109
109
  /** The version of the TypeScript compiler release */
110
110
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
111
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220927");
111
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220929");
112
112
  /* @internal */
113
113
  var Comparison;
114
114
  (function (Comparison) {
@@ -3214,11 +3214,13 @@ var ts;
3214
3214
  // > alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers
3215
3215
  // > MUST NOT include leading zeroes.
3216
3216
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
3217
+ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
3217
3218
  // https://semver.org/#spec-item-10
3218
3219
  // > Build metadata MAY be denoted by appending a plus sign and a series of dot separated
3219
3220
  // > identifiers immediately following the patch or pre-release version. Identifiers MUST
3220
3221
  // > comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty.
3221
3222
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
3223
+ var buildPartRegExp = /^[a-z0-9-]+$/i;
3222
3224
  // https://semver.org/#spec-item-9
3223
3225
  // > Numeric identifiers MUST NOT include leading zeroes.
3224
3226
  var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
@@ -3238,13 +3240,15 @@ var ts;
3238
3240
  ts.Debug.assert(major >= 0, "Invalid argument: major");
3239
3241
  ts.Debug.assert(minor >= 0, "Invalid argument: minor");
3240
3242
  ts.Debug.assert(patch >= 0, "Invalid argument: patch");
3241
- ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
3242
- ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
3243
+ var prereleaseArray = prerelease ? ts.isArray(prerelease) ? prerelease : prerelease.split(".") : ts.emptyArray;
3244
+ var buildArray = build ? ts.isArray(build) ? build : build.split(".") : ts.emptyArray;
3245
+ ts.Debug.assert(ts.every(prereleaseArray, function (s) { return prereleasePartRegExp.test(s); }), "Invalid argument: prerelease");
3246
+ ts.Debug.assert(ts.every(buildArray, function (s) { return buildPartRegExp.test(s); }), "Invalid argument: build");
3243
3247
  this.major = major;
3244
3248
  this.minor = minor;
3245
3249
  this.patch = patch;
3246
- this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
3247
- this.build = build ? build.split(".") : ts.emptyArray;
3250
+ this.prerelease = prereleaseArray;
3251
+ this.build = buildArray;
3248
3252
  }
3249
3253
  Version.tryParse = function (text) {
3250
3254
  var result = tryParseComponents(text);
@@ -3283,6 +3287,10 @@ var ts;
3283
3287
  default: return ts.Debug.assertNever(field);
3284
3288
  }
3285
3289
  };
3290
+ Version.prototype.with = function (fields) {
3291
+ var _a = fields.major, major = _a === void 0 ? this.major : _a, _b = fields.minor, minor = _b === void 0 ? this.minor : _b, _c = fields.patch, patch = _c === void 0 ? this.patch : _c, _d = fields.prerelease, prerelease = _d === void 0 ? this.prerelease : _d, _e = fields.build, build = _e === void 0 ? this.build : _e;
3292
+ return new Version(major, minor, patch, prerelease, build);
3293
+ };
3286
3294
  Version.prototype.toString = function () {
3287
3295
  var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
3288
3296
  if (ts.some(this.prerelease))
@@ -3291,7 +3299,7 @@ var ts;
3291
3299
  result += "+".concat(this.build.join("."));
3292
3300
  return result;
3293
3301
  };
3294
- Version.zero = new Version(0, 0, 0);
3302
+ Version.zero = new Version(0, 0, 0, ["0"]);
3295
3303
  return Version;
3296
3304
  }());
3297
3305
  ts.Version = Version;
@@ -3374,6 +3382,10 @@ var ts;
3374
3382
  }
3375
3383
  return undefined;
3376
3384
  };
3385
+ /**
3386
+ * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`.
3387
+ * in `node-semver`.
3388
+ */
3377
3389
  VersionRange.prototype.test = function (version) {
3378
3390
  if (typeof version === "string")
3379
3391
  version = new Version(version);
@@ -3484,19 +3496,20 @@ var ts;
3484
3496
  break;
3485
3497
  case "<":
3486
3498
  case ">=":
3487
- comparators.push(createComparator(operator, version));
3499
+ comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version.with({ prerelease: "0" })) :
3500
+ createComparator(operator, version));
3488
3501
  break;
3489
3502
  case "<=":
3490
3503
  case ">":
3491
- comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major")) :
3492
- isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor")) :
3504
+ comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major").with({ prerelease: "0" })) :
3505
+ isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor").with({ prerelease: "0" })) :
3493
3506
  createComparator(operator, version));
3494
3507
  break;
3495
3508
  case "=":
3496
3509
  case undefined:
3497
3510
  if (isWildcard(minor) || isWildcard(patch)) {
3498
- comparators.push(createComparator(">=", version));
3499
- comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor")));
3511
+ comparators.push(createComparator(">=", version.with({ prerelease: "0" })));
3512
+ comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
3500
3513
  }
3501
3514
  else {
3502
3515
  comparators.push(createComparator("=", version));
@@ -67010,7 +67023,7 @@ var ts;
67010
67023
  // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
67011
67024
  var constraint = getConstraintOfTypeParameter(source);
67012
67025
  if (constraint && hasNonCircularBaseConstraint(source)) {
67013
- while (constraint && constraint.flags & 262144 /* TypeFlags.TypeParameter */) {
67026
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144 /* TypeFlags.TypeParameter */); })) {
67014
67027
  if (result = isRelatedTo(constraint, target, 1 /* RecursionFlags.Source */, /*reportErrors*/ false)) {
67015
67028
  return result;
67016
67029
  }
@@ -122556,10 +122569,16 @@ var ts;
122556
122569
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
122557
122570
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
122558
122571
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
122572
+ // We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
122573
+ // which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
122574
+ // We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
122575
+ // oldCompilerOptions can be undefined if there was change in say module from None to some other option
122576
+ // which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
122577
+ // but that option change does not affect d.ts file name so emitSignatures should still be reused.
122559
122578
  var canCopyEmitSignatures = compilerOptions.composite &&
122560
122579
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
122561
122580
  !outFilePath &&
122562
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
122581
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
122563
122582
  if (useOldState) {
122564
122583
  // Copy old state's changed files set
122565
122584
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
@@ -127994,8 +128013,15 @@ var ts;
127994
128013
  }
127995
128014
  if (buildInfo.program) {
127996
128015
  // If there are pending changes that are not emitted, project is out of date
128016
+ // When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
128017
+ // But in case of semantic error we need special treatment.
128018
+ // Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
128019
+ // But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
128020
+ // So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
127997
128021
  if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
127998
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
128022
+ (!project.options.noEmit ?
128023
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
128024
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
127999
128025
  return {
128000
128026
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
128001
128027
  buildInfoFile: buildInfoPath
package/lib/typescript.js CHANGED
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220927");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220929");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -3205,11 +3205,13 @@ var ts;
3205
3205
  // > alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers
3206
3206
  // > MUST NOT include leading zeroes.
3207
3207
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
3208
+ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
3208
3209
  // https://semver.org/#spec-item-10
3209
3210
  // > Build metadata MAY be denoted by appending a plus sign and a series of dot separated
3210
3211
  // > identifiers immediately following the patch or pre-release version. Identifiers MUST
3211
3212
  // > comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty.
3212
3213
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
3214
+ var buildPartRegExp = /^[a-z0-9-]+$/i;
3213
3215
  // https://semver.org/#spec-item-9
3214
3216
  // > Numeric identifiers MUST NOT include leading zeroes.
3215
3217
  var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
@@ -3229,13 +3231,15 @@ var ts;
3229
3231
  ts.Debug.assert(major >= 0, "Invalid argument: major");
3230
3232
  ts.Debug.assert(minor >= 0, "Invalid argument: minor");
3231
3233
  ts.Debug.assert(patch >= 0, "Invalid argument: patch");
3232
- ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
3233
- ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
3234
+ var prereleaseArray = prerelease ? ts.isArray(prerelease) ? prerelease : prerelease.split(".") : ts.emptyArray;
3235
+ var buildArray = build ? ts.isArray(build) ? build : build.split(".") : ts.emptyArray;
3236
+ ts.Debug.assert(ts.every(prereleaseArray, function (s) { return prereleasePartRegExp.test(s); }), "Invalid argument: prerelease");
3237
+ ts.Debug.assert(ts.every(buildArray, function (s) { return buildPartRegExp.test(s); }), "Invalid argument: build");
3234
3238
  this.major = major;
3235
3239
  this.minor = minor;
3236
3240
  this.patch = patch;
3237
- this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
3238
- this.build = build ? build.split(".") : ts.emptyArray;
3241
+ this.prerelease = prereleaseArray;
3242
+ this.build = buildArray;
3239
3243
  }
3240
3244
  Version.tryParse = function (text) {
3241
3245
  var result = tryParseComponents(text);
@@ -3274,6 +3278,10 @@ var ts;
3274
3278
  default: return ts.Debug.assertNever(field);
3275
3279
  }
3276
3280
  };
3281
+ Version.prototype.with = function (fields) {
3282
+ var _a = fields.major, major = _a === void 0 ? this.major : _a, _b = fields.minor, minor = _b === void 0 ? this.minor : _b, _c = fields.patch, patch = _c === void 0 ? this.patch : _c, _d = fields.prerelease, prerelease = _d === void 0 ? this.prerelease : _d, _e = fields.build, build = _e === void 0 ? this.build : _e;
3283
+ return new Version(major, minor, patch, prerelease, build);
3284
+ };
3277
3285
  Version.prototype.toString = function () {
3278
3286
  var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
3279
3287
  if (ts.some(this.prerelease))
@@ -3282,7 +3290,7 @@ var ts;
3282
3290
  result += "+".concat(this.build.join("."));
3283
3291
  return result;
3284
3292
  };
3285
- Version.zero = new Version(0, 0, 0);
3293
+ Version.zero = new Version(0, 0, 0, ["0"]);
3286
3294
  return Version;
3287
3295
  }());
3288
3296
  ts.Version = Version;
@@ -3365,6 +3373,10 @@ var ts;
3365
3373
  }
3366
3374
  return undefined;
3367
3375
  };
3376
+ /**
3377
+ * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`.
3378
+ * in `node-semver`.
3379
+ */
3368
3380
  VersionRange.prototype.test = function (version) {
3369
3381
  if (typeof version === "string")
3370
3382
  version = new Version(version);
@@ -3475,19 +3487,20 @@ var ts;
3475
3487
  break;
3476
3488
  case "<":
3477
3489
  case ">=":
3478
- comparators.push(createComparator(operator, version));
3490
+ comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version.with({ prerelease: "0" })) :
3491
+ createComparator(operator, version));
3479
3492
  break;
3480
3493
  case "<=":
3481
3494
  case ">":
3482
- comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major")) :
3483
- isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor")) :
3495
+ comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major").with({ prerelease: "0" })) :
3496
+ isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor").with({ prerelease: "0" })) :
3484
3497
  createComparator(operator, version));
3485
3498
  break;
3486
3499
  case "=":
3487
3500
  case undefined:
3488
3501
  if (isWildcard(minor) || isWildcard(patch)) {
3489
- comparators.push(createComparator(">=", version));
3490
- comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor")));
3502
+ comparators.push(createComparator(">=", version.with({ prerelease: "0" })));
3503
+ comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
3491
3504
  }
3492
3505
  else {
3493
3506
  comparators.push(createComparator("=", version));
@@ -67001,7 +67014,7 @@ var ts;
67001
67014
  // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
67002
67015
  var constraint = getConstraintOfTypeParameter(source);
67003
67016
  if (constraint && hasNonCircularBaseConstraint(source)) {
67004
- while (constraint && constraint.flags & 262144 /* TypeFlags.TypeParameter */) {
67017
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144 /* TypeFlags.TypeParameter */); })) {
67005
67018
  if (result = isRelatedTo(constraint, target, 1 /* RecursionFlags.Source */, /*reportErrors*/ false)) {
67006
67019
  return result;
67007
67020
  }
@@ -122547,10 +122560,16 @@ var ts;
122547
122560
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
122548
122561
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
122549
122562
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
122563
+ // We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
122564
+ // which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
122565
+ // We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
122566
+ // oldCompilerOptions can be undefined if there was change in say module from None to some other option
122567
+ // which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
122568
+ // but that option change does not affect d.ts file name so emitSignatures should still be reused.
122550
122569
  var canCopyEmitSignatures = compilerOptions.composite &&
122551
122570
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
122552
122571
  !outFilePath &&
122553
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
122572
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
122554
122573
  if (useOldState) {
122555
122574
  // Copy old state's changed files set
122556
122575
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
@@ -127985,8 +128004,15 @@ var ts;
127985
128004
  }
127986
128005
  if (buildInfo.program) {
127987
128006
  // If there are pending changes that are not emitted, project is out of date
128007
+ // When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
128008
+ // But in case of semantic error we need special treatment.
128009
+ // Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
128010
+ // But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
128011
+ // So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
127988
128012
  if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
127989
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
128013
+ (!project.options.noEmit ?
128014
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
128015
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
127990
128016
  return {
127991
128017
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
127992
128018
  buildInfoFile: buildInfoPath
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220927");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220929");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -3205,11 +3205,13 @@ var ts;
3205
3205
  // > alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers
3206
3206
  // > MUST NOT include leading zeroes.
3207
3207
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
3208
+ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
3208
3209
  // https://semver.org/#spec-item-10
3209
3210
  // > Build metadata MAY be denoted by appending a plus sign and a series of dot separated
3210
3211
  // > identifiers immediately following the patch or pre-release version. Identifiers MUST
3211
3212
  // > comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty.
3212
3213
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
3214
+ var buildPartRegExp = /^[a-z0-9-]+$/i;
3213
3215
  // https://semver.org/#spec-item-9
3214
3216
  // > Numeric identifiers MUST NOT include leading zeroes.
3215
3217
  var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
@@ -3229,13 +3231,15 @@ var ts;
3229
3231
  ts.Debug.assert(major >= 0, "Invalid argument: major");
3230
3232
  ts.Debug.assert(minor >= 0, "Invalid argument: minor");
3231
3233
  ts.Debug.assert(patch >= 0, "Invalid argument: patch");
3232
- ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
3233
- ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
3234
+ var prereleaseArray = prerelease ? ts.isArray(prerelease) ? prerelease : prerelease.split(".") : ts.emptyArray;
3235
+ var buildArray = build ? ts.isArray(build) ? build : build.split(".") : ts.emptyArray;
3236
+ ts.Debug.assert(ts.every(prereleaseArray, function (s) { return prereleasePartRegExp.test(s); }), "Invalid argument: prerelease");
3237
+ ts.Debug.assert(ts.every(buildArray, function (s) { return buildPartRegExp.test(s); }), "Invalid argument: build");
3234
3238
  this.major = major;
3235
3239
  this.minor = minor;
3236
3240
  this.patch = patch;
3237
- this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
3238
- this.build = build ? build.split(".") : ts.emptyArray;
3241
+ this.prerelease = prereleaseArray;
3242
+ this.build = buildArray;
3239
3243
  }
3240
3244
  Version.tryParse = function (text) {
3241
3245
  var result = tryParseComponents(text);
@@ -3274,6 +3278,10 @@ var ts;
3274
3278
  default: return ts.Debug.assertNever(field);
3275
3279
  }
3276
3280
  };
3281
+ Version.prototype.with = function (fields) {
3282
+ var _a = fields.major, major = _a === void 0 ? this.major : _a, _b = fields.minor, minor = _b === void 0 ? this.minor : _b, _c = fields.patch, patch = _c === void 0 ? this.patch : _c, _d = fields.prerelease, prerelease = _d === void 0 ? this.prerelease : _d, _e = fields.build, build = _e === void 0 ? this.build : _e;
3283
+ return new Version(major, minor, patch, prerelease, build);
3284
+ };
3277
3285
  Version.prototype.toString = function () {
3278
3286
  var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
3279
3287
  if (ts.some(this.prerelease))
@@ -3282,7 +3290,7 @@ var ts;
3282
3290
  result += "+".concat(this.build.join("."));
3283
3291
  return result;
3284
3292
  };
3285
- Version.zero = new Version(0, 0, 0);
3293
+ Version.zero = new Version(0, 0, 0, ["0"]);
3286
3294
  return Version;
3287
3295
  }());
3288
3296
  ts.Version = Version;
@@ -3365,6 +3373,10 @@ var ts;
3365
3373
  }
3366
3374
  return undefined;
3367
3375
  };
3376
+ /**
3377
+ * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`.
3378
+ * in `node-semver`.
3379
+ */
3368
3380
  VersionRange.prototype.test = function (version) {
3369
3381
  if (typeof version === "string")
3370
3382
  version = new Version(version);
@@ -3475,19 +3487,20 @@ var ts;
3475
3487
  break;
3476
3488
  case "<":
3477
3489
  case ">=":
3478
- comparators.push(createComparator(operator, version));
3490
+ comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version.with({ prerelease: "0" })) :
3491
+ createComparator(operator, version));
3479
3492
  break;
3480
3493
  case "<=":
3481
3494
  case ">":
3482
- comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major")) :
3483
- isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor")) :
3495
+ comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major").with({ prerelease: "0" })) :
3496
+ isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor").with({ prerelease: "0" })) :
3484
3497
  createComparator(operator, version));
3485
3498
  break;
3486
3499
  case "=":
3487
3500
  case undefined:
3488
3501
  if (isWildcard(minor) || isWildcard(patch)) {
3489
- comparators.push(createComparator(">=", version));
3490
- comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor")));
3502
+ comparators.push(createComparator(">=", version.with({ prerelease: "0" })));
3503
+ comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
3491
3504
  }
3492
3505
  else {
3493
3506
  comparators.push(createComparator("=", version));
@@ -67001,7 +67014,7 @@ var ts;
67001
67014
  // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
67002
67015
  var constraint = getConstraintOfTypeParameter(source);
67003
67016
  if (constraint && hasNonCircularBaseConstraint(source)) {
67004
- while (constraint && constraint.flags & 262144 /* TypeFlags.TypeParameter */) {
67017
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144 /* TypeFlags.TypeParameter */); })) {
67005
67018
  if (result = isRelatedTo(constraint, target, 1 /* RecursionFlags.Source */, /*reportErrors*/ false)) {
67006
67019
  return result;
67007
67020
  }
@@ -122547,10 +122560,16 @@ var ts;
122547
122560
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
122548
122561
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
122549
122562
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
122563
+ // We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
122564
+ // which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
122565
+ // We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
122566
+ // oldCompilerOptions can be undefined if there was change in say module from None to some other option
122567
+ // which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
122568
+ // but that option change does not affect d.ts file name so emitSignatures should still be reused.
122550
122569
  var canCopyEmitSignatures = compilerOptions.composite &&
122551
122570
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
122552
122571
  !outFilePath &&
122553
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
122572
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
122554
122573
  if (useOldState) {
122555
122574
  // Copy old state's changed files set
122556
122575
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
@@ -127985,8 +128004,15 @@ var ts;
127985
128004
  }
127986
128005
  if (buildInfo.program) {
127987
128006
  // If there are pending changes that are not emitted, project is out of date
128007
+ // When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
128008
+ // But in case of semantic error we need special treatment.
128009
+ // Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
128010
+ // But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
128011
+ // So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
127988
128012
  if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
127989
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
128013
+ (!project.options.noEmit ?
128014
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
128015
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
127990
128016
  return {
127991
128017
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
127992
128018
  buildInfoFile: buildInfoPath
@@ -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 = "".concat(ts.versionMajorMinor, ".0-dev.20220927");
92
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220929");
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -3195,11 +3195,13 @@ var ts;
3195
3195
  // > alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers
3196
3196
  // > MUST NOT include leading zeroes.
3197
3197
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
3198
+ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
3198
3199
  // https://semver.org/#spec-item-10
3199
3200
  // > Build metadata MAY be denoted by appending a plus sign and a series of dot separated
3200
3201
  // > identifiers immediately following the patch or pre-release version. Identifiers MUST
3201
3202
  // > comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty.
3202
3203
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
3204
+ var buildPartRegExp = /^[a-z0-9-]+$/i;
3203
3205
  // https://semver.org/#spec-item-9
3204
3206
  // > Numeric identifiers MUST NOT include leading zeroes.
3205
3207
  var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
@@ -3219,13 +3221,15 @@ var ts;
3219
3221
  ts.Debug.assert(major >= 0, "Invalid argument: major");
3220
3222
  ts.Debug.assert(minor >= 0, "Invalid argument: minor");
3221
3223
  ts.Debug.assert(patch >= 0, "Invalid argument: patch");
3222
- ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
3223
- ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
3224
+ var prereleaseArray = prerelease ? ts.isArray(prerelease) ? prerelease : prerelease.split(".") : ts.emptyArray;
3225
+ var buildArray = build ? ts.isArray(build) ? build : build.split(".") : ts.emptyArray;
3226
+ ts.Debug.assert(ts.every(prereleaseArray, function (s) { return prereleasePartRegExp.test(s); }), "Invalid argument: prerelease");
3227
+ ts.Debug.assert(ts.every(buildArray, function (s) { return buildPartRegExp.test(s); }), "Invalid argument: build");
3224
3228
  this.major = major;
3225
3229
  this.minor = minor;
3226
3230
  this.patch = patch;
3227
- this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
3228
- this.build = build ? build.split(".") : ts.emptyArray;
3231
+ this.prerelease = prereleaseArray;
3232
+ this.build = buildArray;
3229
3233
  }
3230
3234
  Version.tryParse = function (text) {
3231
3235
  var result = tryParseComponents(text);
@@ -3264,6 +3268,10 @@ var ts;
3264
3268
  default: return ts.Debug.assertNever(field);
3265
3269
  }
3266
3270
  };
3271
+ Version.prototype.with = function (fields) {
3272
+ var _a = fields.major, major = _a === void 0 ? this.major : _a, _b = fields.minor, minor = _b === void 0 ? this.minor : _b, _c = fields.patch, patch = _c === void 0 ? this.patch : _c, _d = fields.prerelease, prerelease = _d === void 0 ? this.prerelease : _d, _e = fields.build, build = _e === void 0 ? this.build : _e;
3273
+ return new Version(major, minor, patch, prerelease, build);
3274
+ };
3267
3275
  Version.prototype.toString = function () {
3268
3276
  var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
3269
3277
  if (ts.some(this.prerelease))
@@ -3272,7 +3280,7 @@ var ts;
3272
3280
  result += "+".concat(this.build.join("."));
3273
3281
  return result;
3274
3282
  };
3275
- Version.zero = new Version(0, 0, 0);
3283
+ Version.zero = new Version(0, 0, 0, ["0"]);
3276
3284
  return Version;
3277
3285
  }());
3278
3286
  ts.Version = Version;
@@ -3355,6 +3363,10 @@ var ts;
3355
3363
  }
3356
3364
  return undefined;
3357
3365
  };
3366
+ /**
3367
+ * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`.
3368
+ * in `node-semver`.
3369
+ */
3358
3370
  VersionRange.prototype.test = function (version) {
3359
3371
  if (typeof version === "string")
3360
3372
  version = new Version(version);
@@ -3465,19 +3477,20 @@ var ts;
3465
3477
  break;
3466
3478
  case "<":
3467
3479
  case ">=":
3468
- comparators.push(createComparator(operator, version));
3480
+ comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version.with({ prerelease: "0" })) :
3481
+ createComparator(operator, version));
3469
3482
  break;
3470
3483
  case "<=":
3471
3484
  case ">":
3472
- comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major")) :
3473
- isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor")) :
3485
+ comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major").with({ prerelease: "0" })) :
3486
+ isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor").with({ prerelease: "0" })) :
3474
3487
  createComparator(operator, version));
3475
3488
  break;
3476
3489
  case "=":
3477
3490
  case undefined:
3478
3491
  if (isWildcard(minor) || isWildcard(patch)) {
3479
- comparators.push(createComparator(">=", version));
3480
- comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor")));
3492
+ comparators.push(createComparator(">=", version.with({ prerelease: "0" })));
3493
+ comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
3481
3494
  }
3482
3495
  else {
3483
3496
  comparators.push(createComparator("=", version));
@@ -66991,7 +67004,7 @@ var ts;
66991
67004
  // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
66992
67005
  var constraint = getConstraintOfTypeParameter(source);
66993
67006
  if (constraint && hasNonCircularBaseConstraint(source)) {
66994
- while (constraint && constraint.flags & 262144 /* TypeFlags.TypeParameter */) {
67007
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144 /* TypeFlags.TypeParameter */); })) {
66995
67008
  if (result = isRelatedTo(constraint, target, 1 /* RecursionFlags.Source */, /*reportErrors*/ false)) {
66996
67009
  return result;
66997
67010
  }
@@ -122537,10 +122550,16 @@ var ts;
122537
122550
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
122538
122551
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
122539
122552
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
122553
+ // We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
122554
+ // which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
122555
+ // We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
122556
+ // oldCompilerOptions can be undefined if there was change in say module from None to some other option
122557
+ // which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
122558
+ // but that option change does not affect d.ts file name so emitSignatures should still be reused.
122540
122559
  var canCopyEmitSignatures = compilerOptions.composite &&
122541
122560
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
122542
122561
  !outFilePath &&
122543
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
122562
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
122544
122563
  if (useOldState) {
122545
122564
  // Copy old state's changed files set
122546
122565
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
@@ -127975,8 +127994,15 @@ var ts;
127975
127994
  }
127976
127995
  if (buildInfo.program) {
127977
127996
  // If there are pending changes that are not emitted, project is out of date
127997
+ // When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
127998
+ // But in case of semantic error we need special treatment.
127999
+ // Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
128000
+ // But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
128001
+ // So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
127978
128002
  if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
127979
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
128003
+ (!project.options.noEmit ?
128004
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
128005
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
127980
128006
  return {
127981
128007
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
127982
128008
  buildInfoFile: buildInfoPath
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": "4.9.0-dev.20220927",
5
+ "version": "4.9.0-dev.20220929",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [