@typescript-deploys/pr-build 5.7.0-pr-59860-2 → 5.7.0-pr-53017-15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.7";
21
- var version = `${versionMajorMinor}.0-insiders.20240904`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240916`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -3854,6 +3854,42 @@ var EmitFlags = /* @__PURE__ */ ((EmitFlags3) => {
3854
3854
  EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping";
3855
3855
  return EmitFlags3;
3856
3856
  })(EmitFlags || {});
3857
+ var LanguageFeatureMinimumTarget = {
3858
+ Classes: 2 /* ES2015 */,
3859
+ ForOf: 2 /* ES2015 */,
3860
+ Generators: 2 /* ES2015 */,
3861
+ Iteration: 2 /* ES2015 */,
3862
+ SpreadElements: 2 /* ES2015 */,
3863
+ RestElements: 2 /* ES2015 */,
3864
+ TaggedTemplates: 2 /* ES2015 */,
3865
+ DestructuringAssignment: 2 /* ES2015 */,
3866
+ BindingPatterns: 2 /* ES2015 */,
3867
+ ArrowFunctions: 2 /* ES2015 */,
3868
+ BlockScopedVariables: 2 /* ES2015 */,
3869
+ ObjectAssign: 2 /* ES2015 */,
3870
+ RegularExpressionFlagsUnicode: 2 /* ES2015 */,
3871
+ RegularExpressionFlagsSticky: 2 /* ES2015 */,
3872
+ Exponentiation: 3 /* ES2016 */,
3873
+ AsyncFunctions: 4 /* ES2017 */,
3874
+ ForAwaitOf: 5 /* ES2018 */,
3875
+ AsyncGenerators: 5 /* ES2018 */,
3876
+ AsyncIteration: 5 /* ES2018 */,
3877
+ ObjectSpreadRest: 5 /* ES2018 */,
3878
+ RegularExpressionFlagsDotAll: 5 /* ES2018 */,
3879
+ BindinglessCatch: 6 /* ES2019 */,
3880
+ BigInt: 7 /* ES2020 */,
3881
+ NullishCoalesce: 7 /* ES2020 */,
3882
+ OptionalChaining: 7 /* ES2020 */,
3883
+ LogicalAssignment: 8 /* ES2021 */,
3884
+ TopLevelAwait: 9 /* ES2022 */,
3885
+ ClassFields: 9 /* ES2022 */,
3886
+ PrivateNamesAndClassStaticBlocks: 9 /* ES2022 */,
3887
+ RegularExpressionFlagsHasIndices: 9 /* ES2022 */,
3888
+ ShebangComments: 99 /* ESNext */,
3889
+ UsingAndAwaitUsing: 99 /* ESNext */,
3890
+ ClassAndClassElementDecorators: 99 /* ESNext */,
3891
+ RegularExpressionFlagsUnicodeSets: 99 /* ESNext */
3892
+ };
3857
3893
  var commentPragmas = {
3858
3894
  "reference": {
3859
3895
  args: [
@@ -8070,11 +8106,11 @@ var charCodeToRegExpFlag = /* @__PURE__ */ new Map([
8070
8106
  [121 /* y */, 128 /* Sticky */]
8071
8107
  ]);
8072
8108
  var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
8073
- [1 /* HasIndices */, 9 /* RegularExpressionFlagsHasIndices */],
8074
- [16 /* DotAll */, 5 /* RegularExpressionFlagsDotAll */],
8075
- [32 /* Unicode */, 2 /* RegularExpressionFlagsUnicode */],
8076
- [64 /* UnicodeSets */, 99 /* RegularExpressionFlagsUnicodeSets */],
8077
- [128 /* Sticky */, 2 /* RegularExpressionFlagsSticky */]
8109
+ [1 /* HasIndices */, LanguageFeatureMinimumTarget.RegularExpressionFlagsHasIndices],
8110
+ [16 /* DotAll */, LanguageFeatureMinimumTarget.RegularExpressionFlagsDotAll],
8111
+ [32 /* Unicode */, LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicode],
8112
+ [64 /* UnicodeSets */, LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicodeSets],
8113
+ [128 /* Sticky */, LanguageFeatureMinimumTarget.RegularExpressionFlagsSticky]
8078
8114
  ]);
8079
8115
  var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
8080
8116
  var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
@@ -15006,17 +15042,15 @@ function isDefaultImport(node) {
15006
15042
  return (node.kind === 272 /* ImportDeclaration */ || node.kind === 351 /* JSDocImportTag */) && !!node.importClause && !!node.importClause.name;
15007
15043
  }
15008
15044
  function hasQuestionToken(node) {
15009
- if (node) {
15010
- switch (node.kind) {
15011
- case 169 /* Parameter */:
15012
- case 174 /* MethodDeclaration */:
15013
- case 173 /* MethodSignature */:
15014
- case 304 /* ShorthandPropertyAssignment */:
15015
- case 303 /* PropertyAssignment */:
15016
- case 172 /* PropertyDeclaration */:
15017
- case 171 /* PropertySignature */:
15018
- return node.questionToken !== void 0;
15019
- }
15045
+ switch (node.kind) {
15046
+ case 169 /* Parameter */:
15047
+ case 174 /* MethodDeclaration */:
15048
+ case 173 /* MethodSignature */:
15049
+ case 304 /* ShorthandPropertyAssignment */:
15050
+ case 303 /* PropertyAssignment */:
15051
+ case 172 /* PropertyDeclaration */:
15052
+ case 171 /* PropertySignature */:
15053
+ return node.questionToken !== void 0;
15020
15054
  }
15021
15055
  return false;
15022
15056
  }
@@ -17697,7 +17731,7 @@ function importSyntaxAffectsModuleResolution(options) {
17697
17731
  function createComputedCompilerOptions(options) {
17698
17732
  return options;
17699
17733
  }
17700
- var computedOptions = createComputedCompilerOptions({
17734
+ var _computedOptions = createComputedCompilerOptions({
17701
17735
  target: {
17702
17736
  dependencies: ["module"],
17703
17737
  computeValue: (compilerOptions) => {
@@ -17708,7 +17742,7 @@ var computedOptions = createComputedCompilerOptions({
17708
17742
  module: {
17709
17743
  dependencies: ["target"],
17710
17744
  computeValue: (compilerOptions) => {
17711
- return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
17745
+ return typeof compilerOptions.module === "number" ? compilerOptions.module : _computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
17712
17746
  }
17713
17747
  },
17714
17748
  moduleResolution: {
@@ -17716,7 +17750,7 @@ var computedOptions = createComputedCompilerOptions({
17716
17750
  computeValue: (compilerOptions) => {
17717
17751
  let moduleResolution = compilerOptions.moduleResolution;
17718
17752
  if (moduleResolution === void 0) {
17719
- switch (computedOptions.module.computeValue(compilerOptions)) {
17753
+ switch (_computedOptions.module.computeValue(compilerOptions)) {
17720
17754
  case 1 /* CommonJS */:
17721
17755
  moduleResolution = 2 /* Node10 */;
17722
17756
  break;
@@ -17740,7 +17774,7 @@ var computedOptions = createComputedCompilerOptions({
17740
17774
  moduleDetection: {
17741
17775
  dependencies: ["module", "target"],
17742
17776
  computeValue: (compilerOptions) => {
17743
- return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
17777
+ return compilerOptions.moduleDetection || (_computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || _computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
17744
17778
  }
17745
17779
  },
17746
17780
  isolatedModules: {
@@ -17755,7 +17789,7 @@ var computedOptions = createComputedCompilerOptions({
17755
17789
  if (compilerOptions.esModuleInterop !== void 0) {
17756
17790
  return compilerOptions.esModuleInterop;
17757
17791
  }
17758
- switch (computedOptions.module.computeValue(compilerOptions)) {
17792
+ switch (_computedOptions.module.computeValue(compilerOptions)) {
17759
17793
  case 100 /* Node16 */:
17760
17794
  case 199 /* NodeNext */:
17761
17795
  case 200 /* Preserve */:
@@ -17770,13 +17804,13 @@ var computedOptions = createComputedCompilerOptions({
17770
17804
  if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
17771
17805
  return compilerOptions.allowSyntheticDefaultImports;
17772
17806
  }
17773
- return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
17807
+ return _computedOptions.esModuleInterop.computeValue(compilerOptions) || _computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || _computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
17774
17808
  }
17775
17809
  },
17776
17810
  resolvePackageJsonExports: {
17777
17811
  dependencies: ["moduleResolution"],
17778
17812
  computeValue: (compilerOptions) => {
17779
- const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
17813
+ const moduleResolution = _computedOptions.moduleResolution.computeValue(compilerOptions);
17780
17814
  if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
17781
17815
  return false;
17782
17816
  }
@@ -17795,7 +17829,7 @@ var computedOptions = createComputedCompilerOptions({
17795
17829
  resolvePackageJsonImports: {
17796
17830
  dependencies: ["moduleResolution", "resolvePackageJsonExports"],
17797
17831
  computeValue: (compilerOptions) => {
17798
- const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
17832
+ const moduleResolution = _computedOptions.moduleResolution.computeValue(compilerOptions);
17799
17833
  if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
17800
17834
  return false;
17801
17835
  }
@@ -17817,7 +17851,7 @@ var computedOptions = createComputedCompilerOptions({
17817
17851
  if (compilerOptions.resolveJsonModule !== void 0) {
17818
17852
  return compilerOptions.resolveJsonModule;
17819
17853
  }
17820
- return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
17854
+ return _computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
17821
17855
  }
17822
17856
  },
17823
17857
  declaration: {
@@ -17829,7 +17863,7 @@ var computedOptions = createComputedCompilerOptions({
17829
17863
  preserveConstEnums: {
17830
17864
  dependencies: ["isolatedModules", "verbatimModuleSyntax"],
17831
17865
  computeValue: (compilerOptions) => {
17832
- return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
17866
+ return !!(compilerOptions.preserveConstEnums || _computedOptions.isolatedModules.computeValue(compilerOptions));
17833
17867
  }
17834
17868
  },
17835
17869
  incremental: {
@@ -17841,7 +17875,7 @@ var computedOptions = createComputedCompilerOptions({
17841
17875
  declarationMap: {
17842
17876
  dependencies: ["declaration", "composite"],
17843
17877
  computeValue: (compilerOptions) => {
17844
- return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
17878
+ return !!(compilerOptions.declarationMap && _computedOptions.declaration.computeValue(compilerOptions));
17845
17879
  }
17846
17880
  },
17847
17881
  allowJs: {
@@ -17853,7 +17887,7 @@ var computedOptions = createComputedCompilerOptions({
17853
17887
  useDefineForClassFields: {
17854
17888
  dependencies: ["target", "module"],
17855
17889
  computeValue: (compilerOptions) => {
17856
- return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
17890
+ return compilerOptions.useDefineForClassFields === void 0 ? _computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
17857
17891
  }
17858
17892
  },
17859
17893
  noImplicitAny: {
@@ -17911,22 +17945,23 @@ var computedOptions = createComputedCompilerOptions({
17911
17945
  }
17912
17946
  }
17913
17947
  });
17914
- var getEmitScriptTarget = computedOptions.target.computeValue;
17915
- var getEmitModuleKind = computedOptions.module.computeValue;
17916
- var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
17917
- var getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
17918
- var getIsolatedModules = computedOptions.isolatedModules.computeValue;
17919
- var getESModuleInterop = computedOptions.esModuleInterop.computeValue;
17920
- var getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
17921
- var getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
17922
- var getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
17923
- var getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
17924
- var getEmitDeclarations = computedOptions.declaration.computeValue;
17925
- var shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
17926
- var isIncrementalCompilation = computedOptions.incremental.computeValue;
17927
- var getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
17928
- var getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
17929
- var getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
17948
+ var computedOptions = _computedOptions;
17949
+ var getEmitScriptTarget = _computedOptions.target.computeValue;
17950
+ var getEmitModuleKind = _computedOptions.module.computeValue;
17951
+ var getEmitModuleResolutionKind = _computedOptions.moduleResolution.computeValue;
17952
+ var getEmitModuleDetectionKind = _computedOptions.moduleDetection.computeValue;
17953
+ var getIsolatedModules = _computedOptions.isolatedModules.computeValue;
17954
+ var getESModuleInterop = _computedOptions.esModuleInterop.computeValue;
17955
+ var getAllowSyntheticDefaultImports = _computedOptions.allowSyntheticDefaultImports.computeValue;
17956
+ var getResolvePackageJsonExports = _computedOptions.resolvePackageJsonExports.computeValue;
17957
+ var getResolvePackageJsonImports = _computedOptions.resolvePackageJsonImports.computeValue;
17958
+ var getResolveJsonModule = _computedOptions.resolveJsonModule.computeValue;
17959
+ var getEmitDeclarations = _computedOptions.declaration.computeValue;
17960
+ var shouldPreserveConstEnums = _computedOptions.preserveConstEnums.computeValue;
17961
+ var isIncrementalCompilation = _computedOptions.incremental.computeValue;
17962
+ var getAreDeclarationMapsEnabled = _computedOptions.declarationMap.computeValue;
17963
+ var getAllowJSCompilerOption = _computedOptions.allowJs.computeValue;
17964
+ var getUseDefineForClassFields = _computedOptions.useDefineForClassFields.computeValue;
17930
17965
  function emitModuleKindIsNonNodeESM(moduleKind) {
17931
17966
  return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
17932
17967
  }
@@ -27024,23 +27059,21 @@ function hasRecordedExternalHelpers(sourceFile) {
27024
27059
  }
27025
27060
  function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault) {
27026
27061
  if (compilerOptions.importHelpers && isEffectiveExternalModule(sourceFile, compilerOptions)) {
27027
- let namedBindings;
27028
27062
  const moduleKind = getEmitModuleKind(compilerOptions);
27029
- if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || getImpliedNodeFormatForEmitWorker(sourceFile, compilerOptions) === 99 /* ESNext */) {
27030
- const helpers = getEmitHelpers(sourceFile);
27063
+ const impliedModuleKind = getImpliedNodeFormatForEmitWorker(sourceFile, compilerOptions);
27064
+ const helpers = getImportedHelpers(sourceFile);
27065
+ if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || impliedModuleKind === 99 /* ESNext */ || impliedModuleKind === void 0 && moduleKind === 200 /* Preserve */) {
27031
27066
  if (helpers) {
27032
27067
  const helperNames = [];
27033
27068
  for (const helper of helpers) {
27034
- if (!helper.scoped) {
27035
- const importName = helper.importName;
27036
- if (importName) {
27037
- pushIfUnique(helperNames, importName);
27038
- }
27069
+ const importName = helper.importName;
27070
+ if (importName) {
27071
+ pushIfUnique(helperNames, importName);
27039
27072
  }
27040
27073
  }
27041
27074
  if (some(helperNames)) {
27042
27075
  helperNames.sort(compareStringsCaseSensitive);
27043
- namedBindings = nodeFactory.createNamedImports(
27076
+ const namedBindings = nodeFactory.createNamedImports(
27044
27077
  map(helperNames, (name) => isFileLevelUniqueName(sourceFile, name) ? nodeFactory.createImportSpecifier(
27045
27078
  /*isTypeOnly*/
27046
27079
  false,
@@ -27057,57 +27090,54 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
27057
27090
  const parseNode = getOriginalNode(sourceFile, isSourceFile);
27058
27091
  const emitNode = getOrCreateEmitNode(parseNode);
27059
27092
  emitNode.externalHelpers = true;
27093
+ const externalHelpersImportDeclaration = nodeFactory.createImportDeclaration(
27094
+ /*modifiers*/
27095
+ void 0,
27096
+ nodeFactory.createImportClause(
27097
+ /*isTypeOnly*/
27098
+ false,
27099
+ /*name*/
27100
+ void 0,
27101
+ namedBindings
27102
+ ),
27103
+ nodeFactory.createStringLiteral(externalHelpersModuleNameText),
27104
+ /*attributes*/
27105
+ void 0
27106
+ );
27107
+ addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
27108
+ return externalHelpersImportDeclaration;
27060
27109
  }
27061
27110
  }
27062
27111
  } else {
27063
- const externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar || hasImportDefault);
27112
+ const externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, helpers, hasExportStarsToExportValues, hasImportStar || hasImportDefault);
27064
27113
  if (externalHelpersModuleName) {
27065
- namedBindings = nodeFactory.createNamespaceImport(externalHelpersModuleName);
27066
- }
27067
- }
27068
- if (namedBindings) {
27069
- const externalHelpersImportDeclaration = nodeFactory.createImportDeclaration(
27070
- /*modifiers*/
27071
- void 0,
27072
- nodeFactory.createImportClause(
27114
+ const externalHelpersImportDeclaration = nodeFactory.createImportEqualsDeclaration(
27115
+ /*modifiers*/
27116
+ void 0,
27073
27117
  /*isTypeOnly*/
27074
27118
  false,
27075
- /*name*/
27076
- void 0,
27077
- namedBindings
27078
- ),
27079
- nodeFactory.createStringLiteral(externalHelpersModuleNameText),
27080
- /*attributes*/
27081
- void 0
27082
- );
27083
- addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
27084
- return externalHelpersImportDeclaration;
27119
+ externalHelpersModuleName,
27120
+ nodeFactory.createExternalModuleReference(nodeFactory.createStringLiteral(externalHelpersModuleNameText))
27121
+ );
27122
+ addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
27123
+ return externalHelpersImportDeclaration;
27124
+ }
27085
27125
  }
27086
27126
  }
27087
27127
  }
27088
- function getOrCreateExternalHelpersModuleNameIfNeeded(factory2, node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) {
27089
- if (compilerOptions.importHelpers && isEffectiveExternalModule(node, compilerOptions)) {
27090
- const externalHelpersModuleName = getExternalHelpersModuleName(node);
27091
- if (externalHelpersModuleName) {
27092
- return externalHelpersModuleName;
27093
- }
27094
- let create = (hasExportStarsToExportValues || getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && getEmitModuleFormatOfFileWorker(node, compilerOptions) < 4 /* System */;
27095
- if (!create) {
27096
- const helpers = getEmitHelpers(node);
27097
- if (helpers) {
27098
- for (const helper of helpers) {
27099
- if (!helper.scoped) {
27100
- create = true;
27101
- break;
27102
- }
27103
- }
27104
- }
27105
- }
27106
- if (create) {
27107
- const parseNode = getOriginalNode(node, isSourceFile);
27108
- const emitNode = getOrCreateEmitNode(parseNode);
27109
- return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory2.createUniqueName(externalHelpersModuleNameText));
27110
- }
27128
+ function getImportedHelpers(sourceFile) {
27129
+ return filter(getEmitHelpers(sourceFile), (helper) => !helper.scoped);
27130
+ }
27131
+ function getOrCreateExternalHelpersModuleNameIfNeeded(factory2, node, compilerOptions, helpers, hasExportStarsToExportValues, hasImportStarOrImportDefault) {
27132
+ const externalHelpersModuleName = getExternalHelpersModuleName(node);
27133
+ if (externalHelpersModuleName) {
27134
+ return externalHelpersModuleName;
27135
+ }
27136
+ const create = some(helpers) || (hasExportStarsToExportValues || getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && getEmitModuleFormatOfFileWorker(node, compilerOptions) < 4 /* System */;
27137
+ if (create) {
27138
+ const parseNode = getOriginalNode(node, isSourceFile);
27139
+ const emitNode = getOrCreateEmitNode(parseNode);
27140
+ return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory2.createUniqueName(externalHelpersModuleNameText));
27111
27141
  }
27112
27142
  }
27113
27143
  function getLocalNameForExternalImport(factory2, node, sourceFile) {
@@ -36265,15 +36295,6 @@ var commandOptionsWithoutBuild = [
36265
36295
  paramType: Diagnostics.FILE_OR_DIRECTORY,
36266
36296
  description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json
36267
36297
  },
36268
- {
36269
- name: "build",
36270
- type: "boolean",
36271
- shortName: "b",
36272
- showInSimplifiedHelpView: true,
36273
- category: Diagnostics.Command_line_Options,
36274
- description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
36275
- defaultValueDescription: false
36276
- },
36277
36298
  {
36278
36299
  name: "showConfig",
36279
36300
  type: "boolean",
@@ -37258,7 +37279,17 @@ var commandLineOptionOfCustomType = optionDeclarations.filter(isCommandLineOptio
37258
37279
  function isCommandLineOptionOfCustomType(option) {
37259
37280
  return !isString(option.type);
37260
37281
  }
37282
+ var tscBuildOption = {
37283
+ name: "build",
37284
+ type: "boolean",
37285
+ shortName: "b",
37286
+ showInSimplifiedHelpView: true,
37287
+ category: Diagnostics.Command_line_Options,
37288
+ description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
37289
+ defaultValueDescription: false
37290
+ };
37261
37291
  var optionsForBuild = [
37292
+ tscBuildOption,
37262
37293
  {
37263
37294
  name: "verbose",
37264
37295
  shortName: "v",
@@ -37394,8 +37425,14 @@ function getOptionName(option) {
37394
37425
  }
37395
37426
  function createUnknownOptionError(unknownOption, diagnostics, unknownOptionErrorText, node, sourceFile) {
37396
37427
  var _a;
37397
- if ((_a = diagnostics.alternateMode) == null ? void 0 : _a.getOptionsNameMap().optionsNameMap.has(unknownOption.toLowerCase())) {
37398
- return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.alternateMode.diagnostic, unknownOption);
37428
+ const otherOption = (_a = diagnostics.alternateMode) == null ? void 0 : _a.getOptionsNameMap().optionsNameMap.get(unknownOption.toLowerCase());
37429
+ if (otherOption) {
37430
+ return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(
37431
+ sourceFile,
37432
+ node,
37433
+ otherOption !== tscBuildOption ? diagnostics.alternateMode.diagnostic : Diagnostics.Option_build_must_be_the_first_command_line_argument,
37434
+ unknownOption
37435
+ );
37399
37436
  }
37400
37437
  const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName);
37401
37438
  return possibleOption ? createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption);
@@ -37581,10 +37618,10 @@ var buildOptionsDidYouMeanDiagnostics = {
37581
37618
  unknownDidYouMeanDiagnostic: Diagnostics.Unknown_build_option_0_Did_you_mean_1,
37582
37619
  optionTypeMismatchDiagnostic: Diagnostics.Build_option_0_requires_a_value_of_type_1
37583
37620
  };
37584
- function parseBuildCommand(args) {
37621
+ function parseBuildCommand(commandLine) {
37585
37622
  const { options, watchOptions, fileNames: projects, errors } = parseCommandLineWorker(
37586
37623
  buildOptionsDidYouMeanDiagnostics,
37587
- args
37624
+ commandLine
37588
37625
  );
37589
37626
  const buildOptions = options;
37590
37627
  if (projects.length === 0) {
@@ -38508,7 +38545,7 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
38508
38545
  if (ownConfig.raw.compileOnSave === void 0 && result.compileOnSave) ownConfig.raw.compileOnSave = result.compileOnSave;
38509
38546
  if (sourceFile && result.extendedSourceFiles) sourceFile.extendedSourceFiles = arrayFrom(result.extendedSourceFiles.keys());
38510
38547
  ownConfig.options = assign(result.options, ownConfig.options);
38511
- ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? assign(result.watchOptions, ownConfig.watchOptions) : ownConfig.watchOptions || result.watchOptions;
38548
+ ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? assignWatchOptions(result, ownConfig.watchOptions) : ownConfig.watchOptions || result.watchOptions;
38512
38549
  }
38513
38550
  return ownConfig;
38514
38551
  function applyExtendedConfig(result, extendedConfigPath) {
@@ -38532,9 +38569,14 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
38532
38569
  result.compileOnSave = extendsRaw.compileOnSave;
38533
38570
  }
38534
38571
  assign(result.options, extendedConfig.options);
38535
- result.watchOptions = result.watchOptions && extendedConfig.watchOptions ? assign({}, result.watchOptions, extendedConfig.watchOptions) : result.watchOptions || extendedConfig.watchOptions;
38572
+ result.watchOptions = result.watchOptions && extendedConfig.watchOptions ? assignWatchOptions(result, extendedConfig.watchOptions) : result.watchOptions || extendedConfig.watchOptions;
38536
38573
  }
38537
38574
  }
38575
+ function assignWatchOptions(result, watchOptions) {
38576
+ if (result.watchOptionsCopied) return assign(result.watchOptions, watchOptions);
38577
+ result.watchOptionsCopied = true;
38578
+ return assign({}, result.watchOptions, watchOptions);
38579
+ }
38538
38580
  }
38539
38581
  function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
38540
38582
  if (hasProperty(json, "excludes")) {
@@ -40502,7 +40544,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
40502
40544
  };
40503
40545
  }
40504
40546
  function getPackageScopeForPath(directory, state) {
40505
- return forEachAncestorDirectory(
40547
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
40548
+ state.host,
40506
40549
  directory,
40507
40550
  (dir) => getPackageJsonInfo(
40508
40551
  dir,
@@ -40807,13 +40850,13 @@ function comparePatternKeys(a, b) {
40807
40850
  const bPatternIndex = b.indexOf("*");
40808
40851
  const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
40809
40852
  const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
40810
- if (baseLenA > baseLenB) return -1;
40811
- if (baseLenB > baseLenA) return 1;
40812
- if (aPatternIndex === -1) return 1;
40813
- if (bPatternIndex === -1) return -1;
40814
- if (a.length > b.length) return -1;
40815
- if (b.length > a.length) return 1;
40816
- return 0;
40853
+ if (baseLenA > baseLenB) return -1 /* LessThan */;
40854
+ if (baseLenB > baseLenA) return 1 /* GreaterThan */;
40855
+ if (aPatternIndex === -1) return 1 /* GreaterThan */;
40856
+ if (bPatternIndex === -1) return -1 /* LessThan */;
40857
+ if (a.length > b.length) return -1 /* LessThan */;
40858
+ if (b.length > a.length) return 1 /* GreaterThan */;
40859
+ return 0 /* EqualTo */;
40817
40860
  }
40818
40861
  function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
40819
40862
  const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
@@ -41141,17 +41184,30 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
41141
41184
  return lookup(secondaryExtensions);
41142
41185
  }
41143
41186
  function lookup(extensions2) {
41144
- return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
41145
- if (getBaseFileName(ancestorDirectory) !== "node_modules") {
41146
- const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
41147
- if (resolutionFromCache) {
41148
- return resolutionFromCache;
41187
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
41188
+ state.host,
41189
+ normalizeSlashes(directory),
41190
+ (ancestorDirectory) => {
41191
+ if (getBaseFileName(ancestorDirectory) !== "node_modules") {
41192
+ const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
41193
+ if (resolutionFromCache) {
41194
+ return resolutionFromCache;
41195
+ }
41196
+ return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
41149
41197
  }
41150
- return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
41151
41198
  }
41152
- });
41199
+ );
41153
41200
  }
41154
41201
  }
41202
+ function forEachAncestorDirectoryStoppingAtGlobalCache(host, directory, callback) {
41203
+ var _a;
41204
+ const globalCache = (_a = host == null ? void 0 : host.getGlobalTypingsCacheLocation) == null ? void 0 : _a.call(host);
41205
+ return forEachAncestorDirectory(directory, (ancestorDirectory) => {
41206
+ const result = callback(ancestorDirectory);
41207
+ if (result !== void 0) return result;
41208
+ if (ancestorDirectory === globalCache) return false;
41209
+ }) || void 0;
41210
+ }
41155
41211
  function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
41156
41212
  const nodeModulesFolder = combinePaths(directory, "node_modules");
41157
41213
  const nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host);
@@ -41347,28 +41403,32 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
41347
41403
  return { value: resolvedUsingSettings };
41348
41404
  }
41349
41405
  if (!isExternalModuleNameRelative(moduleName)) {
41350
- const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => {
41351
- const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
41352
- cache,
41353
- moduleName,
41354
- /*mode*/
41355
- void 0,
41356
- directory,
41357
- redirectedReference,
41358
- state
41359
- );
41360
- if (resolutionFromCache) {
41361
- return resolutionFromCache;
41362
- }
41363
- const searchName = normalizePath(combinePaths(directory, moduleName));
41364
- return toSearchResult(loadModuleFromFileNoPackageId(
41365
- extensions,
41366
- searchName,
41367
- /*onlyRecordFailures*/
41368
- false,
41369
- state
41370
- ));
41371
- });
41406
+ const resolved2 = forEachAncestorDirectoryStoppingAtGlobalCache(
41407
+ state.host,
41408
+ containingDirectory,
41409
+ (directory) => {
41410
+ const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
41411
+ cache,
41412
+ moduleName,
41413
+ /*mode*/
41414
+ void 0,
41415
+ directory,
41416
+ redirectedReference,
41417
+ state
41418
+ );
41419
+ if (resolutionFromCache) {
41420
+ return resolutionFromCache;
41421
+ }
41422
+ const searchName = normalizePath(combinePaths(directory, moduleName));
41423
+ return toSearchResult(loadModuleFromFileNoPackageId(
41424
+ extensions,
41425
+ searchName,
41426
+ /*onlyRecordFailures*/
41427
+ false,
41428
+ state
41429
+ ));
41430
+ }
41431
+ );
41372
41432
  if (resolved2) return resolved2;
41373
41433
  if (extensions & (1 /* TypeScript */ | 4 /* Declaration */)) {
41374
41434
  let resolved3 = loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, containingDirectory, state);
@@ -41411,7 +41471,7 @@ function resolveFromTypeRoot(moduleName, state) {
41411
41471
  }
41412
41472
  }
41413
41473
  function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
41414
- return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName);
41474
+ return !!compilerOptions.allowImportingTsExtensions || !!fromFileName && isDeclarationFileName(fromFileName);
41415
41475
  }
41416
41476
  function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
41417
41477
  const traceEnabled = isTraceEnabled(compilerOptions, host);
@@ -44890,9 +44950,11 @@ function getNearestAncestorDirectoryWithPackageJson(host, fileName) {
44890
44950
  if (host.getNearestAncestorDirectoryWithPackageJson) {
44891
44951
  return host.getNearestAncestorDirectoryWithPackageJson(fileName);
44892
44952
  }
44893
- return forEachAncestorDirectory(fileName, (directory) => {
44894
- return host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0;
44895
- });
44953
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
44954
+ host,
44955
+ fileName,
44956
+ (directory) => host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0
44957
+ );
44896
44958
  }
44897
44959
  function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) {
44898
44960
  var _a;
@@ -44910,25 +44972,29 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref
44910
44972
  }
44911
44973
  const symlinkedDirectories = (_a = host.getSymlinkCache) == null ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
44912
44974
  const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd);
44913
- const result = symlinkedDirectories && forEachAncestorDirectory(getDirectoryPath(fullImportedFileName), (realPathDirectory) => {
44914
- const symlinkDirectories = symlinkedDirectories.get(ensureTrailingDirectorySeparator(toPath(realPathDirectory, cwd, getCanonicalFileName)));
44915
- if (!symlinkDirectories) return void 0;
44916
- if (startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) {
44917
- return false;
44918
- }
44919
- return forEach(targets, (target) => {
44920
- if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
44921
- return;
44922
- }
44923
- const relative = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
44924
- for (const symlinkDirectory of symlinkDirectories) {
44925
- const option = resolvePath(symlinkDirectory, relative);
44926
- const result2 = cb(option, target === referenceRedirect);
44927
- shouldFilterIgnoredPaths = true;
44928
- if (result2) return result2;
44975
+ const result = symlinkedDirectories && forEachAncestorDirectoryStoppingAtGlobalCache(
44976
+ host,
44977
+ getDirectoryPath(fullImportedFileName),
44978
+ (realPathDirectory) => {
44979
+ const symlinkDirectories = symlinkedDirectories.get(ensureTrailingDirectorySeparator(toPath(realPathDirectory, cwd, getCanonicalFileName)));
44980
+ if (!symlinkDirectories) return void 0;
44981
+ if (startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) {
44982
+ return false;
44929
44983
  }
44930
- });
44931
- });
44984
+ return forEach(targets, (target) => {
44985
+ if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
44986
+ return;
44987
+ }
44988
+ const relative = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
44989
+ for (const symlinkDirectory of symlinkDirectories) {
44990
+ const option = resolvePath(symlinkDirectory, relative);
44991
+ const result2 = cb(option, target === referenceRedirect);
44992
+ shouldFilterIgnoredPaths = true;
44993
+ if (result2) return result2;
44994
+ }
44995
+ });
44996
+ }
44997
+ );
44932
44998
  return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0);
44933
44999
  }
44934
45000
  var runtimeDependencyFields = ["dependencies", "peerDependencies", "optionalDependencies"];
@@ -45812,6 +45878,7 @@ function createTypeChecker(host) {
45812
45878
  getBaseTypeOfLiteralType,
45813
45879
  getWidenedType,
45814
45880
  getWidenedLiteralType,
45881
+ fillMissingTypeArguments,
45815
45882
  getTypeFromTypeNode: (nodeIn) => {
45816
45883
  const node = getParseTreeNode(nodeIn, isTypeNode);
45817
45884
  return node ? getTypeFromTypeNode(node) : errorType;
@@ -56343,20 +56410,11 @@ function createTypeChecker(host) {
56343
56410
  return type;
56344
56411
  }
56345
56412
  function isLateBindableName(node) {
56346
- return isLateBindableAST(node) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression));
56347
- }
56348
- function isLateBindableIndexSignature(node) {
56349
- return isLateBindableAST(node) && isTypeUsableAsIndexSignature(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression));
56350
- }
56351
- function isLateBindableAST(node) {
56352
56413
  if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) {
56353
56414
  return false;
56354
56415
  }
56355
56416
  const expr = isComputedPropertyName(node) ? node.expression : node.argumentExpression;
56356
- return isEntityNameExpression(expr);
56357
- }
56358
- function isTypeUsableAsIndexSignature(type) {
56359
- return isTypeAssignableTo(type, stringNumberSymbolType);
56417
+ return isEntityNameExpression(expr) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(expr));
56360
56418
  }
56361
56419
  function isLateBoundName(name) {
56362
56420
  return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) === 64 /* at */;
@@ -56365,10 +56423,6 @@ function createTypeChecker(host) {
56365
56423
  const name = getNameOfDeclaration(node);
56366
56424
  return !!name && isLateBindableName(name);
56367
56425
  }
56368
- function hasLateBindableIndexSignature(node) {
56369
- const name = getNameOfDeclaration(node);
56370
- return !!name && isLateBindableIndexSignature(name);
56371
- }
56372
56426
  function hasBindableName(node) {
56373
56427
  return !hasDynamicName(node) || hasLateBindableName(node);
56374
56428
  }
@@ -56422,24 +56476,6 @@ function createTypeChecker(host) {
56422
56476
  }
56423
56477
  return links.resolvedSymbol;
56424
56478
  }
56425
- function lateBindIndexSignature(parent, earlySymbols, lateSymbols, decl) {
56426
- let indexSymbol = lateSymbols.get("__index" /* Index */);
56427
- if (!indexSymbol) {
56428
- const early = earlySymbols == null ? void 0 : earlySymbols.get("__index" /* Index */);
56429
- if (!early) {
56430
- indexSymbol = createSymbol(0 /* None */, "__index" /* Index */, 4096 /* Late */);
56431
- } else {
56432
- indexSymbol = cloneSymbol(early);
56433
- indexSymbol.links.checkFlags |= 4096 /* Late */;
56434
- }
56435
- lateSymbols.set("__index" /* Index */, indexSymbol);
56436
- }
56437
- if (!indexSymbol.declarations) {
56438
- indexSymbol.declarations = [decl];
56439
- } else if (!decl.symbol.isReplaceableByMethod) {
56440
- indexSymbol.declarations.push(decl);
56441
- }
56442
- }
56443
56479
  function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) {
56444
56480
  const links = getSymbolLinks(symbol);
56445
56481
  if (!links[resolutionKind]) {
@@ -56454,8 +56490,6 @@ function createTypeChecker(host) {
56454
56490
  if (isStatic2 === hasStaticModifier(member)) {
56455
56491
  if (hasLateBindableName(member)) {
56456
56492
  lateBindMember(symbol, earlySymbols, lateSymbols, member);
56457
- } else if (hasLateBindableIndexSignature(member)) {
56458
- lateBindIndexSignature(symbol, earlySymbols, lateSymbols, member);
56459
56493
  }
56460
56494
  }
56461
56495
  }
@@ -58719,7 +58753,7 @@ function createTypeChecker(host) {
58719
58753
  return signature.isolatedSignatureType;
58720
58754
  }
58721
58755
  function getIndexSymbol(symbol) {
58722
- return symbol.members ? getIndexSymbolFromSymbolTable(getMembersOfSymbol(symbol)) : void 0;
58756
+ return symbol.members ? getIndexSymbolFromSymbolTable(symbol.members) : void 0;
58723
58757
  }
58724
58758
  function getIndexSymbolFromSymbolTable(symbolTable) {
58725
58759
  return symbolTable.get("__index" /* Index */);
@@ -58735,25 +58769,15 @@ function createTypeChecker(host) {
58735
58769
  if (indexSymbol.declarations) {
58736
58770
  const indexInfos = [];
58737
58771
  for (const declaration of indexSymbol.declarations) {
58738
- if (isIndexSignatureDeclaration(declaration)) {
58739
- if (declaration.parameters.length === 1) {
58740
- const parameter = declaration.parameters[0];
58741
- if (parameter.type) {
58742
- forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
58743
- if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
58744
- indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
58745
- }
58746
- });
58747
- }
58772
+ if (declaration.parameters.length === 1) {
58773
+ const parameter = declaration.parameters[0];
58774
+ if (parameter.type) {
58775
+ forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
58776
+ if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
58777
+ indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
58778
+ }
58779
+ });
58748
58780
  }
58749
- } else if (hasLateBindableIndexSignature(declaration)) {
58750
- const declName = isBinaryExpression(declaration) ? declaration.left : declaration.name;
58751
- const keyType = isElementAccessExpression(declName) ? checkExpressionCached(declName.argumentExpression) : checkComputedPropertyName(declName);
58752
- forEachType(keyType, (keyType2) => {
58753
- if (isValidIndexKeyType(keyType2) && !findIndexInfo(indexInfos, keyType2)) {
58754
- indexInfos.push(createIndexInfo(keyType2, getTypeOfVariableOrParameterOrProperty(declaration.symbol), hasEffectiveModifier(declaration, 8 /* Readonly */)));
58755
- }
58756
- });
58757
58781
  }
58758
58782
  }
58759
58783
  return indexInfos;
@@ -66927,7 +66951,8 @@ function createTypeChecker(host) {
66927
66951
  priority: void 0,
66928
66952
  topLevel: true,
66929
66953
  isFixed: false,
66930
- impliedArity: void 0
66954
+ impliedArity: void 0,
66955
+ indexes: void 0
66931
66956
  };
66932
66957
  }
66933
66958
  function cloneInferenceInfo(inference) {
@@ -66939,7 +66964,8 @@ function createTypeChecker(host) {
66939
66964
  priority: inference.priority,
66940
66965
  topLevel: inference.topLevel,
66941
66966
  isFixed: inference.isFixed,
66942
- impliedArity: inference.impliedArity
66967
+ impliedArity: inference.impliedArity,
66968
+ indexes: inference.indexes && inference.indexes.slice()
66943
66969
  };
66944
66970
  }
66945
66971
  function cloneInferredPartOfContext(context) {
@@ -67057,7 +67083,7 @@ function createTypeChecker(host) {
67057
67083
  const templateType = getTemplateTypeFromMappedType(target);
67058
67084
  const inference = createInferenceInfo(typeParameter);
67059
67085
  inferTypes([inference], sourceType, templateType);
67060
- return getTypeFromInference(inference) || unknownType;
67086
+ return getTypeFromInference(inference) || (inference.indexes ? getIntersectionType(inference.indexes) : unknownType);
67061
67087
  }
67062
67088
  function inferReverseMappedType(source, target, constraint) {
67063
67089
  const cacheKey = source.id + "," + target.id + "," + constraint.id;
@@ -67404,6 +67430,24 @@ function createTypeChecker(host) {
67404
67430
  } else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
67405
67431
  inferFromTypes(source.objectType, target.objectType);
67406
67432
  inferFromTypes(source.indexType, target.indexType);
67433
+ } else if (!(priority & 1 /* NakedTypeVariable */) && target.flags & 8388608 /* IndexedAccess */) {
67434
+ if (isFromInferenceBlockedSource(source)) {
67435
+ return;
67436
+ }
67437
+ const inference = getInferenceInfoForType(getActualTypeVariable(target.objectType));
67438
+ if (inference) {
67439
+ if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
67440
+ return;
67441
+ }
67442
+ if (!inference.isFixed) {
67443
+ const inferenceTypeSymbol = getGlobalSymbol("PartialInference", 788968 /* Type */, Diagnostics.Cannot_find_global_type_0);
67444
+ const inferenceType = inferenceTypeSymbol && getDeclaredTypeOfSymbol(inferenceTypeSymbol);
67445
+ if (inferenceType && inferenceType !== unknownType) {
67446
+ const mapper = createTypeMapper(getSymbolLinks(inferenceTypeSymbol).typeParameters, [source, target.indexType]);
67447
+ inference.indexes = append(inference.indexes, instantiateType(inferenceType, mapper));
67448
+ }
67449
+ }
67450
+ }
67407
67451
  } else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) {
67408
67452
  if (source.symbol === target.symbol) {
67409
67453
  inferFromTypes(source.type, target.type);
@@ -67907,6 +67951,51 @@ function createTypeChecker(host) {
67907
67951
  const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
67908
67952
  inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
67909
67953
  fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
67954
+ } else if (inference.indexes) {
67955
+ let aggregateInference = getIntersectionType(inference.indexes);
67956
+ const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
67957
+ if (constraint2) {
67958
+ const instantiatedConstraint = instantiateType(constraint2, context.nonFixingMapper);
67959
+ if (instantiatedConstraint.flags & 1048576 /* Union */ && !context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference))) {
67960
+ const discriminantProps = findDiscriminantProperties(getPropertiesOfType(aggregateInference), instantiatedConstraint);
67961
+ if (discriminantProps) {
67962
+ let match;
67963
+ findDiscriminant:
67964
+ for (const p of discriminantProps) {
67965
+ const candidatePropType = getTypeOfPropertyOfType(aggregateInference, p.escapedName);
67966
+ for (const type of instantiatedConstraint.types) {
67967
+ const propType = getTypeOfPropertyOfType(type, p.escapedName);
67968
+ if (propType && candidatePropType && checkTypeAssignableTo(
67969
+ candidatePropType,
67970
+ propType,
67971
+ /*errorNode*/
67972
+ void 0
67973
+ )) {
67974
+ if (match && match !== type) {
67975
+ match = void 0;
67976
+ break findDiscriminant;
67977
+ } else {
67978
+ match = type;
67979
+ }
67980
+ }
67981
+ }
67982
+ }
67983
+ if (match) {
67984
+ aggregateInference = getSpreadType(
67985
+ match,
67986
+ aggregateInference,
67987
+ /*symbol*/
67988
+ void 0,
67989
+ /*propegatedFlags*/
67990
+ 0,
67991
+ /*readonly*/
67992
+ false
67993
+ );
67994
+ }
67995
+ }
67996
+ }
67997
+ }
67998
+ inferredType = aggregateInference;
67910
67999
  } else if (context.flags & 1 /* NoDefault */) {
67911
68000
  inferredType = silentNeverType;
67912
68001
  } else {
@@ -72486,7 +72575,7 @@ function createTypeChecker(host) {
72486
72575
  return globalRegExpType;
72487
72576
  }
72488
72577
  function checkSpreadExpression(node, checkMode) {
72489
- if (languageVersion < 2 /* SpreadElements */) {
72578
+ if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) {
72490
72579
  checkExternalEmitHelpers(node, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
72491
72580
  }
72492
72581
  const arrayOrIterableType = checkExpression(node.expression, checkMode);
@@ -72520,7 +72609,7 @@ function createTypeChecker(host) {
72520
72609
  for (let i = 0; i < elementCount; i++) {
72521
72610
  const e = elements[i];
72522
72611
  if (e.kind === 230 /* SpreadElement */) {
72523
- if (languageVersion < 2 /* SpreadElements */) {
72612
+ if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) {
72524
72613
  checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
72525
72614
  }
72526
72615
  const spreadType = checkExpression(e.expression, checkMode, forceTuple);
@@ -72745,7 +72834,7 @@ function createTypeChecker(host) {
72745
72834
  addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
72746
72835
  }
72747
72836
  } else if (memberDecl.kind === 305 /* SpreadAssignment */) {
72748
- if (languageVersion < 2 /* ObjectAssign */) {
72837
+ if (languageVersion < LanguageFeatureMinimumTarget.ObjectAssign) {
72749
72838
  checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
72750
72839
  }
72751
72840
  if (propertiesArray.length > 0) {
@@ -73722,7 +73811,7 @@ function createTypeChecker(host) {
73722
73811
  const isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType;
73723
73812
  let prop;
73724
73813
  if (isPrivateIdentifier(right)) {
73725
- if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
73814
+ if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) {
73726
73815
  if (assignmentKind !== 0 /* None */) {
73727
73816
  checkExternalEmitHelpers(node, 1048576 /* ClassPrivateFieldSet */);
73728
73817
  }
@@ -76339,7 +76428,7 @@ function createTypeChecker(host) {
76339
76428
  }
76340
76429
  function checkTaggedTemplateExpression(node) {
76341
76430
  if (!checkGrammarTaggedTemplateChain(node)) checkGrammarTypeArguments(node, node.typeArguments);
76342
- if (languageVersion < 2 /* TaggedTemplates */) {
76431
+ if (languageVersion < LanguageFeatureMinimumTarget.TaggedTemplates) {
76343
76432
  checkExternalEmitHelpers(node, 262144 /* MakeTemplateObject */);
76344
76433
  }
76345
76434
  const signature = getResolvedSignature(node);
@@ -78051,7 +78140,7 @@ function createTypeChecker(host) {
78051
78140
  return silentNeverType;
78052
78141
  }
78053
78142
  if (isPrivateIdentifier(left)) {
78054
- if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
78143
+ if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) {
78055
78144
  checkExternalEmitHelpers(left, 2097152 /* ClassPrivateFieldIn */);
78056
78145
  }
78057
78146
  if (!getNodeLinks(left).resolvedSymbol && getContainingClass(left)) {
@@ -78112,7 +78201,7 @@ function createTypeChecker(host) {
78112
78201
  if (propertyIndex < properties.length - 1) {
78113
78202
  error(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
78114
78203
  } else {
78115
- if (languageVersion < 5 /* ObjectSpreadRest */) {
78204
+ if (languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) {
78116
78205
  checkExternalEmitHelpers(property, 4 /* Rest */);
78117
78206
  }
78118
78207
  const nonRestNames = [];
@@ -78133,7 +78222,7 @@ function createTypeChecker(host) {
78133
78222
  }
78134
78223
  function checkArrayLiteralAssignment(node, sourceType, checkMode) {
78135
78224
  const elements = node.elements;
78136
- if (languageVersion < 2 /* DestructuringAssignment */ && compilerOptions.downlevelIteration) {
78225
+ if (languageVersion < LanguageFeatureMinimumTarget.DestructuringAssignment && compilerOptions.downlevelIteration) {
78137
78226
  checkExternalEmitHelpers(node, 512 /* Read */);
78138
78227
  }
78139
78228
  const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType;
@@ -78907,10 +78996,10 @@ function createTypeChecker(host) {
78907
78996
  }
78908
78997
  const isAsync = (functionFlags & 2 /* Async */) !== 0;
78909
78998
  if (node.asteriskToken) {
78910
- if (isAsync && languageVersion < 5 /* AsyncGenerators */) {
78999
+ if (isAsync && languageVersion < LanguageFeatureMinimumTarget.AsyncGenerators) {
78911
79000
  checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */);
78912
79001
  }
78913
- if (!isAsync && languageVersion < 2 /* Generators */ && compilerOptions.downlevelIteration) {
79002
+ if (!isAsync && languageVersion < LanguageFeatureMinimumTarget.Generators && compilerOptions.downlevelIteration) {
78914
79003
  checkExternalEmitHelpers(node, 256 /* Values */);
78915
79004
  }
78916
79005
  }
@@ -79740,13 +79829,13 @@ function createTypeChecker(host) {
79740
79829
  }
79741
79830
  const functionFlags = getFunctionFlags(node);
79742
79831
  if (!(functionFlags & 4 /* Invalid */)) {
79743
- if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 5 /* AsyncGenerators */) {
79832
+ if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < LanguageFeatureMinimumTarget.AsyncGenerators) {
79744
79833
  checkExternalEmitHelpers(node, 6144 /* AsyncGeneratorIncludes */);
79745
79834
  }
79746
- if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* AsyncFunctions */) {
79835
+ if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < LanguageFeatureMinimumTarget.AsyncFunctions) {
79747
79836
  checkExternalEmitHelpers(node, 64 /* Awaiter */);
79748
79837
  }
79749
- if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < 2 /* Generators */) {
79838
+ if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < LanguageFeatureMinimumTarget.Generators) {
79750
79839
  checkExternalEmitHelpers(node, 128 /* Generator */);
79751
79840
  }
79752
79841
  }
@@ -79929,17 +80018,15 @@ function createTypeChecker(host) {
79929
80018
  if (indexSymbol == null ? void 0 : indexSymbol.declarations) {
79930
80019
  const indexSignatureMap = /* @__PURE__ */ new Map();
79931
80020
  for (const declaration of indexSymbol.declarations) {
79932
- if (isIndexSignatureDeclaration(declaration)) {
79933
- if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
79934
- forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type) => {
79935
- const entry = indexSignatureMap.get(getTypeId(type));
79936
- if (entry) {
79937
- entry.declarations.push(declaration);
79938
- } else {
79939
- indexSignatureMap.set(getTypeId(type), { type, declarations: [declaration] });
79940
- }
79941
- });
79942
- }
80021
+ if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
80022
+ forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type) => {
80023
+ const entry = indexSignatureMap.get(getTypeId(type));
80024
+ if (entry) {
80025
+ entry.declarations.push(declaration);
80026
+ } else {
80027
+ indexSignatureMap.set(getTypeId(type), { type, declarations: [declaration] });
80028
+ }
80029
+ });
79943
80030
  }
79944
80031
  }
79945
80032
  indexSignatureMap.forEach((entry) => {
@@ -79981,7 +80068,7 @@ function createTypeChecker(host) {
79981
80068
  }
79982
80069
  function setNodeLinksForPrivateIdentifierScope(node) {
79983
80070
  if (isPrivateIdentifier(node.name)) {
79984
- if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
80071
+ if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) {
79985
80072
  for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
79986
80073
  getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
79987
80074
  }
@@ -81121,7 +81208,7 @@ function createTypeChecker(host) {
81121
81208
  if (node.kind === 169 /* Parameter */) {
81122
81209
  checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
81123
81210
  }
81124
- } else if (languageVersion < 99 /* ClassAndClassElementDecorators */) {
81211
+ } else if (languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators) {
81125
81212
  checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */);
81126
81213
  if (isClassDeclaration(node)) {
81127
81214
  if (!node.name) {
@@ -81787,7 +81874,7 @@ function createTypeChecker(host) {
81787
81874
  potentialUnusedRenamedBindingElementsInTypes.push(node);
81788
81875
  return;
81789
81876
  }
81790
- if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ObjectSpreadRest */) {
81877
+ if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) {
81791
81878
  checkExternalEmitHelpers(node, 4 /* Rest */);
81792
81879
  }
81793
81880
  if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) {
@@ -81823,7 +81910,7 @@ function createTypeChecker(host) {
81823
81910
  }
81824
81911
  }
81825
81912
  if (isBindingPattern(node.name)) {
81826
- if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* BindingPatterns */ && compilerOptions.downlevelIteration) {
81913
+ if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < LanguageFeatureMinimumTarget.BindingPatterns && compilerOptions.downlevelIteration) {
81827
81914
  checkExternalEmitHelpers(node, 512 /* Read */);
81828
81915
  }
81829
81916
  forEach(node.name.elements, checkSourceElement);
@@ -81977,7 +82064,7 @@ function createTypeChecker(host) {
81977
82064
  }
81978
82065
  function checkVariableDeclarationList(node) {
81979
82066
  const blockScopeKind = getCombinedNodeFlags(node) & 7 /* BlockScoped */;
81980
- if ((blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) && languageVersion < 99 /* UsingAndAwaitUsing */) {
82067
+ if ((blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) && languageVersion < LanguageFeatureMinimumTarget.UsingAndAwaitUsing) {
81981
82068
  checkExternalEmitHelpers(node, 16777216 /* AddDisposableResourceAndDisposeResources */);
81982
82069
  }
81983
82070
  forEach(node.declarations, checkSourceElement);
@@ -82191,11 +82278,11 @@ function createTypeChecker(host) {
82191
82278
  grammarErrorOnNode(node.awaitModifier, Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block);
82192
82279
  } else {
82193
82280
  const functionFlags = getFunctionFlags(container);
82194
- if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 5 /* ForAwaitOf */) {
82281
+ if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < LanguageFeatureMinimumTarget.ForAwaitOf) {
82195
82282
  checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */);
82196
82283
  }
82197
82284
  }
82198
- } else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ForOf */) {
82285
+ } else if (compilerOptions.downlevelIteration && languageVersion < LanguageFeatureMinimumTarget.ForOf) {
82199
82286
  checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);
82200
82287
  }
82201
82288
  if (node.initializer.kind === 261 /* VariableDeclarationList */) {
@@ -83236,12 +83323,12 @@ function createTypeChecker(host) {
83236
83323
  return true;
83237
83324
  }
83238
83325
  function getFirstTransformableStaticClassElement(node) {
83239
- const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */ && classOrConstructorParameterIsDecorated(
83326
+ const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators && classOrConstructorParameterIsDecorated(
83240
83327
  /*useLegacyDecorators*/
83241
83328
  false,
83242
83329
  node
83243
83330
  );
83244
- const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */;
83331
+ const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators;
83245
83332
  const willTransformInitializers = !emitStandardClassFields;
83246
83333
  if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
83247
83334
  for (const member of node.members) {
@@ -83268,7 +83355,7 @@ function createTypeChecker(host) {
83268
83355
  if (node.name) return;
83269
83356
  const parent = walkUpOuterExpressions(node);
83270
83357
  if (!isNamedEvaluationSource(parent)) return;
83271
- const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */;
83358
+ const willTransformESDecorators = !legacyDecorators && languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators;
83272
83359
  let location;
83273
83360
  if (willTransformESDecorators && classOrConstructorParameterIsDecorated(
83274
83361
  /*useLegacyDecorators*/
@@ -83328,7 +83415,7 @@ function createTypeChecker(host) {
83328
83415
  const baseTypeNode = getEffectiveBaseTypeNode(node);
83329
83416
  if (baseTypeNode) {
83330
83417
  forEach(baseTypeNode.typeArguments, checkSourceElement);
83331
- if (languageVersion < 2 /* Classes */) {
83418
+ if (languageVersion < LanguageFeatureMinimumTarget.Classes) {
83332
83419
  checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */);
83333
83420
  }
83334
83421
  const extendsNode = getClassExtendsHeritageElement(node);
@@ -86847,29 +86934,7 @@ function createTypeChecker(host) {
86847
86934
  return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, internalFlags, tracker);
86848
86935
  },
86849
86936
  isImportRequiredByAugmentation,
86850
- isDefinitelyReferenceToGlobalSymbolObject,
86851
- createLateBoundIndexSignatures: (cls, enclosing, flags, internalFlags, tracker) => {
86852
- const sym = cls.symbol;
86853
- const staticInfos = getIndexInfosOfType(getTypeOfSymbol(sym));
86854
- const instanceIndexSymbol = getIndexSymbol(sym);
86855
- const instanceInfos = instanceIndexSymbol && getIndexInfosOfIndexSymbol(instanceIndexSymbol);
86856
- let result;
86857
- for (const infoList of [staticInfos, instanceInfos]) {
86858
- if (!length(infoList)) continue;
86859
- result || (result = []);
86860
- for (const info of infoList) {
86861
- if (info.declaration) continue;
86862
- const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
86863
- if (node && infoList === staticInfos) {
86864
- (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
86865
- }
86866
- if (node) {
86867
- result.push(node);
86868
- }
86869
- }
86870
- }
86871
- return result;
86872
- }
86937
+ isDefinitelyReferenceToGlobalSymbolObject
86873
86938
  };
86874
86939
  function isImportRequiredByAugmentation(node) {
86875
86940
  const file = getSourceFileOfNode(node);
@@ -88769,7 +88834,8 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
88769
88834
  getFileIncludeReasons: () => host.getFileIncludeReasons(),
88770
88835
  readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0,
88771
88836
  getDefaultResolutionModeForFile: (file) => host.getDefaultResolutionModeForFile(file),
88772
- getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index)
88837
+ getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index),
88838
+ getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
88773
88839
  };
88774
88840
  }
88775
88841
  var SymbolTrackerImpl = class _SymbolTrackerImpl {
@@ -111178,6 +111244,7 @@ function transformECMAScriptModule(context) {
111178
111244
  context.onSubstituteNode = onSubstituteNode;
111179
111245
  context.enableEmitNotification(307 /* SourceFile */);
111180
111246
  context.enableSubstitution(80 /* Identifier */);
111247
+ const noSubstitution = /* @__PURE__ */ new Set();
111181
111248
  let helperNameSubstitutions;
111182
111249
  let currentSourceFile;
111183
111250
  let importRequireStatements;
@@ -111212,7 +111279,7 @@ function transformECMAScriptModule(context) {
111212
111279
  if (externalHelpersImportDeclaration) {
111213
111280
  const statements = [];
111214
111281
  const statementOffset = factory2.copyPrologue(node.statements, statements);
111215
- append(statements, externalHelpersImportDeclaration);
111282
+ addRange(statements, visitArray([externalHelpersImportDeclaration], visitor, isStatement));
111216
111283
  addRange(statements, visitNodes2(node.statements, visitor, isStatement, statementOffset));
111217
111284
  return factory2.updateSourceFile(
111218
111285
  node,
@@ -111427,7 +111494,9 @@ function transformECMAScriptModule(context) {
111427
111494
  if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) {
111428
111495
  helperNameSubstitutions = /* @__PURE__ */ new Map();
111429
111496
  }
111497
+ currentSourceFile = node;
111430
111498
  previousOnEmitNode(hint, node, emitCallback);
111499
+ currentSourceFile = void 0;
111431
111500
  helperNameSubstitutions = void 0;
111432
111501
  } else {
111433
111502
  previousOnEmitNode(hint, node, emitCallback);
@@ -111435,18 +111504,29 @@ function transformECMAScriptModule(context) {
111435
111504
  }
111436
111505
  function onSubstituteNode(hint, node) {
111437
111506
  node = previousOnSubstituteNode(hint, node);
111438
- if (helperNameSubstitutions && isIdentifier(node) && getEmitFlags(node) & 8192 /* HelperName */) {
111507
+ if (node.id && noSubstitution.has(node.id)) {
111508
+ return node;
111509
+ }
111510
+ if (isIdentifier(node) && getEmitFlags(node) & 8192 /* HelperName */) {
111439
111511
  return substituteHelperName(node);
111440
111512
  }
111441
111513
  return node;
111442
111514
  }
111443
111515
  function substituteHelperName(node) {
111444
- const name = idText(node);
111445
- let substitution = helperNameSubstitutions.get(name);
111446
- if (!substitution) {
111447
- helperNameSubstitutions.set(name, substitution = factory2.createUniqueName(name, 16 /* Optimistic */ | 32 /* FileLevel */));
111516
+ const externalHelpersModuleName = currentSourceFile && getExternalHelpersModuleName(currentSourceFile);
111517
+ if (externalHelpersModuleName) {
111518
+ noSubstitution.add(getNodeId(node));
111519
+ return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
111448
111520
  }
111449
- return substitution;
111521
+ if (helperNameSubstitutions) {
111522
+ const name = idText(node);
111523
+ let substitution = helperNameSubstitutions.get(name);
111524
+ if (!substitution) {
111525
+ helperNameSubstitutions.set(name, substitution = factory2.createUniqueName(name, 16 /* Optimistic */ | 32 /* FileLevel */));
111526
+ }
111527
+ return substitution;
111528
+ }
111529
+ return node;
111450
111530
  }
111451
111531
  }
111452
111532
 
@@ -113339,8 +113419,7 @@ function transformDeclarations(context) {
113339
113419
  void 0
113340
113420
  )
113341
113421
  ] : void 0;
113342
- const lateIndexes = resolver.createLateBoundIndexSignatures(input, enclosingDeclaration, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker);
113343
- const memberNodes = concatenate(concatenate(concatenate(privateIdentifier, lateIndexes), parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement));
113422
+ const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement));
113344
113423
  const members = factory2.createNodeArray(memberNodes);
113345
113424
  const extendsClause = getEffectiveBaseTypeNode(input);
113346
113425
  if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 106 /* NullKeyword */) {
@@ -114645,8 +114724,7 @@ var notImplementedResolver = {
114645
114724
  isBindingCapturedByNode: notImplemented,
114646
114725
  getDeclarationStatementsForSourceFile: notImplemented,
114647
114726
  isImportRequiredByAugmentation: notImplemented,
114648
- isDefinitelyReferenceToGlobalSymbolObject: notImplemented,
114649
- createLateBoundIndexSignatures: notImplemented
114727
+ isDefinitelyReferenceToGlobalSymbolObject: notImplemented
114650
114728
  };
114651
114729
  var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
114652
114730
  var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
@@ -120711,7 +120789,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
120711
120789
  getCanonicalFileName,
120712
120790
  getFileIncludeReasons: () => fileReasons,
120713
120791
  structureIsReused,
120714
- writeFile: writeFile2
120792
+ writeFile: writeFile2,
120793
+ getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
120715
120794
  };
120716
120795
  onProgramCreateComplete();
120717
120796
  verifyCompilerOptions();
@@ -121277,7 +121356,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121277
121356
  getFileIncludeReasons: program.getFileIncludeReasons,
121278
121357
  createHash: maybeBind(host, host.createHash),
121279
121358
  getModuleResolutionCache: () => program.getModuleResolutionCache(),
121280
- trace: maybeBind(host, host.trace)
121359
+ trace: maybeBind(host, host.trace),
121360
+ getGlobalTypingsCacheLocation: program.getGlobalTypingsCacheLocation
121281
121361
  };
121282
121362
  }
121283
121363
  function writeFile2(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -125583,6 +125663,9 @@ function canWatchDirectoryOrFile(pathComponents2, length2) {
125583
125663
  const perceivedOsRootLength = perceivedOsRootLengthForWatching(pathComponents2, length2);
125584
125664
  return length2 > perceivedOsRootLength + 1;
125585
125665
  }
125666
+ function canWatchDirectoryOrFilePath(path) {
125667
+ return canWatchDirectoryOrFile(getPathComponents(path));
125668
+ }
125586
125669
  function canWatchAtTypes(atTypes) {
125587
125670
  return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes));
125588
125671
  }
@@ -125594,12 +125677,12 @@ function isInDirectoryPath(dirComponents, fileOrDirComponents) {
125594
125677
  return true;
125595
125678
  }
125596
125679
  function canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(fileOrDirPath) {
125597
- return canWatchDirectoryOrFile(getPathComponents(fileOrDirPath));
125680
+ return canWatchDirectoryOrFilePath(fileOrDirPath);
125598
125681
  }
125599
125682
  function canWatchAffectingLocation(filePath) {
125600
125683
  return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(filePath);
125601
125684
  }
125602
- function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, getCurrentDirectory, preferNonRecursiveWatch) {
125685
+ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, isRootWatchable, getCurrentDirectory, preferNonRecursiveWatch) {
125603
125686
  const failedLookupPathComponents = getPathComponents(failedLookupLocationPath);
125604
125687
  failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
125605
125688
  const failedLookupComponents = getPathComponents(failedLookupLocation);
@@ -125608,7 +125691,7 @@ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLoo
125608
125691
  const nodeModulesIndex = failedLookupPathComponents.indexOf("node_modules");
125609
125692
  if (nodeModulesIndex !== -1 && nodeModulesIndex + 1 <= perceivedOsRootLength + 1) return void 0;
125610
125693
  const lastNodeModulesIndex = failedLookupPathComponents.lastIndexOf("node_modules");
125611
- if (isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) {
125694
+ if (isRootWatchable && isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) {
125612
125695
  if (failedLookupPathComponents.length > rootPathComponents.length + 1) {
125613
125696
  return getDirectoryOfFailedLookupWatch(
125614
125697
  failedLookupComponents,
@@ -125680,9 +125763,9 @@ function getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, lengt
125680
125763
  packageDirPath: packageDirLength !== void 0 ? getPathFromPathComponents(dirPathComponents, packageDirLength) : void 0
125681
125764
  };
125682
125765
  }
125683
- function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, getCurrentDirectory, preferNonRecursiveWatch, filterCustomPath) {
125766
+ function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, isRootWatchable, getCurrentDirectory, preferNonRecursiveWatch, filterCustomPath) {
125684
125767
  const typeRootPathComponents = getPathComponents(typeRootPath);
125685
- if (isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
125768
+ if (isRootWatchable && isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
125686
125769
  return rootPath;
125687
125770
  }
125688
125771
  typeRoot = isRootedDiskPath(typeRoot) ? normalizePath(typeRoot) : getNormalizedAbsolutePath(typeRoot, getCurrentDirectory());
@@ -125723,10 +125806,10 @@ function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirected
125723
125806
  function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
125724
125807
  const host = getModuleResolutionHost(resolutionHost);
125725
125808
  const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
125726
- if (!resolutionHost.getGlobalCache) {
125809
+ if (!resolutionHost.getGlobalTypingsCacheLocation) {
125727
125810
  return primaryResult;
125728
125811
  }
125729
- const globalCache = resolutionHost.getGlobalCache();
125812
+ const globalCache = resolutionHost.getGlobalTypingsCacheLocation();
125730
125813
  if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
125731
125814
  const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
125732
125815
  Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
@@ -125790,6 +125873,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
125790
125873
  const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory);
125791
125874
  const rootPath = resolutionHost.toPath(rootDir);
125792
125875
  const rootPathComponents = getPathComponents(rootPath);
125876
+ const isRootWatchable = canWatchDirectoryOrFile(rootPathComponents);
125793
125877
  const isSymlinkCache = /* @__PURE__ */ new Map();
125794
125878
  const packageDirWatchers = /* @__PURE__ */ new Map();
125795
125879
  const dirPathToSymlinkPackageRefCount = /* @__PURE__ */ new Map();
@@ -126201,6 +126285,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
126201
126285
  rootDir,
126202
126286
  rootPath,
126203
126287
  rootPathComponents,
126288
+ isRootWatchable,
126204
126289
  getCurrentDirectory,
126205
126290
  resolutionHost.preferNonRecursiveWatch
126206
126291
  );
@@ -126389,6 +126474,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
126389
126474
  rootDir,
126390
126475
  rootPath,
126391
126476
  rootPathComponents,
126477
+ isRootWatchable,
126392
126478
  getCurrentDirectory,
126393
126479
  resolutionHost.preferNonRecursiveWatch
126394
126480
  );
@@ -126532,6 +126618,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
126532
126618
  return false;
126533
126619
  }
126534
126620
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
126621
+ (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
126535
126622
  const packagePath = parseNodeModuleFromPath(
126536
126623
  fileOrDirectoryPath,
126537
126624
  /*isFolder*/
@@ -126613,6 +126700,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
126613
126700
  resolutionHost.toPath(typeRoot),
126614
126701
  rootPath,
126615
126702
  rootPathComponents,
126703
+ isRootWatchable,
126616
126704
  getCurrentDirectory,
126617
126705
  resolutionHost.preferNonRecursiveWatch,
126618
126706
  (dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2) || dirPathToSymlinkPackageRefCount.has(dirPath2)
@@ -127345,6 +127433,7 @@ function createWatchProgram(host) {
127345
127433
  let updateLevel;
127346
127434
  let missingFilesMap;
127347
127435
  let watchedWildcardDirectories;
127436
+ let staleWatches = /* @__PURE__ */ new Map([[void 0, void 0]]);
127348
127437
  let timerToUpdateProgram;
127349
127438
  let timerToInvalidateFailedLookupResolutions;
127350
127439
  let parsedConfigs;
@@ -127433,8 +127522,6 @@ function createWatchProgram(host) {
127433
127522
  const customHasInvalidLibResolutions = host.resolveLibrary ? maybeBind(host, host.hasInvalidatedLibResolutions) || returnTrue : returnFalse;
127434
127523
  builderProgram = readBuilderProgram(compilerOptions, compilerHost);
127435
127524
  synchronizeProgram();
127436
- watchConfigFileWildCardDirectories();
127437
- if (configFileName) updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
127438
127525
  return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache };
127439
127526
  function close() {
127440
127527
  clearInvalidateResolutionsOfFailedLookupLocations();
@@ -127537,6 +127624,16 @@ function createWatchProgram(host) {
127537
127624
  compilerHost.directoryExists = originalDirectoryExists;
127538
127625
  compilerHost.createDirectory = originalCreateDirectory;
127539
127626
  compilerHost.writeFile = originalWriteFile;
127627
+ staleWatches == null ? void 0 : staleWatches.forEach((configFile, configPath) => {
127628
+ if (!configPath) {
127629
+ watchConfigFileWildCardDirectories();
127630
+ if (configFileName) updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
127631
+ } else {
127632
+ const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
127633
+ if (config) watchReferencedProject(configFile, configPath, config);
127634
+ }
127635
+ });
127636
+ staleWatches = void 0;
127540
127637
  return builderProgram;
127541
127638
  }
127542
127639
  function createNewProgram(hasInvalidatedResolutions, hasInvalidatedLibResolutions) {
@@ -127743,9 +127840,8 @@ function createWatchProgram(host) {
127743
127840
  }
127744
127841
  parseConfigFile2();
127745
127842
  hasChangedCompilerOptions = true;
127843
+ (staleWatches ?? (staleWatches = /* @__PURE__ */ new Map())).set(void 0, void 0);
127746
127844
  synchronizeProgram();
127747
- watchConfigFileWildCardDirectories();
127748
- updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
127749
127845
  }
127750
127846
  function parseConfigFile2() {
127751
127847
  Debug.assert(configFileName);
@@ -127797,7 +127893,7 @@ function createWatchProgram(host) {
127797
127893
  } else {
127798
127894
  (parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine });
127799
127895
  }
127800
- watchReferencedProject(configFileName2, configPath, config);
127896
+ (staleWatches ?? (staleWatches = /* @__PURE__ */ new Map())).set(configPath, configFileName2);
127801
127897
  return parsedCommandLine;
127802
127898
  }
127803
127899
  function getParsedCommandLineFromConfigFileHost(configFileName2) {
@@ -129782,7 +129878,7 @@ function shouldBePretty(sys2, options) {
129782
129878
  return options.pretty;
129783
129879
  }
129784
129880
  function getOptionsForHelp(commandLine) {
129785
- return !!commandLine.options.all ? toSorted(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.slice(), (v) => !!v.showInSimplifiedHelpView);
129881
+ return !!commandLine.options.all ? toSorted(optionDeclarations.concat(tscBuildOption), (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.concat(tscBuildOption), (v) => !!v.showInSimplifiedHelpView);
129786
129882
  }
129787
129883
  function printVersion(sys2) {
129788
129884
  sys2.write(getDiagnosticText(Diagnostics.Version_0, version) + sys2.newLine);
@@ -130106,7 +130202,7 @@ function printAllHelp(sys2, compilerOptions, buildOptions, watchOptions) {
130106
130202
  output = [...output, ...generateSectionOptionsOutput(
130107
130203
  sys2,
130108
130204
  getDiagnosticText(Diagnostics.BUILD_OPTIONS),
130109
- buildOptions,
130205
+ filter(buildOptions, (option) => option !== tscBuildOption),
130110
130206
  /*subCategory*/
130111
130207
  false,
130112
130208
  formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")
@@ -130120,7 +130216,7 @@ function printBuildHelp(sys2, buildOptions) {
130120
130216
  output = [...output, ...generateSectionOptionsOutput(
130121
130217
  sys2,
130122
130218
  getDiagnosticText(Diagnostics.BUILD_OPTIONS),
130123
- buildOptions,
130219
+ filter(buildOptions, (option) => option !== tscBuildOption),
130124
130220
  /*subCategory*/
130125
130221
  false,
130126
130222
  formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")
@@ -130157,10 +130253,6 @@ function printHelp(sys2, commandLine) {
130157
130253
  }
130158
130254
  function executeCommandLineWorker(sys2, cb, commandLine) {
130159
130255
  let reportDiagnostic = createDiagnosticReporter(sys2);
130160
- if (commandLine.options.build) {
130161
- reportDiagnostic(createCompilerDiagnostic(Diagnostics.Option_build_must_be_the_first_command_line_argument));
130162
- return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */);
130163
- }
130164
130256
  let configFileName;
130165
130257
  if (commandLine.options.locale) {
130166
130258
  validateLocaleAndSetLanguage(commandLine.options.locale, sys2, commandLine.errors);
@@ -130306,16 +130398,16 @@ function executeCommandLineWorker(sys2, cb, commandLine) {
130306
130398
  }
130307
130399
  }
130308
130400
  }
130309
- function isBuild(commandLineArgs) {
130401
+ function isBuildCommand(commandLineArgs) {
130310
130402
  if (commandLineArgs.length > 0 && commandLineArgs[0].charCodeAt(0) === 45 /* minus */) {
130311
130403
  const firstOption = commandLineArgs[0].slice(commandLineArgs[0].charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase();
130312
- return firstOption === "build" || firstOption === "b";
130404
+ return firstOption === tscBuildOption.name || firstOption === tscBuildOption.shortName;
130313
130405
  }
130314
130406
  return false;
130315
130407
  }
130316
130408
  function executeCommandLine(system, cb, commandLineArgs) {
130317
- if (isBuild(commandLineArgs)) {
130318
- const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs.slice(1));
130409
+ if (isBuildCommand(commandLineArgs)) {
130410
+ const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs);
130319
130411
  if (buildOptions.generateCpuProfile && system.enableCPUProfiler) {
130320
130412
  system.enableCPUProfiler(buildOptions.generateCpuProfile, () => performBuild(
130321
130413
  system,