@typescript-deploys/pr-build 4.8.0-pr-49245-7 → 4.8.0-pr-49285-2

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
@@ -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.8";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20220525";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220531";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -2970,14 +2970,32 @@ var ts;
2970
2970
  })(ts || (ts = {}));
2971
2971
  var ts;
2972
2972
  (function (ts) {
2973
- var performance;
2974
- (function (performance) {
2973
+ var nullTimer = { enter: ts.noop, exit: ts.noop };
2974
+ ts.performance = createPerformanceTracker();
2975
+ ts.solutionPerformance = createPerformanceTracker();
2976
+ function createPerformanceTracker() {
2975
2977
  var perfHooks;
2976
2978
  var performanceImpl;
2979
+ var enabled = false;
2980
+ var timeorigin = ts.timestamp();
2981
+ var marks = new ts.Map();
2982
+ var counts = new ts.Map();
2983
+ var durations = new ts.Map();
2984
+ return {
2985
+ createTimerIf: createTimerIf,
2986
+ createTimer: createTimer,
2987
+ mark: mark,
2988
+ measure: measure,
2989
+ getCount: getCount,
2990
+ getDuration: getDuration,
2991
+ forEachMeasure: forEachMeasure,
2992
+ isEnabled: isEnabled,
2993
+ enable: enable,
2994
+ disable: disable,
2995
+ };
2977
2996
  function createTimerIf(condition, measureName, startMarkName, endMarkName) {
2978
- return condition ? createTimer(measureName, startMarkName, endMarkName) : performance.nullTimer;
2997
+ return condition ? createTimer(measureName, startMarkName, endMarkName) : nullTimer;
2979
2998
  }
2980
- performance.createTimerIf = createTimerIf;
2981
2999
  function createTimer(measureName, startMarkName, endMarkName) {
2982
3000
  var enterCount = 0;
2983
3001
  return {
@@ -2999,13 +3017,6 @@ var ts;
2999
3017
  }
3000
3018
  }
3001
3019
  }
3002
- performance.createTimer = createTimer;
3003
- performance.nullTimer = { enter: ts.noop, exit: ts.noop };
3004
- var enabled = false;
3005
- var timeorigin = ts.timestamp();
3006
- var marks = new ts.Map();
3007
- var counts = new ts.Map();
3008
- var durations = new ts.Map();
3009
3020
  function mark(markName) {
3010
3021
  var _a;
3011
3022
  if (enabled) {
@@ -3015,34 +3026,28 @@ var ts;
3015
3026
  performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.mark(markName);
3016
3027
  }
3017
3028
  }
3018
- performance.mark = mark;
3019
3029
  function measure(measureName, startMarkName, endMarkName) {
3020
3030
  var _a, _b;
3021
3031
  if (enabled) {
3022
- var end = (_a = (endMarkName !== undefined ? marks.get(endMarkName) : undefined)) !== null && _a !== void 0 ? _a : ts.timestamp();
3023
- var start = (_b = (startMarkName !== undefined ? marks.get(startMarkName) : undefined)) !== null && _b !== void 0 ? _b : timeorigin;
3032
+ var end = (_a = marks.get(endMarkName)) !== null && _a !== void 0 ? _a : ts.timestamp();
3033
+ var start = (_b = marks.get(startMarkName)) !== null && _b !== void 0 ? _b : timeorigin;
3024
3034
  var previousDuration = durations.get(measureName) || 0;
3025
3035
  durations.set(measureName, previousDuration + (end - start));
3026
3036
  performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName);
3027
3037
  }
3028
3038
  }
3029
- performance.measure = measure;
3030
3039
  function getCount(markName) {
3031
3040
  return counts.get(markName) || 0;
3032
3041
  }
3033
- performance.getCount = getCount;
3034
3042
  function getDuration(measureName) {
3035
3043
  return durations.get(measureName) || 0;
3036
3044
  }
3037
- performance.getDuration = getDuration;
3038
3045
  function forEachMeasure(cb) {
3039
3046
  durations.forEach(function (duration, measureName) { return cb(measureName, duration); });
3040
3047
  }
3041
- performance.forEachMeasure = forEachMeasure;
3042
3048
  function isEnabled() {
3043
3049
  return enabled;
3044
3050
  }
3045
- performance.isEnabled = isEnabled;
3046
3051
  function enable(system) {
3047
3052
  var _a;
3048
3053
  if (system === void 0) { system = ts.sys; }
@@ -3058,7 +3063,6 @@ var ts;
3058
3063
  }
3059
3064
  return true;
3060
3065
  }
3061
- performance.enable = enable;
3062
3066
  function disable() {
3063
3067
  if (enabled) {
3064
3068
  marks.clear();
@@ -3068,8 +3072,7 @@ var ts;
3068
3072
  enabled = false;
3069
3073
  }
3070
3074
  }
3071
- performance.disable = disable;
3072
- })(performance = ts.performance || (ts.performance = {}));
3075
+ }
3073
3076
  })(ts || (ts = {}));
3074
3077
  var ts;
3075
3078
  (function (ts) {
@@ -5598,6 +5601,7 @@ var ts;
5598
5601
  Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", undefined, true),
5599
5602
  The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
5600
5603
  The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
5604
+ This_type_parameter_probably_needs_an_extends_object_constraint: diag(2208, ts.DiagnosticCategory.Error, "This_type_parameter_probably_needs_an_extends_object_constraint_2208", "This type parameter probably needs an `extends object` constraint."),
5601
5605
  The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2209, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
5602
5606
  The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
5603
5607
  Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
@@ -12599,9 +12603,6 @@ var ts;
12599
12603
  }
12600
12604
  ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
12601
12605
  function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
12602
- if (node.kind === 203) {
12603
- node = node.parent.parent;
12604
- }
12605
12606
  return ts.isVariableDeclaration(node) &&
12606
12607
  !!node.initializer &&
12607
12608
  isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, true);
@@ -15861,13 +15862,13 @@ var ts;
15861
15862
  return !file.isDeclarationFile ? walkTreeForJSXTags(file) : undefined;
15862
15863
  }
15863
15864
  function isFileForcedToBeModuleByFormat(file) {
15864
- return file.impliedNodeFormat === ts.ModuleKind.ESNext && !file.isDeclarationFile ? true : undefined;
15865
+ return (file.impliedNodeFormat === ts.ModuleKind.ESNext || (ts.fileExtensionIsOneOf(file.fileName, [".cjs", ".cts"]))) && !file.isDeclarationFile ? true : undefined;
15865
15866
  }
15866
15867
  function getSetExternalModuleIndicator(options) {
15867
15868
  switch (getEmitModuleDetectionKind(options)) {
15868
15869
  case ts.ModuleDetectionKind.Force:
15869
15870
  return function (file) {
15870
- file.externalModuleIndicator = !file.isDeclarationFile || ts.isFileProbablyExternalModule(file);
15871
+ file.externalModuleIndicator = ts.isFileProbablyExternalModule(file) || !file.isDeclarationFile || undefined;
15871
15872
  };
15872
15873
  case ts.ModuleDetectionKind.Legacy:
15873
15874
  return function (file) {
@@ -15923,7 +15924,8 @@ var ts;
15923
15924
  }
15924
15925
  ts.getEmitModuleResolutionKind = getEmitModuleResolutionKind;
15925
15926
  function getEmitModuleDetectionKind(options) {
15926
- return options.moduleDetection || ts.ModuleDetectionKind.Auto;
15927
+ return options.moduleDetection ||
15928
+ (getEmitModuleKind(options) === ts.ModuleKind.Node16 || getEmitModuleKind(options) === ts.ModuleKind.NodeNext ? ts.ModuleDetectionKind.Force : ts.ModuleDetectionKind.Auto);
15927
15929
  }
15928
15930
  ts.getEmitModuleDetectionKind = getEmitModuleDetectionKind;
15929
15931
  function hasJsonModuleEmitEnabled(options) {
@@ -34266,7 +34268,7 @@ var ts;
34266
34268
  }
34267
34269
  if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
34268
34270
  return {
34269
- key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
34271
+ key: ts.removeTrailingDirectorySeparator(useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec)),
34270
34272
  flags: 1
34271
34273
  };
34272
34274
  }
@@ -35199,15 +35201,19 @@ var ts;
35199
35201
  function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
35200
35202
  return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
35201
35203
  }
35202
- function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
35203
- var containingDirectory = ts.getDirectoryPath(containingFile);
35204
- var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
35205
- return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions, redirectedReference);
35206
- }
35207
35204
  var jsOnlyExtensions = [Extensions.JavaScript];
35208
35205
  var tsExtensions = [Extensions.TypeScript, Extensions.JavaScript];
35209
35206
  var tsPlusJsonExtensions = __spreadArray(__spreadArray([], tsExtensions, true), [Extensions.Json], false);
35210
35207
  var tsconfigExtensions = [Extensions.TSConfig];
35208
+ function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
35209
+ var containingDirectory = ts.getDirectoryPath(containingFile);
35210
+ var esmMode = resolutionMode === ts.ModuleKind.ESNext ? NodeResolutionFeatures.EsmMode : 0;
35211
+ var extensions = compilerOptions.noDtsResolution ? [Extensions.TsOnly, Extensions.JavaScript] : tsExtensions;
35212
+ if (compilerOptions.resolveJsonModule) {
35213
+ extensions = __spreadArray(__spreadArray([], extensions, true), [Extensions.Json], false);
35214
+ }
35215
+ return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference);
35216
+ }
35211
35217
  function tryResolveJSModuleWorker(moduleName, initialDir, host) {
35212
35218
  return nodeModuleNameResolverWorker(NodeResolutionFeatures.None, moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, undefined, jsOnlyExtensions, undefined);
35213
35219
  }
@@ -38487,12 +38493,14 @@ var ts;
38487
38493
  }
38488
38494
  }
38489
38495
  function setCommonJsModuleIndicator(node) {
38490
- if (file.externalModuleIndicator) {
38496
+ if (file.externalModuleIndicator && file.externalModuleIndicator !== true) {
38491
38497
  return false;
38492
38498
  }
38493
38499
  if (!file.commonJsModuleIndicator) {
38494
38500
  file.commonJsModuleIndicator = node;
38495
- bindSourceFileAsExternalModule();
38501
+ if (!file.externalModuleIndicator) {
38502
+ bindSourceFileAsExternalModule();
38503
+ }
38496
38504
  }
38497
38505
  return true;
38498
38506
  }
@@ -38845,7 +38853,11 @@ var ts;
38845
38853
  checkStrictModeEvalOrArguments(node, node.name);
38846
38854
  }
38847
38855
  if (!ts.isBindingPattern(node.name)) {
38848
- if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node) && !(ts.getCombinedModifierFlags(node) & 1)) {
38856
+ var possibleVariableDecl = node.kind === 254 ? node : node.parent.parent;
38857
+ if (ts.isInJSFile(node) &&
38858
+ ts.isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) &&
38859
+ !ts.getJSDocTypeTag(node) &&
38860
+ !(ts.getCombinedModifierFlags(node) & 1)) {
38849
38861
  declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
38850
38862
  }
38851
38863
  else if (ts.isBlockOrCatchScoped(node)) {
@@ -39743,6 +39755,7 @@ var ts;
39743
39755
  var emptyTypeLiteralSymbol = createSymbol(2048, "__type");
39744
39756
  emptyTypeLiteralSymbol.members = ts.createSymbolTable();
39745
39757
  var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
39758
+ var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray)]) : unknownType;
39746
39759
  var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
39747
39760
  emptyGenericType.instantiations = new ts.Map();
39748
39761
  var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
@@ -41158,7 +41171,8 @@ var ts;
41158
41171
  && isAliasableOrJsExpression(node.parent.right)
41159
41172
  || node.kind === 297
41160
41173
  || node.kind === 296 && isAliasableOrJsExpression(node.initializer)
41161
- || ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
41174
+ || node.kind === 254 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)
41175
+ || node.kind === 203 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
41162
41176
  }
41163
41177
  function isAliasableOrJsExpression(e) {
41164
41178
  return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
@@ -41239,7 +41253,7 @@ var ts;
41239
41253
  if (!ts.isSourceFileJS(file)) {
41240
41254
  return hasExportAssignmentSymbol(moduleSymbol);
41241
41255
  }
41242
- return !file.externalModuleIndicator && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), undefined, dontResolveAlias);
41256
+ return typeof file.externalModuleIndicator !== "object" && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), undefined, dontResolveAlias);
41243
41257
  }
41244
41258
  function getTargetOfImportClause(node, dontResolveAlias) {
41245
41259
  var _a;
@@ -48551,7 +48565,7 @@ var ts;
48551
48565
  }
48552
48566
  }
48553
48567
  }
48554
- else if (t.flags & 469892092) {
48568
+ else if (t.flags & 469892092 || isEmptyAnonymousObjectType(t)) {
48555
48569
  hasDisjointDomainType = true;
48556
48570
  }
48557
48571
  }
@@ -48559,7 +48573,7 @@ var ts;
48559
48573
  if (hasDisjointDomainType) {
48560
48574
  for (var _a = 0, types_6 = types; _a < types_6.length; _a++) {
48561
48575
  var t = types_6[_a];
48562
- if (t.flags & 469892092) {
48576
+ if (t.flags & 469892092 || isEmptyAnonymousObjectType(t)) {
48563
48577
  constraints = ts.append(constraints, t);
48564
48578
  }
48565
48579
  }
@@ -50829,7 +50843,7 @@ var ts;
50829
50843
  }
50830
50844
  return includes;
50831
50845
  }
50832
- function removeRedundantPrimitiveTypes(types, includes) {
50846
+ function removeRedundantSupertypes(types, includes) {
50833
50847
  var i = types.length;
50834
50848
  while (i > 0) {
50835
50849
  i--;
@@ -50837,7 +50851,9 @@ var ts;
50837
50851
  var remove = t.flags & 4 && includes & (128 | 134217728 | 268435456) ||
50838
50852
  t.flags & 8 && includes & 256 ||
50839
50853
  t.flags & 64 && includes & 2048 ||
50840
- t.flags & 4096 && includes & 8192;
50854
+ t.flags & 4096 && includes & 8192 ||
50855
+ t.flags & 16384 && includes & 32768 ||
50856
+ isEmptyAnonymousObjectType(t) && includes & 470302716;
50841
50857
  if (remove) {
50842
50858
  ts.orderedRemoveItemAt(types, i);
50843
50859
  }
@@ -50932,7 +50948,7 @@ var ts;
50932
50948
  result.aliasTypeArguments = aliasTypeArguments;
50933
50949
  return result;
50934
50950
  }
50935
- function getIntersectionType(types, aliasSymbol, aliasTypeArguments) {
50951
+ function getIntersectionType(types, aliasSymbol, aliasTypeArguments, noSupertypeReduction) {
50936
50952
  var typeMembershipMap = new ts.Map();
50937
50953
  var includes = addTypesToIntersection(typeMembershipMap, 0, types);
50938
50954
  var typeSet = ts.arrayFrom(typeMembershipMap.values());
@@ -50960,11 +50976,11 @@ var ts;
50960
50976
  if (includes & 4 && includes & (128 | 134217728 | 268435456) ||
50961
50977
  includes & 8 && includes & 256 ||
50962
50978
  includes & 64 && includes & 2048 ||
50963
- includes & 4096 && includes & 8192) {
50964
- removeRedundantPrimitiveTypes(typeSet, includes);
50965
- }
50966
- if (includes & 16777216 && includes & 524288) {
50967
- ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
50979
+ includes & 4096 && includes & 8192 ||
50980
+ includes & 16384 && includes & 32768 ||
50981
+ includes & 16777216 && includes & 470302716) {
50982
+ if (!noSupertypeReduction)
50983
+ removeRedundantSupertypes(typeSet, includes);
50968
50984
  }
50969
50985
  if (includes & 262144) {
50970
50986
  typeSet[typeSet.indexOf(undefinedType)] = missingType;
@@ -50996,7 +51012,7 @@ var ts;
50996
51012
  return errorType;
50997
51013
  }
50998
51014
  var constituents = getCrossProductIntersections(typeSet);
50999
- var origin = ts.some(constituents, function (t) { return !!(t.flags & 2097152); }) ? createOriginUnionOrIntersectionType(2097152, typeSet) : undefined;
51015
+ var origin = ts.some(constituents, function (t) { return !!(t.flags & 2097152); }) && getConstituentCountOfTypes(constituents) > getConstituentCountOfTypes(typeSet) ? createOriginUnionOrIntersectionType(2097152, typeSet) : undefined;
51000
51016
  result = getUnionType(constituents, 1, aliasSymbol, aliasTypeArguments, origin);
51001
51017
  }
51002
51018
  }
@@ -51039,11 +51055,21 @@ var ts;
51039
51055
  }
51040
51056
  return intersections;
51041
51057
  }
51058
+ function getConstituentCount(type) {
51059
+ return !(type.flags & 3145728) || type.aliasSymbol ? 1 :
51060
+ type.flags & 1048576 && type.origin ? getConstituentCount(type.origin) :
51061
+ getConstituentCountOfTypes(type.types);
51062
+ }
51063
+ function getConstituentCountOfTypes(types) {
51064
+ return ts.reduceLeft(types, function (n, t) { return n + getConstituentCount(t); }, 0);
51065
+ }
51042
51066
  function getTypeFromIntersectionTypeNode(node) {
51043
51067
  var links = getNodeLinks(node);
51044
51068
  if (!links.resolvedType) {
51045
51069
  var aliasSymbol = getAliasSymbolForTypeNode(node);
51046
- links.resolvedType = getIntersectionType(ts.map(node.types, getTypeFromTypeNode), aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol));
51070
+ var types = ts.map(node.types, getTypeFromTypeNode);
51071
+ var noSupertypeReduction = types.length === 2 && !!(types[0].flags & (4 | 8 | 64)) && types[1] === emptyTypeLiteralType;
51072
+ links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
51047
51073
  }
51048
51074
  return links.resolvedType;
51049
51075
  }
@@ -53522,6 +53548,17 @@ var ts;
53522
53548
  return !!(ts.getObjectFlags(type) & 16 && (type.members && isEmptyResolvedType(type) ||
53523
53549
  type.symbol && type.symbol.flags & 2048 && getMembersOfSymbol(type.symbol).size === 0));
53524
53550
  }
53551
+ function isUnknownLikeUnionType(type) {
53552
+ if (strictNullChecks && type.flags & 1048576) {
53553
+ if (!(type.objectFlags & 33554432)) {
53554
+ var types = type.types;
53555
+ type.objectFlags |= 33554432 | (types.length >= 3 && types[0].flags & 32768 &&
53556
+ types[1].flags & 65536 && ts.some(types, isEmptyAnonymousObjectType) ? 67108864 : 0);
53557
+ }
53558
+ return !!(type.objectFlags & 67108864);
53559
+ }
53560
+ return false;
53561
+ }
53525
53562
  function isStringIndexSignatureOnlyType(type) {
53526
53563
  return type.flags & 524288 && !isGenericMappedType(type) && getPropertiesOfType(type).length === 0 && getIndexInfosOfType(type).length === 1 && !!getIndexInfoOfType(type, stringType) ||
53527
53564
  type.flags & 3145728 && ts.every(type.types, isStringIndexSignatureOnlyType) ||
@@ -53599,13 +53636,15 @@ var ts;
53599
53636
  return true;
53600
53637
  if (s & 65536 && (!strictNullChecks && !(t & 3145728) || t & 65536))
53601
53638
  return true;
53602
- if (s & 524288 && t & 67108864)
53639
+ if (s & 524288 && t & 67108864 && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source)))
53603
53640
  return true;
53604
53641
  if (relation === assignableRelation || relation === comparableRelation) {
53605
53642
  if (s & 1)
53606
53643
  return true;
53607
53644
  if (s & (8 | 256) && !(s & 1024) && (t & 32 || relation === assignableRelation && t & 256 && t & 1024))
53608
53645
  return true;
53646
+ if (isUnknownLikeUnionType(target))
53647
+ return true;
53609
53648
  }
53610
53649
  return false;
53611
53650
  }
@@ -53647,16 +53686,27 @@ var ts;
53647
53686
  function getNormalizedType(type, writing) {
53648
53687
  while (true) {
53649
53688
  var t = isFreshLiteralType(type) ? type.regularType :
53650
- ts.getObjectFlags(type) & 4 && type.node ? createTypeReference(type.target, getTypeArguments(type)) :
53651
- type.flags & 3145728 ? getReducedType(type) :
53689
+ ts.getObjectFlags(type) & 4 ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type :
53690
+ type.flags & 3145728 ? getNormalizedUnionOrIntersectionType(type, writing) :
53652
53691
  type.flags & 33554432 ? writing ? type.baseType : type.substitute :
53653
53692
  type.flags & 25165824 ? getSimplifiedType(type, writing) :
53654
53693
  type;
53655
- t = getSingleBaseForNonAugmentingSubtype(t) || t;
53656
53694
  if (t === type)
53657
- break;
53695
+ return t;
53658
53696
  type = t;
53659
53697
  }
53698
+ }
53699
+ function getNormalizedUnionOrIntersectionType(type, writing) {
53700
+ var reduced = getReducedType(type);
53701
+ if (reduced !== type) {
53702
+ return reduced;
53703
+ }
53704
+ if (type.flags & 2097152) {
53705
+ var normalizedTypes = ts.sameMap(type.types, function (t) { return getNormalizedType(t, writing); });
53706
+ if (normalizedTypes !== type.types) {
53707
+ return getIntersectionType(normalizedTypes);
53708
+ }
53709
+ }
53660
53710
  return type;
53661
53711
  }
53662
53712
  function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain, errorOutputContainer) {
@@ -54031,6 +54081,7 @@ var ts;
54031
54081
  return 0;
54032
54082
  }
54033
54083
  function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
54084
+ var _a, _b;
54034
54085
  var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
54035
54086
  var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
54036
54087
  source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
@@ -54069,6 +54120,9 @@ var ts;
54069
54120
  return;
54070
54121
  }
54071
54122
  reportRelationError(headMessage, source, target);
54123
+ if (strictNullChecks && source.flags & 8650752 && ((_b = (_a = source.symbol) === null || _a === void 0 ? void 0 : _a.declarations) === null || _b === void 0 ? void 0 : _b[0]) && !getConstraintOfType(source) && isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864))) {
54124
+ associateRelatedInfo(ts.createDiagnosticForNode(source.symbol.declarations[0], ts.Diagnostics.This_type_parameter_probably_needs_an_extends_object_constraint));
54125
+ }
54072
54126
  }
54073
54127
  function traceUnionsOrIntersectionsTooLarge(source, target) {
54074
54128
  if (!ts.tracing) {
@@ -54710,12 +54764,6 @@ var ts;
54710
54764
  if (sourceFlags & 8650752) {
54711
54765
  if (!(sourceFlags & 8388608 && targetFlags & 8388608)) {
54712
54766
  var constraint = getConstraintOfType(source) || unknownType;
54713
- if (!getConstraintOfType(source) || (sourceFlags & 262144 && constraint.flags & 1)) {
54714
- if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
54715
- resetErrorInfo(saveErrorInfo);
54716
- return result;
54717
- }
54718
- }
54719
54767
  if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
54720
54768
  resetErrorInfo(saveErrorInfo);
54721
54769
  return result;
@@ -55971,9 +56019,11 @@ var ts;
55971
56019
  return getSupertypeOrUnion(types);
55972
56020
  }
55973
56021
  var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 98304); });
55974
- return primaryTypes.length ?
55975
- getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 98304) :
55976
- getUnionType(types, 2);
56022
+ if (primaryTypes.length) {
56023
+ var supertypeOrUnion = getSupertypeOrUnion(primaryTypes);
56024
+ return primaryTypes === types ? supertypeOrUnion : getUnionType(__spreadArray([supertypeOrUnion], ts.filter(types, function (t) { return !!(t.flags & 98304); }), true));
56025
+ }
56026
+ return getUnionType(types, 2);
55977
56027
  }
55978
56028
  function getCommonSubtype(types) {
55979
56029
  return ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(t, s) ? t : s; });
@@ -56160,12 +56210,13 @@ var ts;
56160
56210
  return result;
56161
56211
  }
56162
56212
  function getFalsyFlags(type) {
56163
- return type.flags & 1048576 ? getFalsyFlagsOfTypes(type.types) :
56164
- type.flags & 128 ? type.value === "" ? 128 : 0 :
56165
- type.flags & 256 ? type.value === 0 ? 256 : 0 :
56166
- type.flags & 2048 ? isZeroBigInt(type) ? 2048 : 0 :
56167
- type.flags & 512 ? (type === falseType || type === regularFalseType) ? 512 : 0 :
56168
- type.flags & 117724;
56213
+ var t = type.flags & 2097152 ? getBaseConstraintOrType(type) : type;
56214
+ return t.flags & 1048576 ? getFalsyFlagsOfTypes(t.types) :
56215
+ t.flags & 128 ? t.value === "" ? 128 : 0 :
56216
+ t.flags & 256 ? t.value === 0 ? 256 : 0 :
56217
+ t.flags & 2048 ? isZeroBigInt(t) ? 2048 : 0 :
56218
+ t.flags & 512 ? (t === falseType || t === regularFalseType) ? 512 : 0 :
56219
+ t.flags & 117724;
56169
56220
  }
56170
56221
  function removeDefinitelyFalsyTypes(type) {
56171
56222
  return getFalsyFlags(type) & 117632 ?
@@ -56200,16 +56251,19 @@ var ts;
56200
56251
  return type.flags & 32768 ? type : getUnionType([type, isProperty ? missingType : undefinedType]);
56201
56252
  }
56202
56253
  function getGlobalNonNullableTypeInstantiation(type) {
56203
- var reducedType = getTypeWithFacts(type, 2097152);
56204
56254
  if (!deferredGlobalNonNullableTypeAlias) {
56205
56255
  deferredGlobalNonNullableTypeAlias = getGlobalSymbol("NonNullable", 524288, undefined) || unknownSymbol;
56206
56256
  }
56207
56257
  return deferredGlobalNonNullableTypeAlias !== unknownSymbol ?
56208
- getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [reducedType]) :
56209
- reducedType;
56258
+ getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]) :
56259
+ getIntersectionType([type, emptyObjectType]);
56210
56260
  }
56211
56261
  function getNonNullableType(type) {
56212
- return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type;
56262
+ if (strictNullChecks) {
56263
+ var reducedType = getTypeWithFacts(type, 2097152);
56264
+ return maybeTypeOfKind(reducedType, 465829888) ? getGlobalNonNullableTypeInstantiation(reducedType) : reducedType;
56265
+ }
56266
+ return type;
56213
56267
  }
56214
56268
  function addOptionalTypeMarker(type) {
56215
56269
  return strictNullChecks ? getUnionType([type, optionalType]) : type;
@@ -56803,17 +56857,32 @@ var ts;
56803
56857
  return sourceStart.slice(0, startLen) !== targetStart.slice(0, startLen) ||
56804
56858
  sourceEnd.slice(sourceEnd.length - endLen) !== targetEnd.slice(targetEnd.length - endLen);
56805
56859
  }
56806
- function isValidBigIntString(s) {
56860
+ function isValidNumberString(s, roundTripOnly) {
56861
+ if (s === "")
56862
+ return false;
56863
+ var n = +s;
56864
+ return isFinite(n) && (!roundTripOnly || "" + n === s);
56865
+ }
56866
+ function parseBigIntLiteralType(text) {
56867
+ var negative = text.startsWith("-");
56868
+ var base10Value = ts.parsePseudoBigInt((negative ? text.slice(1) : text) + "n");
56869
+ return getBigIntLiteralType({ negative: negative, base10Value: base10Value });
56870
+ }
56871
+ function isValidBigIntString(s, roundTripOnly) {
56872
+ if (s === "")
56873
+ return false;
56807
56874
  var scanner = ts.createScanner(99, false);
56808
56875
  var success = true;
56809
56876
  scanner.setOnError(function () { return success = false; });
56810
56877
  scanner.setText(s + "n");
56811
56878
  var result = scanner.scan();
56812
- if (result === 40) {
56879
+ var negative = result === 40;
56880
+ if (negative) {
56813
56881
  result = scanner.scan();
56814
56882
  }
56815
56883
  var flags = scanner.getTokenFlags();
56816
- return success && result === 9 && scanner.getTextPos() === (s.length + 1) && !(flags & 512);
56884
+ return success && result === 9 && scanner.getTextPos() === (s.length + 1) && !(flags & 512)
56885
+ && (!roundTripOnly || s === ts.pseudoBigIntToString({ negative: negative, base10Value: ts.parsePseudoBigInt(scanner.getTokenValue()) }));
56817
56886
  }
56818
56887
  function isValidTypeForTemplateLiteralPlaceholder(source, target) {
56819
56888
  if (source === target || target.flags & (1 | 4)) {
@@ -56821,8 +56890,8 @@ var ts;
56821
56890
  }
56822
56891
  if (source.flags & 128) {
56823
56892
  var value = source.value;
56824
- return !!(target.flags & 8 && value !== "" && isFinite(+value) ||
56825
- target.flags & 64 && value !== "" && isValidBigIntString(value) ||
56893
+ return !!(target.flags & 8 && isValidNumberString(value, false) ||
56894
+ target.flags & 64 && isValidBigIntString(value, false) ||
56826
56895
  target.flags & (512 | 98304) && value === target.intrinsicName);
56827
56896
  }
56828
56897
  if (source.flags & 134217728) {
@@ -57287,8 +57356,51 @@ var ts;
57287
57356
  var matches = inferTypesFromTemplateLiteralType(source, target);
57288
57357
  var types = target.types;
57289
57358
  if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
57359
+ var _loop_23 = function (i) {
57360
+ var source_1 = matches ? matches[i] : neverType;
57361
+ var target_3 = types[i];
57362
+ if (source_1.flags & 128 && target_3.flags & 8650752) {
57363
+ var inferenceContext = getInferenceInfoForType(target_3);
57364
+ var constraint = inferenceContext ? getBaseConstraintOfType(inferenceContext.typeParameter) : undefined;
57365
+ if (constraint && !isTypeAny(constraint)) {
57366
+ var constraintTypes = constraint.flags & 1048576 ? constraint.types : [constraint];
57367
+ var allTypeFlags_1 = ts.reduceLeft(constraintTypes, function (flags, t) { return flags | t.flags; }, 0);
57368
+ if (!(allTypeFlags_1 & 4)) {
57369
+ var str_1 = source_1.value;
57370
+ if (allTypeFlags_1 & 296 && !isValidNumberString(str_1, true)) {
57371
+ allTypeFlags_1 &= ~296;
57372
+ }
57373
+ if (allTypeFlags_1 & 2112 && !isValidBigIntString(str_1, true)) {
57374
+ allTypeFlags_1 &= ~2112;
57375
+ }
57376
+ var matchingType = ts.reduceLeft(constraintTypes, function (left, right) {
57377
+ return !(right.flags & allTypeFlags_1) ? left :
57378
+ left.flags & 4 ? left : right.flags & 4 ? source_1 :
57379
+ left.flags & 134217728 ? left : right.flags & 134217728 && isTypeMatchedByTemplateLiteralType(source_1, right) ? source_1 :
57380
+ left.flags & 268435456 ? left : right.flags & 268435456 && str_1 === applyStringMapping(right.symbol, str_1) ? source_1 :
57381
+ left.flags & 128 ? left : right.flags & 128 && right.value === str_1 ? right :
57382
+ left.flags & 8 ? left : right.flags & 8 ? getNumberLiteralType(+str_1) :
57383
+ left.flags & 32 ? left : right.flags & 32 ? getNumberLiteralType(+str_1) :
57384
+ left.flags & 256 ? left : right.flags & 256 && right.value === +str_1 ? right :
57385
+ left.flags & 64 ? left : right.flags & 64 ? parseBigIntLiteralType(str_1) :
57386
+ left.flags & 2048 ? left : right.flags & 2048 && ts.pseudoBigIntToString(right.value) === str_1 ? right :
57387
+ left.flags & 16 ? left : right.flags & 16 ? str_1 === "true" ? trueType : str_1 === "false" ? falseType : booleanType :
57388
+ left.flags & 512 ? left : right.flags & 512 && right.intrinsicName === str_1 ? right :
57389
+ left.flags & 32768 ? left : right.flags & 32768 && right.intrinsicName === str_1 ? right :
57390
+ left.flags & 65536 ? left : right.flags & 65536 && right.intrinsicName === str_1 ? right :
57391
+ left;
57392
+ }, neverType);
57393
+ if (!(matchingType.flags & 131072)) {
57394
+ inferFromTypes(matchingType, target_3);
57395
+ return "continue";
57396
+ }
57397
+ }
57398
+ }
57399
+ }
57400
+ inferFromTypes(source_1, target_3);
57401
+ };
57290
57402
  for (var i = 0; i < types.length; i++) {
57291
- inferFromTypes(matches ? matches[i] : neverType, types[i]);
57403
+ _loop_23(i);
57292
57404
  }
57293
57405
  }
57294
57406
  }
@@ -57758,7 +57870,7 @@ var ts;
57758
57870
  function mapTypesByKeyProperty(types, name) {
57759
57871
  var map = new ts.Map();
57760
57872
  var count = 0;
57761
- var _loop_23 = function (type) {
57873
+ var _loop_24 = function (type) {
57762
57874
  if (type.flags & (524288 | 2097152 | 58982400)) {
57763
57875
  var discriminant = getTypeOfPropertyOfType(type, name);
57764
57876
  if (discriminant) {
@@ -57784,7 +57896,7 @@ var ts;
57784
57896
  };
57785
57897
  for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
57786
57898
  var type = types_16[_i];
57787
- var state_9 = _loop_23(type);
57899
+ var state_9 = _loop_24(type);
57788
57900
  if (typeof state_9 === "object")
57789
57901
  return state_9.value;
57790
57902
  }
@@ -57972,6 +58084,24 @@ var ts;
57972
58084
  function getTypeWithFacts(type, include) {
57973
58085
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
57974
58086
  }
58087
+ function getIntersectionWithFacts(type, facts) {
58088
+ var reduced = recombineUnknownType(getTypeWithFacts(strictNullChecks && type.flags & 2 ? unknownUnionType : type, facts));
58089
+ if (strictNullChecks) {
58090
+ switch (facts) {
58091
+ case 524288:
58092
+ return mapType(reduced, function (t) { return getTypeFacts(t) & 65536 ? getIntersectionType([t, getTypeFacts(t) & 131072 && !maybeTypeOfKind(reduced, 65536) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t; });
58093
+ case 1048576:
58094
+ return mapType(reduced, function (t) { return getTypeFacts(t) & 131072 ? getIntersectionType([t, getTypeFacts(t) & 65536 && !maybeTypeOfKind(reduced, 32768) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t; });
58095
+ case 2097152:
58096
+ case 4194304:
58097
+ return mapType(reduced, function (t) { return getTypeFacts(t) & 262144 ? getGlobalNonNullableTypeInstantiation(t) : t; });
58098
+ }
58099
+ }
58100
+ return reduced;
58101
+ }
58102
+ function recombineUnknownType(type) {
58103
+ return type === unknownUnionType ? unknownType : type;
58104
+ }
57975
58105
  function getTypeWithDefault(type, defaultExpression) {
57976
58106
  return defaultExpression ?
57977
58107
  getUnionType([getNonUndefinedType(type), getTypeOfExpression(defaultExpression)]) :
@@ -58912,7 +59042,7 @@ var ts;
58912
59042
  if (isEvolvingArrayTypeList(types)) {
58913
59043
  return getEvolvingArrayType(getUnionType(ts.map(types, getElementTypeOfEvolvingArrayType)));
58914
59044
  }
58915
- var result = getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction);
59045
+ var result = recombineUnknownType(getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction));
58916
59046
  if (result !== declaredType && result.flags & declaredType.flags & 1048576 && ts.arraysEqual(result.types, declaredType.types)) {
58917
59047
  return declaredType;
58918
59048
  }
@@ -59008,8 +59138,7 @@ var ts;
59008
59138
  }
59009
59139
  function narrowTypeByTruthiness(type, expr, assumeTrue) {
59010
59140
  if (isMatchingReference(reference, expr)) {
59011
- return type.flags & 2 && assumeTrue ? nonNullUnknownType :
59012
- getTypeWithFacts(type, assumeTrue ? 4194304 : 8388608);
59141
+ return getIntersectionWithFacts(type, assumeTrue ? 4194304 : 8388608);
59013
59142
  }
59014
59143
  if (strictNullChecks && assumeTrue && optionalChainContainsReference(expr, reference)) {
59015
59144
  type = getTypeWithFacts(type, 2097152);
@@ -59149,9 +59278,6 @@ var ts;
59149
59278
  assumeTrue = !assumeTrue;
59150
59279
  }
59151
59280
  var valueType = getTypeOfExpression(value);
59152
- if (assumeTrue && (type.flags & 2) && (operator === 34 || operator === 35) && (valueType.flags & 65536)) {
59153
- return getUnionType([nullType, undefinedType]);
59154
- }
59155
59281
  if ((type.flags & 2) && assumeTrue && (operator === 36 || operator === 37)) {
59156
59282
  if (valueType.flags & (131068 | 67108864)) {
59157
59283
  return valueType;
@@ -59171,7 +59297,7 @@ var ts;
59171
59297
  valueType.flags & 65536 ?
59172
59298
  assumeTrue ? 131072 : 1048576 :
59173
59299
  assumeTrue ? 65536 : 524288;
59174
- return type.flags & 2 && facts & (1048576 | 2097152) ? nonNullUnknownType : getTypeWithFacts(type, facts);
59300
+ return getIntersectionWithFacts(type, facts);
59175
59301
  }
59176
59302
  if (assumeTrue) {
59177
59303
  var filterFn = operator === 34 ?
@@ -59198,14 +59324,11 @@ var ts;
59198
59324
  if (type.flags & 1 && literal.text === "function") {
59199
59325
  return type;
59200
59326
  }
59201
- if (assumeTrue && type.flags & 2 && literal.text === "object") {
59202
- return type === nonNullUnknownType ? nonPrimitiveType : getUnionType([nonPrimitiveType, nullType]);
59203
- }
59204
59327
  var facts = assumeTrue ?
59205
59328
  typeofEQFacts.get(literal.text) || 128 :
59206
59329
  typeofNEFacts.get(literal.text) || 32768;
59207
59330
  var impliedType = getImpliedTypeFromTypeofGuard(type, literal.text);
59208
- return getTypeWithFacts(assumeTrue && impliedType ? mapType(type, narrowUnionMemberByTypeof(impliedType)) : type, facts);
59331
+ return getTypeWithFacts(assumeTrue && impliedType ? narrowTypeByImpliedType(type, impliedType) : type, facts);
59209
59332
  }
59210
59333
  function narrowTypeBySwitchOptionalChainContainment(type, switchStatement, clauseStart, clauseEnd, clauseCheck) {
59211
59334
  var everyClauseChecks = clauseStart !== clauseEnd && ts.every(getSwitchClauseTypes(switchStatement).slice(clauseStart, clauseEnd), clauseCheck);
@@ -59250,30 +59373,35 @@ var ts;
59250
59373
  }
59251
59374
  function getImpliedTypeFromTypeofGuard(type, text) {
59252
59375
  switch (text) {
59376
+ case "object":
59377
+ return type.flags & 1 ? type : getUnionType([nullType, nonPrimitiveType]);
59253
59378
  case "function":
59254
59379
  return type.flags & 1 ? type : globalFunctionType;
59255
- case "object":
59256
- return type.flags & 2 ? getUnionType([nonPrimitiveType, nullType]) : type;
59257
59380
  default:
59258
59381
  return typeofTypesByName.get(text);
59259
59382
  }
59260
59383
  }
59261
- function narrowUnionMemberByTypeof(candidate) {
59262
- return function (type) {
59263
- if (isTypeSubtypeOf(type, candidate)) {
59264
- return type;
59265
- }
59266
- if (isTypeSubtypeOf(candidate, type)) {
59267
- return candidate;
59384
+ function narrowTypeByImpliedType(type, candidate) {
59385
+ if (type.flags & 3) {
59386
+ return candidate;
59387
+ }
59388
+ return mapType(type, function (t) {
59389
+ if (isTypeRelatedTo(t, candidate, strictSubtypeRelation)) {
59390
+ return t;
59268
59391
  }
59269
- if (type.flags & 465829888) {
59270
- var constraint = getBaseConstraintOfType(type) || anyType;
59271
- if (isTypeSubtypeOf(candidate, constraint)) {
59272
- return getIntersectionType([type, candidate]);
59392
+ return mapType(candidate, function (c) {
59393
+ if (!areTypesComparable(t, c)) {
59394
+ return neverType;
59273
59395
  }
59274
- }
59275
- return type;
59276
- };
59396
+ if (c.flags & 131068 && t.flags & 524288 && !isEmptyAnonymousObjectType(t)) {
59397
+ return isTypeSubtypeOf(c, t) ? c : neverType;
59398
+ }
59399
+ if (c === globalFunctionType && isTypeSubtypeOf(c, t)) {
59400
+ return c;
59401
+ }
59402
+ return getIntersectionType([t, c]);
59403
+ });
59404
+ });
59277
59405
  }
59278
59406
  function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
59279
59407
  var switchWitnesses = getSwitchClauseTypeOfWitnesses(switchStatement, true);
@@ -59299,7 +59427,7 @@ var ts;
59299
59427
  return filterType(type, function (t) { return (getTypeFacts(t) & switchFacts) === switchFacts; });
59300
59428
  }
59301
59429
  var impliedType = getTypeWithFacts(getUnionType(clauseWitnesses.map(function (text) { return getImpliedTypeFromTypeofGuard(type, text) || type; })), switchFacts);
59302
- return getTypeWithFacts(mapType(type, narrowUnionMemberByTypeof(impliedType)), switchFacts);
59430
+ return getTypeWithFacts(narrowTypeByImpliedType(type, impliedType), switchFacts);
59303
59431
  }
59304
59432
  function isMatchingConstructorReference(expr) {
59305
59433
  return (ts.isPropertyAccessExpression(expr) && ts.idText(expr.name) === "constructor" ||
@@ -59560,7 +59688,9 @@ var ts;
59560
59688
  !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
59561
59689
  }
59562
59690
  function isGenericTypeWithUnionConstraint(type) {
59563
- return !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
59691
+ return type.flags & 2097152 ?
59692
+ ts.some(type.types, isGenericTypeWithUnionConstraint) :
59693
+ !!(type.flags & 465829888 && getBaseConstraintOrType(type).flags & (98304 | 1048576));
59564
59694
  }
59565
59695
  function isGenericTypeWithoutNullableConstraint(type) {
59566
59696
  return !!(type.flags & 465829888 && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304));
@@ -59577,7 +59707,7 @@ var ts;
59577
59707
  var substituteConstraints = !(checkMode && checkMode & 2) &&
59578
59708
  someType(type, isGenericTypeWithUnionConstraint) &&
59579
59709
  (isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
59580
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 ? getBaseConstraintOrType(t) : t; }) : type;
59710
+ return substituteConstraints ? mapType(type, getBaseConstraintOrType) : type;
59581
59711
  }
59582
59712
  function isExportOrExportExpression(location) {
59583
59713
  return !!ts.findAncestor(location, function (n) {
@@ -63207,7 +63337,7 @@ var ts;
63207
63337
  var spreadIndex = getSpreadArgumentIndex(args);
63208
63338
  if (spreadIndex >= 0) {
63209
63339
  var effectiveArgs_1 = args.slice(0, spreadIndex);
63210
- var _loop_24 = function (i) {
63340
+ var _loop_25 = function (i) {
63211
63341
  var arg = args[i];
63212
63342
  var spreadType = arg.kind === 225 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
63213
63343
  if (spreadType && isTupleType(spreadType)) {
@@ -63223,7 +63353,7 @@ var ts;
63223
63353
  }
63224
63354
  };
63225
63355
  for (var i = spreadIndex; i < args.length; i++) {
63226
- _loop_24(i);
63356
+ _loop_25(i);
63227
63357
  }
63228
63358
  return effectiveArgs_1;
63229
63359
  }
@@ -63471,7 +63601,7 @@ var ts;
63471
63601
  var min_3 = Number.MAX_VALUE;
63472
63602
  var minIndex = 0;
63473
63603
  var i_1 = 0;
63474
- var _loop_25 = function (c) {
63604
+ var _loop_26 = function (c) {
63475
63605
  var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
63476
63606
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
63477
63607
  if (diags_2) {
@@ -63489,7 +63619,7 @@ var ts;
63489
63619
  };
63490
63620
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
63491
63621
  var c = candidatesForArgumentError_1[_a];
63492
- _loop_25(c);
63622
+ _loop_26(c);
63493
63623
  }
63494
63624
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
63495
63625
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -63632,7 +63762,7 @@ var ts;
63632
63762
  }
63633
63763
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
63634
63764
  var parameters = [];
63635
- var _loop_26 = function (i) {
63765
+ var _loop_27 = function (i) {
63636
63766
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
63637
63767
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
63638
63768
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -63640,7 +63770,7 @@ var ts;
63640
63770
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
63641
63771
  };
63642
63772
  for (var i = 0; i < maxNonRestParam; i++) {
63643
- _loop_26(i);
63773
+ _loop_27(i);
63644
63774
  }
63645
63775
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
63646
63776
  var flags = 0;
@@ -65616,11 +65746,6 @@ var ts;
65616
65746
  ts.every(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :
65617
65747
  isTypeAssignableToKind(source, kind, strict);
65618
65748
  }
65619
- function anyTypesAssignableToKind(source, kind, strict) {
65620
- return source.flags & 1048576 ?
65621
- ts.some(source.types, function (subType) { return allTypesAssignableToKind(subType, kind, strict); }) :
65622
- isTypeAssignableToKind(source, kind, strict);
65623
- }
65624
65749
  function isConstEnumObjectType(type) {
65625
65750
  return !!(ts.getObjectFlags(type) & 16) && !!type.symbol && isConstEnumSymbol(type.symbol);
65626
65751
  }
@@ -67241,7 +67366,7 @@ var ts;
67241
67366
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
67242
67367
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
67243
67368
  var indexSignatureMap_1 = new ts.Map();
67244
- var _loop_27 = function (declaration) {
67369
+ var _loop_28 = function (declaration) {
67245
67370
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
67246
67371
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
67247
67372
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -67256,7 +67381,7 @@ var ts;
67256
67381
  };
67257
67382
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
67258
67383
  var declaration = _a[_i];
67259
- _loop_27(declaration);
67384
+ _loop_28(declaration);
67260
67385
  }
67261
67386
  indexSignatureMap_1.forEach(function (entry) {
67262
67387
  if (entry.declarations.length > 1) {
@@ -69058,7 +69183,7 @@ var ts;
69058
69183
  }
69059
69184
  if (ts.isBindingPattern(node.name)) {
69060
69185
  var needCheckInitializer = node.initializer && node.parent.parent.kind !== 243;
69061
- var needCheckWidenedType = node.name.elements.length === 0;
69186
+ var needCheckWidenedType = !ts.some(node.name.elements, ts.not(ts.isOmittedExpression));
69062
69187
  if (needCheckInitializer || needCheckWidenedType) {
69063
69188
  var widenedType = getWidenedTypeForVariableLikeDeclaration(node);
69064
69189
  if (needCheckInitializer) {
@@ -69082,7 +69207,7 @@ var ts;
69082
69207
  return;
69083
69208
  }
69084
69209
  var symbol = getSymbolOfNode(node);
69085
- if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
69210
+ if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node.kind === 203 ? node.parent.parent : node)) {
69086
69211
  checkAliasSymbol(node);
69087
69212
  return;
69088
69213
  }
@@ -69383,7 +69508,7 @@ var ts;
69383
69508
  checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access);
69384
69509
  }
69385
69510
  }
69386
- if (!isTypeAny(rightType) && !(rightType.flags & 98304) && anyTypesAssignableToKind(getBaseConstraintOrType(rightType), (131068 | 131072) & ~98304)) {
69511
+ if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 | 58982400)) {
69387
69512
  error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType));
69388
69513
  }
69389
69514
  checkSourceElement(node.statement);
@@ -70076,7 +70201,7 @@ var ts;
70076
70201
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 258) : undefined;
70077
70202
  var localPropDeclaration = declaration && declaration.kind === 221 ||
70078
70203
  name && name.kind === 162 || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
70079
- var _loop_28 = function (info) {
70204
+ var _loop_29 = function (info) {
70080
70205
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
70081
70206
  var errorNode = localPropDeclaration || localIndexDeclaration ||
70082
70207
  (interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
@@ -70086,7 +70211,7 @@ var ts;
70086
70211
  };
70087
70212
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
70088
70213
  var info = indexInfos_9[_i];
70089
- _loop_28(info);
70214
+ _loop_29(info);
70090
70215
  }
70091
70216
  }
70092
70217
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -70094,7 +70219,7 @@ var ts;
70094
70219
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
70095
70220
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 258) : undefined;
70096
70221
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
70097
- var _loop_29 = function (info) {
70222
+ var _loop_30 = function (info) {
70098
70223
  if (info === checkInfo)
70099
70224
  return "continue";
70100
70225
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -70106,7 +70231,7 @@ var ts;
70106
70231
  };
70107
70232
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
70108
70233
  var info = indexInfos_10[_i];
70109
- _loop_29(info);
70234
+ _loop_30(info);
70110
70235
  }
70111
70236
  }
70112
70237
  function checkTypeNameIsReserved(name, message) {
@@ -70400,7 +70525,7 @@ var ts;
70400
70525
  var baseTypes = baseTypeNode && getBaseTypes(type);
70401
70526
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
70402
70527
  var baseStaticType = getBaseConstructorTypeOfClass(type);
70403
- var _loop_30 = function (member) {
70528
+ var _loop_31 = function (member) {
70404
70529
  if (ts.hasAmbientModifier(member)) {
70405
70530
  return "continue";
70406
70531
  }
@@ -70415,7 +70540,7 @@ var ts;
70415
70540
  };
70416
70541
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
70417
70542
  var member = _a[_i];
70418
- _loop_30(member);
70543
+ _loop_31(member);
70419
70544
  }
70420
70545
  }
70421
70546
  function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
@@ -70490,7 +70615,7 @@ var ts;
70490
70615
  }
70491
70616
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
70492
70617
  var issuedMemberError = false;
70493
- var _loop_31 = function (member) {
70618
+ var _loop_32 = function (member) {
70494
70619
  if (ts.isStatic(member)) {
70495
70620
  return "continue";
70496
70621
  }
@@ -70508,7 +70633,7 @@ var ts;
70508
70633
  };
70509
70634
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
70510
70635
  var member = _a[_i];
70511
- _loop_31(member);
70636
+ _loop_32(member);
70512
70637
  }
70513
70638
  if (!issuedMemberError) {
70514
70639
  checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
@@ -75638,9 +75763,7 @@ var ts;
75638
75763
  var ts;
75639
75764
  (function (ts) {
75640
75765
  function createSourceMapGenerator(host, file, sourceRoot, sourcesDirectoryPath, generatorOptions) {
75641
- var _a = generatorOptions.extendedDiagnostics
75642
- ? ts.performance.createTimer("Source Map", "beforeSourcemap", "afterSourcemap")
75643
- : ts.performance.nullTimer, enter = _a.enter, exit = _a.exit;
75766
+ var _a = ts.performance.createTimerIf(!!generatorOptions.extendedDiagnostics, "Source Map", "beforeSourcemap", "afterSourcemap"), enter = _a.enter, exit = _a.exit;
75644
75767
  var rawSources = [];
75645
75768
  var sources = [];
75646
75769
  var sourceToSourceIndexMap = new ts.Map();
@@ -101000,7 +101123,7 @@ var ts;
101000
101123
  importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
101001
101124
  });
101002
101125
  var sortedPaths = [];
101003
- var _loop_32 = function (directory) {
101126
+ var _loop_33 = function (directory) {
101004
101127
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
101005
101128
  var pathsInDirectory;
101006
101129
  allFileNames.forEach(function (_a, fileName) {
@@ -101024,7 +101147,7 @@ var ts;
101024
101147
  };
101025
101148
  var out_directory_1;
101026
101149
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
101027
- var state_10 = _loop_32(directory);
101150
+ var state_10 = _loop_33(directory);
101028
101151
  directory = out_directory_1;
101029
101152
  if (state_10 === "break")
101030
101153
  break;
@@ -102350,6 +102473,7 @@ var ts;
102350
102473
  }
102351
102474
  function reloadFileNamesFromConfigFile() {
102352
102475
  writeLog("Reloading new file names and options");
102476
+ reloadLevel = ts.ConfigFileProgramReloadLevel.None;
102353
102477
  rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
102354
102478
  if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
102355
102479
  hasChangedConfigFileParsingErrors = true;
@@ -102789,6 +102913,7 @@ var ts;
102789
102913
  if (value) {
102790
102914
  return isParsedCommandLine(value) ? value : undefined;
102791
102915
  }
102916
+ ts.solutionPerformance.mark("beforeParseConfigFile");
102792
102917
  var diagnostic;
102793
102918
  var parseConfigFileHost = state.parseConfigFileHost, baseCompilerOptions = state.baseCompilerOptions, baseWatchOptions = state.baseWatchOptions, extendedConfigCache = state.extendedConfigCache, host = state.host;
102794
102919
  var parsed;
@@ -102803,6 +102928,8 @@ var ts;
102803
102928
  parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = ts.noop;
102804
102929
  }
102805
102930
  configFileCache.set(configFilePath, parsed || diagnostic);
102931
+ ts.solutionPerformance.mark("afterParseConfigFile");
102932
+ ts.solutionPerformance.measure("ParseConfigFile", "beforeParseConfigFile", "afterParseConfigFile");
102806
102933
  return parsed;
102807
102934
  }
102808
102935
  function resolveProjectName(state, name) {
@@ -102850,6 +102977,7 @@ var ts;
102850
102977
  return state.buildOrder || createStateBuildOrder(state);
102851
102978
  }
102852
102979
  function createStateBuildOrder(state) {
102980
+ ts.solutionPerformance.mark("beforeCreateBuildOrder");
102853
102981
  var buildOrder = createBuildOrder(state, state.rootNames.map(function (f) { return resolveProjectName(state, f); }));
102854
102982
  state.resolvedConfigFilePaths.clear();
102855
102983
  var currentProjects = new ts.Map(getBuildOrderFromAnyBuildOrder(buildOrder).map(function (resolved) { return [toResolvedConfigFilePath(state, resolved), true]; }));
@@ -102875,6 +103003,8 @@ var ts;
102875
103003
  ts.mutateMapSkippingNewValues(state.allWatchedInputFiles, currentProjects, { onDeleteValue: function (existingMap) { return existingMap.forEach(ts.closeFileWatcher); } });
102876
103004
  ts.mutateMapSkippingNewValues(state.allWatchedPackageJsonFiles, currentProjects, { onDeleteValue: function (existingMap) { return existingMap.forEach(ts.closeFileWatcher); } });
102877
103005
  }
103006
+ ts.solutionPerformance.mark("afterCreateBuildOrder");
103007
+ ts.solutionPerformance.measure("CreateBuildOrder", "beforeCreateBuildOrder", "afterCreateBuildOrder");
102878
103008
  return state.buildOrder = buildOrder;
102879
103009
  }
102880
103010
  function getBuildOrderFor(state, project, onlyReferences) {
@@ -102994,6 +103124,7 @@ var ts;
102994
103124
  if (updateOutputFileStampsPending) {
102995
103125
  updateOutputTimestamps(state, config, projectPath);
102996
103126
  }
103127
+ ts.solutionPerformance.mark("timestampUpdated");
102997
103128
  return doneInvalidatedProject(state, projectPath);
102998
103129
  }
102999
103130
  };
@@ -103087,6 +103218,10 @@ var ts;
103087
103218
  };
103088
103219
  function done(cancellationToken, writeFile, customTransformers) {
103089
103220
  executeSteps(BuildStep.Done, cancellationToken, writeFile, customTransformers);
103221
+ if (kind === InvalidatedProjectKind.Build)
103222
+ ts.solutionPerformance.mark("projectsBuilt");
103223
+ else
103224
+ ts.solutionPerformance.mark("bundlesUpdated");
103090
103225
  return doneInvalidatedProject(state, projectPath);
103091
103226
  }
103092
103227
  function withProgramOrUndefined(action) {
@@ -103167,6 +103302,7 @@ var ts;
103167
103302
  var anyDtsChanged = false;
103168
103303
  var emitterDiagnostics = ts.createDiagnosticCollection();
103169
103304
  var emittedOutputs = new ts.Map();
103305
+ ts.solutionPerformance.mark("beforeOutputFilesWrite");
103170
103306
  outputFiles.forEach(function (_a) {
103171
103307
  var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark;
103172
103308
  var priorChangeTime;
@@ -103185,6 +103321,8 @@ var ts;
103185
103321
  newestDeclarationFileContentChangedTime = newer(priorChangeTime, newestDeclarationFileContentChangedTime);
103186
103322
  }
103187
103323
  });
103324
+ ts.solutionPerformance.mark("afterOutputFilesWrite");
103325
+ ts.solutionPerformance.measure("OutputFilesWrite", "beforeOutputFilesWrite", "afterOutputFilesWrite");
103188
103326
  finishEmit(emitterDiagnostics, emittedOutputs, newestDeclarationFileContentChangedTime, anyDtsChanged, outputFiles.length ? outputFiles[0].name : ts.getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()), resultFlags);
103189
103327
  return emitResult;
103190
103328
  }
@@ -103308,6 +103446,13 @@ var ts;
103308
103446
  !ts.isIncrementalCompilation(config.options);
103309
103447
  }
103310
103448
  function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
103449
+ ts.solutionPerformance.mark("beforeGetNextInvalidatedProjectCreateInfo");
103450
+ var result = getNextInvalidatedProjectCreateInfoWorker(state, buildOrder, reportQueue);
103451
+ ts.solutionPerformance.mark("afterGetNextInvalidatedProjectCreateInfo");
103452
+ ts.solutionPerformance.measure("GetNextInvalidatedProjectCreateInfo", "beforeGetNextInvalidatedProjectCreateInfo", "afterGetNextInvalidatedProjectCreateInfo");
103453
+ return result;
103454
+ }
103455
+ function getNextInvalidatedProjectCreateInfoWorker(state, buildOrder, reportQueue) {
103311
103456
  if (!state.projectPendingBuild.size)
103312
103457
  return undefined;
103313
103458
  if (isCircularBuildOrder(buildOrder))
@@ -103403,9 +103548,7 @@ var ts;
103403
103548
  }
103404
103549
  function getNextInvalidatedProject(state, buildOrder, reportQueue) {
103405
103550
  var info = getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue);
103406
- if (!info)
103407
- return info;
103408
- return createInvalidatedProjectWithInfo(state, info, buildOrder);
103551
+ return info && createInvalidatedProjectWithInfo(state, info, buildOrder);
103409
103552
  }
103410
103553
  function listEmittedFile(_a, proj, file) {
103411
103554
  var write = _a.write;
@@ -103413,14 +103556,17 @@ var ts;
103413
103556
  write("TSFILE: " + file);
103414
103557
  }
103415
103558
  }
103416
- function getOldProgram(_a, proj, parsed) {
103417
- var options = _a.options, builderPrograms = _a.builderPrograms, compilerHost = _a.compilerHost;
103418
- if (options.force)
103559
+ function getOldProgram(state, proj, parsed) {
103560
+ if (state.options.force)
103419
103561
  return undefined;
103420
- var value = builderPrograms.get(proj);
103562
+ var value = state.builderPrograms.get(proj);
103421
103563
  if (value)
103422
103564
  return value;
103423
- return ts.readBuilderProgram(parsed.options, compilerHost);
103565
+ ts.solutionPerformance.mark("beforeReadBuilderProgram");
103566
+ var program = ts.readBuilderProgram(parsed.options, state.compilerHost);
103567
+ ts.solutionPerformance.mark("afterReadBuilderProgram");
103568
+ ts.solutionPerformance.measure("ReadBuilderProgram", "beforeReadBuilderProgram", "afterReadBuilderProgram");
103569
+ return program;
103424
103570
  }
103425
103571
  function afterProgramDone(state, program, config) {
103426
103572
  if (program) {
@@ -103593,7 +103739,10 @@ var ts;
103593
103739
  state.buildInfoChecked.set(resolvedPath, true);
103594
103740
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(project.options);
103595
103741
  if (buildInfoPath) {
103742
+ ts.solutionPerformance.mark("beforeBuildInfoRead");
103596
103743
  var value = state.readFileWithCache(buildInfoPath);
103744
+ ts.solutionPerformance.mark("afterBuildInfoRead");
103745
+ ts.solutionPerformance.measure("BuildInfoRead", "beforeBuildInfoRead", "afterBuildInfoRead");
103597
103746
  var buildInfo = value && ts.getBuildInfo(value);
103598
103747
  if (buildInfo && (buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
103599
103748
  return {
@@ -103628,13 +103777,17 @@ var ts;
103628
103777
  if (prior !== undefined) {
103629
103778
  return prior;
103630
103779
  }
103780
+ ts.solutionPerformance.mark("beforeGetUpToDateStatus");
103631
103781
  var actual = getUpToDateStatusWorker(state, project, resolvedPath);
103782
+ ts.solutionPerformance.mark("afterGetUpToDateStatus");
103783
+ ts.solutionPerformance.measure("GetUpToDateStatus", "beforeGetUpToDateStatus", "afterGetUpToDateStatus");
103632
103784
  state.projectStatus.set(resolvedPath, actual);
103633
103785
  return actual;
103634
103786
  }
103635
103787
  function updateOutputTimestampsWorker(state, proj, priorNewestUpdateTime, verboseMessage, skipOutputs) {
103636
103788
  if (proj.options.noEmit)
103637
103789
  return priorNewestUpdateTime;
103790
+ ts.solutionPerformance.mark("beforeUpdateOutputTimestamps");
103638
103791
  var host = state.host;
103639
103792
  var outputs = ts.getAllProjectOutputs(proj, !host.useCaseSensitiveFileNames());
103640
103793
  if (!skipOutputs || outputs.length !== skipOutputs.size) {
@@ -103655,6 +103808,8 @@ var ts;
103655
103808
  host.setModifiedTime(file, now);
103656
103809
  }
103657
103810
  }
103811
+ ts.solutionPerformance.mark("afterUpdateOutputTimestamps");
103812
+ ts.solutionPerformance.measure("UpdateOutputTimestamps", "beforeUpdateOutputTimestamps", "afterUpdateOutputTimestamps");
103658
103813
  return priorNewestUpdateTime;
103659
103814
  }
103660
103815
  function updateOutputTimestamps(state, proj, resolvedPath) {
@@ -103726,6 +103881,13 @@ var ts;
103726
103881
  }
103727
103882
  }
103728
103883
  function build(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences) {
103884
+ ts.solutionPerformance.mark("beforeBuild");
103885
+ var result = buildWorker(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences);
103886
+ ts.solutionPerformance.mark("afterBuild");
103887
+ ts.solutionPerformance.measure("Build", "beforeBuild", "afterBuild");
103888
+ return result;
103889
+ }
103890
+ function buildWorker(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences) {
103729
103891
  var buildOrder = getBuildOrderFor(state, project, onlyReferences);
103730
103892
  if (!buildOrder)
103731
103893
  return ts.ExitStatus.InvalidProject_OutputsSkipped;
@@ -103737,7 +103899,10 @@ var ts;
103737
103899
  if (!invalidatedProject)
103738
103900
  break;
103739
103901
  reportQueue = false;
103902
+ ts.solutionPerformance.mark("beforeInvalidatedProjectBuild");
103740
103903
  invalidatedProject.done(cancellationToken, writeFile, getCustomTransformers === null || getCustomTransformers === void 0 ? void 0 : getCustomTransformers(invalidatedProject.project));
103904
+ ts.solutionPerformance.mark("afterInvalidatedProjectBuild");
103905
+ ts.solutionPerformance.measure("InvalidatedProjectBuild", "beforeInvalidatedProjectBuild", "afterInvalidatedProjectBuild");
103741
103906
  if (!state.diagnostics.has(invalidatedProject.projectPath))
103742
103907
  successfulProjects++;
103743
103908
  }
@@ -103823,6 +103988,14 @@ var ts;
103823
103988
  state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time, state, changeDetected);
103824
103989
  }
103825
103990
  function buildNextInvalidatedProject(state, changeDetected) {
103991
+ ts.solutionPerformance.mark("beforeBuild");
103992
+ var buildOrder = buildNextInvalidatedProjectWorker(state, changeDetected);
103993
+ ts.solutionPerformance.mark("afterBuild");
103994
+ ts.solutionPerformance.measure("Build", "beforeBuild", "afterBuild");
103995
+ if (buildOrder)
103996
+ reportErrorSummary(state, buildOrder);
103997
+ }
103998
+ function buildNextInvalidatedProjectWorker(state, changeDetected) {
103826
103999
  state.timerToBuildInvalidatedProject = undefined;
103827
104000
  if (state.reportFileChangeDetected) {
103828
104001
  state.reportFileChangeDetected = false;
@@ -103833,7 +104006,10 @@ var ts;
103833
104006
  var buildOrder = getBuildOrder(state);
103834
104007
  var invalidatedProject = getNextInvalidatedProject(state, buildOrder, false);
103835
104008
  if (invalidatedProject) {
104009
+ ts.solutionPerformance.mark("beforeInvalidatedProjectBuild");
103836
104010
  invalidatedProject.done();
104011
+ ts.solutionPerformance.mark("afterInvalidatedProjectBuild");
104012
+ ts.solutionPerformance.measure("InvalidatedProjectBuild", "beforeInvalidatedProjectBuild", "afterInvalidatedProjectBuild");
103837
104013
  projectsBuilt++;
103838
104014
  while (state.projectPendingBuild.size) {
103839
104015
  if (state.timerToBuildInvalidatedProject)
@@ -103846,13 +104022,16 @@ var ts;
103846
104022
  return;
103847
104023
  }
103848
104024
  var project = createInvalidatedProjectWithInfo(state, info, buildOrder);
104025
+ ts.solutionPerformance.mark("beforeInvalidatedProjectBuild");
103849
104026
  project.done();
104027
+ ts.solutionPerformance.mark("afterInvalidatedProjectBuild");
104028
+ ts.solutionPerformance.measure("InvalidatedProjectBuild", "beforeInvalidatedProjectBuild", "afterInvalidatedProjectBuild");
103850
104029
  if (info.kind !== InvalidatedProjectKind.UpdateOutputFileStamps)
103851
104030
  projectsBuilt++;
103852
104031
  }
103853
104032
  }
103854
104033
  disableCache(state);
103855
- reportErrorSummary(state, buildOrder);
104034
+ return buildOrder;
103856
104035
  }
103857
104036
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
103858
104037
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
@@ -103909,6 +104088,7 @@ var ts;
103909
104088
  function startWatching(state, buildOrder) {
103910
104089
  if (!state.watchAllProjectsPending)
103911
104090
  return;
104091
+ ts.solutionPerformance.mark("beforeStartWatching");
103912
104092
  state.watchAllProjectsPending = false;
103913
104093
  for (var _i = 0, _a = getBuildOrderFromAnyBuildOrder(buildOrder); _i < _a.length; _i++) {
103914
104094
  var resolved = _a[_i];
@@ -103922,6 +104102,8 @@ var ts;
103922
104102
  watchPackageJsonFiles(state, resolved, resolvedPath, cfg);
103923
104103
  }
103924
104104
  }
104105
+ ts.solutionPerformance.mark("afterStartWatching");
104106
+ ts.solutionPerformance.measure("StartWatching", "beforeStartWatching", "afterStartWatching");
103925
104107
  }
103926
104108
  function stopWatching(state) {
103927
104109
  ts.clearMap(state.allWatchedConfigFiles, ts.closeFileWatcher);
@@ -104068,6 +104250,12 @@ var ts;
104068
104250
  })(ts || (ts = {}));
104069
104251
  var ts;
104070
104252
  (function (ts) {
104253
+ var StatisticType;
104254
+ (function (StatisticType) {
104255
+ StatisticType[StatisticType["time"] = 0] = "time";
104256
+ StatisticType[StatisticType["count"] = 1] = "count";
104257
+ StatisticType[StatisticType["memory"] = 2] = "memory";
104258
+ })(StatisticType = ts.StatisticType || (ts.StatisticType = {}));
104071
104259
  function countLines(program) {
104072
104260
  var counts = getCountsMap();
104073
104261
  ts.forEach(program.getSourceFiles(), function (file) {
@@ -104628,18 +104816,73 @@ var ts;
104628
104816
  if (reportWatchModeWithoutSysSupport(sys, reportDiagnostic))
104629
104817
  return;
104630
104818
  var buildHost_1 = ts.createSolutionBuilderWithWatchHost(sys, undefined, reportDiagnostic, ts.createBuilderStatusReporter(sys, shouldBePretty(sys, buildOptions)), createWatchStatusReporter(sys, buildOptions));
104819
+ var onWatchStatusChange_1 = buildHost_1.onWatchStatusChange;
104820
+ var reportWatchStatistics_1 = false;
104821
+ buildHost_1.onWatchStatusChange = function (d, newLine, options, errorCount) {
104822
+ onWatchStatusChange_1 === null || onWatchStatusChange_1 === void 0 ? void 0 : onWatchStatusChange_1(d, newLine, options, errorCount);
104823
+ if (!reportWatchStatistics_1)
104824
+ return;
104825
+ if (d.code === ts.Diagnostics.Found_0_errors_Watching_for_file_changes.code ||
104826
+ d.code === ts.Diagnostics.Found_1_error_Watching_for_file_changes.code) {
104827
+ reportSolutionBuilderTimes(sys, builder_1, buildHost_1);
104828
+ }
104829
+ };
104631
104830
  updateSolutionBuilderHost(sys, cb, buildHost_1);
104831
+ enableSolutionPerformance(sys, buildOptions);
104632
104832
  var builder_1 = ts.createSolutionBuilderWithWatch(buildHost_1, projects, buildOptions, watchOptions);
104633
104833
  builder_1.build();
104834
+ reportSolutionBuilderTimes(sys, builder_1, buildHost_1);
104835
+ reportWatchStatistics_1 = true;
104634
104836
  return builder_1;
104635
104837
  }
104636
104838
  var buildHost = ts.createSolutionBuilderHost(sys, undefined, reportDiagnostic, ts.createBuilderStatusReporter(sys, shouldBePretty(sys, buildOptions)), createReportErrorSummary(sys, buildOptions));
104637
104839
  updateSolutionBuilderHost(sys, cb, buildHost);
104840
+ enableSolutionPerformance(sys, buildOptions);
104638
104841
  var builder = ts.createSolutionBuilder(buildHost, projects, buildOptions);
104639
104842
  var exitStatus = buildOptions.clean ? builder.clean() : builder.build();
104843
+ reportSolutionBuilderTimes(sys, builder, buildHost);
104640
104844
  ts.dumpTracingLegend();
104641
104845
  return sys.exit(exitStatus);
104642
104846
  }
104847
+ function enableSolutionPerformance(system, options) {
104848
+ if (system === ts.sys && (options.diagnostics || options.extendedDiagnostics))
104849
+ ts.solutionPerformance.enable();
104850
+ }
104851
+ function reportSolutionBuilderTimes(system, builder, buildHost) {
104852
+ if (system !== ts.sys)
104853
+ return;
104854
+ if (ts.solutionPerformance.isEnabled()) {
104855
+ var solutionStatistics_1 = [];
104856
+ ts.solutionPerformance.forEachMeasure(function (name, duration) { return solutionStatistics_1.push({ name: name + " time", value: duration, type: StatisticType.time }); });
104857
+ solutionStatistics_1.push({ name: "projectsBuilt", value: ts.solutionPerformance.getCount("projectsBuilt"), type: StatisticType.count }, { name: "timestampUpdated", value: ts.solutionPerformance.getCount("timestampUpdated"), type: StatisticType.count }, { name: "bundlesUpdated", value: ts.solutionPerformance.getCount("bundlesUpdated"), type: StatisticType.count }, { name: "projects", value: ts.getBuildOrderFromAnyBuildOrder(builder.getBuildOrder()).length, type: StatisticType.count });
104858
+ buildHost.statistics = ts.append(buildHost.statistics, solutionStatistics_1);
104859
+ ts.solutionPerformance.disable();
104860
+ ts.solutionPerformance.enable();
104861
+ }
104862
+ if (!buildHost.statistics)
104863
+ return;
104864
+ var statistics = [];
104865
+ var map = new ts.Map();
104866
+ for (var _i = 0, _a = buildHost.statistics; _i < _a.length; _i++) {
104867
+ var statistic = _a[_i];
104868
+ for (var _b = 0, statistic_1 = statistic; _b < statistic_1.length; _b++) {
104869
+ var s = statistic_1[_b];
104870
+ var existing = map.get(s.name);
104871
+ if (existing) {
104872
+ if (existing.type === StatisticType.memory)
104873
+ existing.value = Math.max(existing.value, s.value);
104874
+ else
104875
+ existing.value += s.value;
104876
+ }
104877
+ else {
104878
+ map.set(s.name, s);
104879
+ statistics.push(s);
104880
+ }
104881
+ }
104882
+ }
104883
+ buildHost.statistics = undefined;
104884
+ reportAllStatistics(system, statistics);
104885
+ }
104643
104886
  function createReportErrorSummary(sys, options) {
104644
104887
  return shouldBePretty(sys, options) ?
104645
104888
  function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine, sys)); } :
@@ -104688,10 +104931,13 @@ var ts;
104688
104931
  function updateSolutionBuilderHost(sys, cb, buildHost) {
104689
104932
  updateCreateProgram(sys, buildHost);
104690
104933
  buildHost.afterProgramEmitAndDiagnostics = function (program) {
104691
- reportStatistics(sys, program.getProgram());
104934
+ buildHost.statistics = ts.append(buildHost.statistics, reportStatistics(sys, program.getProgram()));
104692
104935
  cb(program);
104693
104936
  };
104694
- buildHost.afterEmitBundle = cb;
104937
+ buildHost.afterEmitBundle = function (config) {
104938
+ buildHost.statistics = ts.append(buildHost.statistics, reportStatistics(sys, config));
104939
+ cb(config);
104940
+ };
104695
104941
  }
104696
104942
  function updateCreateProgram(sys, host) {
104697
104943
  var compileUsingBuilder = host.createProgram;
@@ -104755,8 +105001,13 @@ var ts;
104755
105001
  ts.startTracing(isBuildMode ? "build" : "project", compilerOptions.generateTrace, compilerOptions.configFilePath);
104756
105002
  }
104757
105003
  }
104758
- function reportStatistics(sys, program) {
104759
- var compilerOptions = program.getCompilerOptions();
105004
+ function isProgram(programOrConfig) {
105005
+ return !!programOrConfig.getCompilerOptions;
105006
+ }
105007
+ function reportStatistics(sys, programOrConfig) {
105008
+ var program = isProgram(programOrConfig) ? programOrConfig : undefined;
105009
+ var config = !isProgram(programOrConfig) ? programOrConfig : undefined;
105010
+ var compilerOptions = (program === null || program === void 0 ? void 0 : program.getCompilerOptions()) || (config === null || config === void 0 ? void 0 : config.options);
104760
105011
  if (canTrace(sys, compilerOptions)) {
104761
105012
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.stopTracing();
104762
105013
  }
@@ -104764,29 +105015,31 @@ var ts;
104764
105015
  if (canReportDiagnostics(sys, compilerOptions)) {
104765
105016
  statistics = [];
104766
105017
  var memoryUsed = sys.getMemoryUsage ? sys.getMemoryUsage() : -1;
104767
- reportCountStatistic("Files", program.getSourceFiles().length);
104768
- var lineCounts = countLines(program);
104769
- var nodeCounts = countNodes(program);
104770
- if (compilerOptions.extendedDiagnostics) {
104771
- for (var _i = 0, _a = ts.arrayFrom(lineCounts.keys()); _i < _a.length; _i++) {
104772
- var key = _a[_i];
104773
- reportCountStatistic("Lines of " + key, lineCounts.get(key));
105018
+ if (program) {
105019
+ reportCountStatistic("Files", program.getSourceFiles().length);
105020
+ var lineCounts = countLines(program);
105021
+ var nodeCounts = countNodes(program);
105022
+ if (compilerOptions.extendedDiagnostics) {
105023
+ for (var _i = 0, _a = ts.arrayFrom(lineCounts.keys()); _i < _a.length; _i++) {
105024
+ var key = _a[_i];
105025
+ reportCountStatistic("Lines of " + key, lineCounts.get(key));
105026
+ }
105027
+ for (var _b = 0, _c = ts.arrayFrom(nodeCounts.keys()); _b < _c.length; _b++) {
105028
+ var key = _c[_b];
105029
+ reportCountStatistic("Nodes of " + key, nodeCounts.get(key));
105030
+ }
104774
105031
  }
104775
- for (var _b = 0, _c = ts.arrayFrom(nodeCounts.keys()); _b < _c.length; _b++) {
104776
- var key = _c[_b];
104777
- reportCountStatistic("Nodes of " + key, nodeCounts.get(key));
105032
+ else {
105033
+ reportCountStatistic("Lines", ts.reduceLeftIterator(lineCounts.values(), function (sum, count) { return sum + count; }, 0));
105034
+ reportCountStatistic("Nodes", ts.reduceLeftIterator(nodeCounts.values(), function (sum, count) { return sum + count; }, 0));
104778
105035
  }
105036
+ reportCountStatistic("Identifiers", program.getIdentifierCount());
105037
+ reportCountStatistic("Symbols", program.getSymbolCount());
105038
+ reportCountStatistic("Types", program.getTypeCount());
105039
+ reportCountStatistic("Instantiations", program.getInstantiationCount());
104779
105040
  }
104780
- else {
104781
- reportCountStatistic("Lines", ts.reduceLeftIterator(lineCounts.values(), function (sum, count) { return sum + count; }, 0));
104782
- reportCountStatistic("Nodes", ts.reduceLeftIterator(nodeCounts.values(), function (sum, count) { return sum + count; }, 0));
104783
- }
104784
- reportCountStatistic("Identifiers", program.getIdentifierCount());
104785
- reportCountStatistic("Symbols", program.getSymbolCount());
104786
- reportCountStatistic("Types", program.getTypeCount());
104787
- reportCountStatistic("Instantiations", program.getInstantiationCount());
104788
105041
  if (memoryUsed >= 0) {
104789
- reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K");
105042
+ reportMemoryStatistic("Memory used", memoryUsed);
104790
105043
  }
104791
105044
  var isPerformanceEnabled = ts.performance.isEnabled();
104792
105045
  var programTime = isPerformanceEnabled ? ts.performance.getDuration("Program") : 0;
@@ -104794,11 +105047,13 @@ var ts;
104794
105047
  var checkTime = isPerformanceEnabled ? ts.performance.getDuration("Check") : 0;
104795
105048
  var emitTime = isPerformanceEnabled ? ts.performance.getDuration("Emit") : 0;
104796
105049
  if (compilerOptions.extendedDiagnostics) {
104797
- var caches = program.getRelationCacheSizes();
104798
- reportCountStatistic("Assignability cache size", caches.assignable);
104799
- reportCountStatistic("Identity cache size", caches.identity);
104800
- reportCountStatistic("Subtype cache size", caches.subtype);
104801
- reportCountStatistic("Strict subtype cache size", caches.strictSubtype);
105050
+ if (program) {
105051
+ var caches = program.getRelationCacheSizes();
105052
+ reportCountStatistic("Assignability cache size", caches.assignable);
105053
+ reportCountStatistic("Identity cache size", caches.identity);
105054
+ reportCountStatistic("Subtype cache size", caches.subtype);
105055
+ reportCountStatistic("Strict subtype cache size", caches.strictSubtype);
105056
+ }
104802
105057
  if (isPerformanceEnabled) {
104803
105058
  ts.performance.forEachMeasure(function (name, duration) { return reportTimeStatistic(name + " time", duration); });
104804
105059
  }
@@ -104814,39 +105069,54 @@ var ts;
104814
105069
  if (isPerformanceEnabled) {
104815
105070
  reportTimeStatistic("Total time", programTime + bindTime + checkTime + emitTime);
104816
105071
  }
104817
- reportStatistics();
105072
+ reportAllStatistics(sys, statistics);
104818
105073
  if (!isPerformanceEnabled) {
104819
105074
  sys.write(ts.Diagnostics.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message + "\n");
104820
105075
  }
104821
105076
  else {
104822
105077
  ts.performance.disable();
104823
105078
  }
105079
+ return statistics;
104824
105080
  }
104825
- function reportStatistics() {
104826
- var nameSize = 0;
104827
- var valueSize = 0;
104828
- for (var _i = 0, statistics_1 = statistics; _i < statistics_1.length; _i++) {
104829
- var _a = statistics_1[_i], name = _a.name, value = _a.value;
104830
- if (name.length > nameSize) {
104831
- nameSize = name.length;
104832
- }
104833
- if (value.length > valueSize) {
104834
- valueSize = value.length;
104835
- }
104836
- }
104837
- for (var _b = 0, statistics_2 = statistics; _b < statistics_2.length; _b++) {
104838
- var _c = statistics_2[_b], name = _c.name, value = _c.value;
104839
- sys.write(ts.padRight(name + ":", nameSize + 2) + ts.padLeft(value.toString(), valueSize) + sys.newLine);
104840
- }
104841
- }
104842
- function reportStatisticalValue(name, value) {
104843
- statistics.push({ name: name, value: value });
105081
+ function reportMemoryStatistic(name, memoryUsed) {
105082
+ statistics.push({ name: name, value: memoryUsed, type: StatisticType.memory });
104844
105083
  }
104845
105084
  function reportCountStatistic(name, count) {
104846
- reportStatisticalValue(name, "" + count);
105085
+ statistics.push({ name: name, value: count, type: StatisticType.count });
104847
105086
  }
104848
105087
  function reportTimeStatistic(name, time) {
104849
- reportStatisticalValue(name, (time / 1000).toFixed(2) + "s");
105088
+ statistics.push({ name: name, value: time, type: StatisticType.time });
105089
+ }
105090
+ }
105091
+ function reportAllStatistics(sys, statistics) {
105092
+ var nameSize = 0;
105093
+ var valueSize = 0;
105094
+ for (var _i = 0, statistics_1 = statistics; _i < statistics_1.length; _i++) {
105095
+ var s = statistics_1[_i];
105096
+ if (s.name.length > nameSize) {
105097
+ nameSize = s.name.length;
105098
+ }
105099
+ var valueString = statisticValue(s);
105100
+ if (valueString.length > valueSize) {
105101
+ valueSize = valueString.length;
105102
+ }
105103
+ }
105104
+ for (var _a = 0, statistics_2 = statistics; _a < statistics_2.length; _a++) {
105105
+ var s = statistics_2[_a];
105106
+ sys.write(ts.padRight(s.name + ":", nameSize + 2) + ts.padLeft(statisticValue(s).toString(), valueSize) + sys.newLine);
105107
+ }
105108
+ }
105109
+ function statisticValue(s) {
105110
+ switch (s.type) {
105111
+ case StatisticType.count:
105112
+ return "" + s.value;
105113
+ case StatisticType.time:
105114
+ return (s.value / 1000).toFixed(2) + "s";
105115
+ case StatisticType.memory:
105116
+ return Math.round(s.value / 1000) + "K";
105117
+ break;
105118
+ default:
105119
+ ts.Debug.assertNever(s.type);
104850
105120
  }
104851
105121
  }
104852
105122
  function writeConfigFile(sys, reportDiagnostic, options, fileNames) {