typescript 4.2.1-rc → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,239 +74,6 @@ declare namespace Intl {
74
74
  */
75
75
  type RelativeTimeFormatStyle = "long" | "short" | "narrow";
76
76
 
77
- /**
78
- * Unicode Calendar Identifier
79
- *
80
- * [Reference](http://unicode.org/reports/tr35/#UnicodeCalendarIdentifier)
81
- *
82
- * [Source](https://github.com/unicode-org/cldr/blob/b805d0b/common/bcp47/calendar.xml)
83
- */
84
- type Calendar =
85
- // Thai Buddhist calendar
86
- | "buddhist"
87
- // Traditional Chinese calendar
88
- | "chinese"
89
- // Coptic calendar
90
- | "coptic"
91
- // Traditional Korean calendar
92
- | "dangi"
93
- // Ethiopic calendar, Amete Alem (epoch approx. 5493 B.C.E)
94
- | "ethiopic-amete-alem" | "ethioaa"
95
- // Ethiopic calendar, Amete Mihret (epoch approx, 8 C.E.)
96
- | "ethiopic"
97
- // Gregorian calendar
98
- | "gregorian"
99
- // Gregorian calendar (alias)
100
- | "gregory"
101
- // Traditional Hebrew calendar
102
- | "hebrew"
103
- // Indian calendar
104
- | "indian"
105
- // Islamic calendar
106
- | "islamic"
107
- // Islamic calendar, Umm al-Qura
108
- | "islamic-umalqura"
109
- // Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - astronomical epoch)
110
- | "islamic-tbla"
111
- // Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - civil epoch)
112
- | "islamic-civil"
113
- | "islamicc" // Deprecated alias
114
- // Islamic calendar, Saudi Arabia sighting
115
- | "islamic-rgsa"
116
- // ISO calendar (Gregorian calendar using the ISO 8601 calendar week rules)
117
- | "iso8601"
118
- // Japanese Imperial calendar
119
- | "japanese"
120
- // Persian calendar
121
- | "persian"
122
- // Republic of China calendar
123
- | "roc"
124
- ;
125
-
126
- /**
127
- * Unicode Number System Identifier
128
- *
129
- * [Reference](http://unicode.org/reports/tr35/#UnicodeNumberSystemIdentifier)
130
- *
131
- * [Source](https://github.com/unicode-org/cldr/blob/be7a953/common/bcp47/number.xml)
132
- */
133
- type NumberingSystem =
134
- // Adlam digits
135
- | "adlm"
136
- // Ahom digits
137
- | "ahom"
138
- // Arabic-Indic digits
139
- | "arab"
140
- // Extended Arabic-Indic digits
141
- | "arabext"
142
- // Armenian upper case numerals — algorithmic
143
- | "armn"
144
- // Armenian lower case numerals — algorithmic
145
- | "armnlow"
146
- // Balinese digits
147
- | "bali"
148
- // Bengali digits
149
- | "beng"
150
- // Bhaiksuki digits
151
- | "bhks"
152
- // Brahmi digits
153
- | "brah"
154
- // Chakma digits
155
- | "cakm"
156
- // Cham digits
157
- | "cham"
158
- // Cyrillic numerals — algorithmic
159
- | "cyrl"
160
- // Devanagari digits
161
- | "deva"
162
- // Dives Akuru digits
163
- | "diak"
164
- // Ethiopic numerals — algorithmic
165
- | "ethi"
166
- // Financial numerals — may be algorithmic
167
- | "finance"
168
- // Full width digits
169
- | "fullwide"
170
- // Georgian numerals — algorithmic
171
- | "geor"
172
- // Gunjala Gondi digits
173
- | "gong"
174
- // Masaram Gondi digits
175
- | "gonm"
176
- // Greek upper case numerals — algorithmic
177
- | "grek"
178
- // Greek lower case numerals — algorithmic
179
- | "greklow"
180
- // Gujarati digits
181
- | "gujr"
182
- // Gurmukhi digits
183
- | "guru"
184
- // Han-character day-of-month numbering for lunar/other traditional calendars"
185
- | "hanidays"
186
- // Positional decimal system using Chinese number ideographs as digits
187
- | "hanidec"
188
- // Simplified Chinese numerals — algorithmic
189
- | "hans"
190
- // Simplified Chinese financial numerals — algorithmic
191
- | "hansfin"
192
- // Traditional Chinese numerals — algorithmic
193
- | "hant"
194
- // Traditional Chinese financial numerals — algorithmic
195
- | "hantfin"
196
- // Hebrew numerals — algorithmic
197
- | "hebr"
198
- // Pahawh Hmong digits
199
- | "hmng"
200
- // Nyiakeng Puachue Hmong digits
201
- | "hmnp"
202
- // Javanese digits
203
- | "java"
204
- // Japanese numerals — algorithmic
205
- | "jpan"
206
- // Japanese financial numerals — algorithmic
207
- | "jpanfin"
208
- // Japanese first-year Gannen numbering for Japanese calendar
209
- | "jpanyear"
210
- // Kayah Li digits
211
- | "kali"
212
- // Khmer digits
213
- | "khmr"
214
- // Kannada digits
215
- | "knda"
216
- // Tai Tham Hora (secular) digits
217
- | "lana"
218
- // Tai Tham Tham (ecclesiastical) digits
219
- | "lanatham"
220
- // Lao digits
221
- | "laoo"
222
- // Latin digits
223
- | "latn"
224
- // Lepcha digits
225
- | "lepc"
226
- // Limbu digits
227
- | "limb"
228
- // Mathematical bold digits
229
- | "mathbold"
230
- // Mathematical double-struck digits
231
- | "mathdbl"
232
- // Mathematical monospace digits
233
- | "mathmono"
234
- // Mathematical sans-serif bold digits
235
- | "mathsanb"
236
- // Mathematical sans-serif digits
237
- | "mathsans"
238
- // Malayalam digits
239
- | "mlym"
240
- // Modi digits
241
- | "modi"
242
- // Mongolian digits
243
- | "mong"
244
- // Mro digits
245
- | "mroo"
246
- // Meetei Mayek digits
247
- | "mtei"
248
- // Myanmar digits
249
- | "mymr"
250
- // Myanmar Shan digits
251
- | "mymrshan"
252
- // Myanmar Tai Laing digits
253
- | "mymrtlng"
254
- // Native digits
255
- | "native"
256
- // Newa digits
257
- | "newa"
258
- // N'Ko digits
259
- | "nkoo"
260
- // Ol Chiki digits
261
- | "olck"
262
- // Oriya digits
263
- | "orya"
264
- // Osmanya digits
265
- | "osma"
266
- // Hanifi Rohingya digits
267
- | "rohg"
268
- // Roman upper case numerals — algorithmic
269
- | "roman"
270
- // Roman lowercase numerals — algorithmic
271
- | "romanlow"
272
- // Saurashtra digits
273
- | "saur"
274
- // Sharada digits
275
- | "shrd"
276
- // Khudawadi digits
277
- | "sind"
278
- // Sinhala Lith digits
279
- | "sinh"
280
- // Sora_Sompeng digits
281
- | "sora"
282
- // Sundanese digits
283
- | "sund"
284
- // Takri digits
285
- | "takr"
286
- // New Tai Lue digits
287
- | "talu"
288
- // Tamil numerals — algorithmic
289
- | "taml"
290
- // Modern Tamil decimal digits
291
- | "tamldec"
292
- // Telugu digits
293
- | "telu"
294
- // Thai digits
295
- | "thai"
296
- // Tirhuta digits
297
- | "tirh"
298
- // Tibetan digits
299
- | "tibt"
300
- // Traditional numerals — may be algorithmic
301
- | "traditional" | "traditio"
302
- // Vai digits
303
- | "vaii"
304
- // Warang Citi digits
305
- | "wara"
306
- // Wancho digits
307
- | "wcho"
308
- ;
309
-
310
77
  /**
311
78
  * An object with some or all of properties of `options` parameter
312
79
  * of `Intl.RelativeTimeFormat` constructor.
@@ -534,9 +301,9 @@ declare namespace Intl {
534
301
  interface DateTimeFormatOptions {
535
302
  dateStyle?: "full" | "long" | "medium" | "short";
536
303
  timeStyle?: "full" | "long" | "medium" | "short";
537
- calendar?: Calendar;
304
+ calendar?: string;
538
305
  dayPeriod?: "narrow" | "short" | "long";
539
- numberingSystem?: NumberingSystem;
306
+ numberingSystem?: string;
540
307
  hourCycle?: "h11" | "h12" | "h23" | "h24";
541
308
  fractionalSecondDigits?: 0 | 1 | 2 | 3;
542
309
  }
package/lib/tsc.js CHANGED
@@ -65,7 +65,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
65
65
  var ts;
66
66
  (function (ts) {
67
67
  ts.versionMajorMinor = "4.2";
68
- ts.version = ts.versionMajorMinor + ".0-dev";
68
+ ts.version = "4.2.2";
69
69
  var NativeCollections;
70
70
  (function (NativeCollections) {
71
71
  function tryGetNativeMap() {
@@ -46050,7 +46050,7 @@ var ts;
46050
46050
  }
46051
46051
  return true;
46052
46052
  }
46053
- function removeRedundantLiteralTypes(types, includes) {
46053
+ function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
46054
46054
  var i = types.length;
46055
46055
  while (i > 0) {
46056
46056
  i--;
@@ -46060,7 +46060,7 @@ var ts;
46060
46060
  flags & 256 && includes & 8 ||
46061
46061
  flags & 2048 && includes & 64 ||
46062
46062
  flags & 8192 && includes & 4096 ||
46063
- flags & 32768 && includes & 16384 ||
46063
+ reduceVoidUndefined && flags & 32768 && includes & 16384 ||
46064
46064
  isFreshLiteralType(t) && containsType(types, t.regularType);
46065
46065
  if (remove) {
46066
46066
  ts.orderedRemoveItemAt(types, i);
@@ -46121,7 +46121,7 @@ var ts;
46121
46121
  }
46122
46122
  if (unionReduction & (1 | 2)) {
46123
46123
  if (includes & (2944 | 8192) || includes & 16384 && includes & 32768) {
46124
- removeRedundantLiteralTypes(typeSet, includes);
46124
+ removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2));
46125
46125
  }
46126
46126
  if (includes & 128 && includes & 134217728) {
46127
46127
  removeStringLiteralsMatchedByTemplateLiterals(typeSet);
@@ -53172,7 +53172,16 @@ var ts;
53172
53172
  var type = getTypeOfDottedName(node.expression, diagnostic);
53173
53173
  if (type) {
53174
53174
  var name = node.name;
53175
- var prop = getPropertyOfType(type, ts.isPrivateIdentifier(name) ? ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
53175
+ var prop = void 0;
53176
+ if (ts.isPrivateIdentifier(name)) {
53177
+ if (!type.symbol) {
53178
+ return undefined;
53179
+ }
53180
+ prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
53181
+ }
53182
+ else {
53183
+ prop = getPropertyOfType(type, name.escapedText);
53184
+ }
53176
53185
  return prop && getExplicitTypeOfSymbol(prop, diagnostic);
53177
53186
  }
53178
53187
  return undefined;
@@ -62908,7 +62917,9 @@ var ts;
62908
62917
  : ts.isPropertyAccessExpression(location) ? location.name
62909
62918
  : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
62910
62919
  : undefined;
62911
- if (!testedNode) {
62920
+ var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
62921
+ && ts.isAssertionExpression(ts.skipParentheses(location.expression));
62922
+ if (!testedNode || isPropertyExpressionCast) {
62912
62923
  return;
62913
62924
  }
62914
62925
  var possiblyFalsy = getFalsyFlags(type);
package/lib/tsserver.js CHANGED
@@ -96,7 +96,7 @@ var ts;
96
96
  // The following is baselined as a literal template type without intervention
97
97
  /** The version of the TypeScript compiler release */
98
98
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
99
- ts.version = ts.versionMajorMinor + ".0-dev";
99
+ ts.version = "4.2.2";
100
100
  /* @internal */
101
101
  var Comparison;
102
102
  (function (Comparison) {
@@ -55677,7 +55677,7 @@ var ts;
55677
55677
  }
55678
55678
  return true;
55679
55679
  }
55680
- function removeRedundantLiteralTypes(types, includes) {
55680
+ function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
55681
55681
  var i = types.length;
55682
55682
  while (i > 0) {
55683
55683
  i--;
@@ -55687,7 +55687,7 @@ var ts;
55687
55687
  flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
55688
55688
  flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
55689
55689
  flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
55690
- flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55690
+ reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55691
55691
  isFreshLiteralType(t) && containsType(types, t.regularType);
55692
55692
  if (remove) {
55693
55693
  ts.orderedRemoveItemAt(types, i);
@@ -55755,7 +55755,7 @@ var ts;
55755
55755
  }
55756
55756
  if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
55757
55757
  if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
55758
- removeRedundantLiteralTypes(typeSet, includes);
55758
+ removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
55759
55759
  }
55760
55760
  if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
55761
55761
  removeStringLiteralsMatchedByTemplateLiterals(typeSet);
@@ -63776,7 +63776,16 @@ var ts;
63776
63776
  var type = getTypeOfDottedName(node.expression, diagnostic);
63777
63777
  if (type) {
63778
63778
  var name = node.name;
63779
- var prop = getPropertyOfType(type, ts.isPrivateIdentifier(name) ? ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
63779
+ var prop = void 0;
63780
+ if (ts.isPrivateIdentifier(name)) {
63781
+ if (!type.symbol) {
63782
+ return undefined;
63783
+ }
63784
+ prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
63785
+ }
63786
+ else {
63787
+ prop = getPropertyOfType(type, name.escapedText);
63788
+ }
63780
63789
  return prop && getExplicitTypeOfSymbol(prop, diagnostic);
63781
63790
  }
63782
63791
  return undefined;
@@ -75193,7 +75202,9 @@ var ts;
75193
75202
  : ts.isPropertyAccessExpression(location) ? location.name
75194
75203
  : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
75195
75204
  : undefined;
75196
- if (!testedNode) {
75205
+ var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
75206
+ && ts.isAssertionExpression(ts.skipParentheses(location.expression));
75207
+ if (!testedNode || isPropertyExpressionCast) {
75197
75208
  return;
75198
75209
  }
75199
75210
  var possiblyFalsy = getFalsyFlags(type);
@@ -290,7 +290,7 @@ var ts;
290
290
  // The following is baselined as a literal template type without intervention
291
291
  /** The version of the TypeScript compiler release */
292
292
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
293
- ts.version = ts.versionMajorMinor + ".0-dev";
293
+ ts.version = "4.2.2";
294
294
  /* @internal */
295
295
  var Comparison;
296
296
  (function (Comparison) {
@@ -55871,7 +55871,7 @@ var ts;
55871
55871
  }
55872
55872
  return true;
55873
55873
  }
55874
- function removeRedundantLiteralTypes(types, includes) {
55874
+ function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
55875
55875
  var i = types.length;
55876
55876
  while (i > 0) {
55877
55877
  i--;
@@ -55881,7 +55881,7 @@ var ts;
55881
55881
  flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
55882
55882
  flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
55883
55883
  flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
55884
- flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55884
+ reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55885
55885
  isFreshLiteralType(t) && containsType(types, t.regularType);
55886
55886
  if (remove) {
55887
55887
  ts.orderedRemoveItemAt(types, i);
@@ -55949,7 +55949,7 @@ var ts;
55949
55949
  }
55950
55950
  if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
55951
55951
  if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
55952
- removeRedundantLiteralTypes(typeSet, includes);
55952
+ removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
55953
55953
  }
55954
55954
  if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
55955
55955
  removeStringLiteralsMatchedByTemplateLiterals(typeSet);
@@ -63970,7 +63970,16 @@ var ts;
63970
63970
  var type = getTypeOfDottedName(node.expression, diagnostic);
63971
63971
  if (type) {
63972
63972
  var name = node.name;
63973
- var prop = getPropertyOfType(type, ts.isPrivateIdentifier(name) ? ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
63973
+ var prop = void 0;
63974
+ if (ts.isPrivateIdentifier(name)) {
63975
+ if (!type.symbol) {
63976
+ return undefined;
63977
+ }
63978
+ prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
63979
+ }
63980
+ else {
63981
+ prop = getPropertyOfType(type, name.escapedText);
63982
+ }
63974
63983
  return prop && getExplicitTypeOfSymbol(prop, diagnostic);
63975
63984
  }
63976
63985
  return undefined;
@@ -75387,7 +75396,9 @@ var ts;
75387
75396
  : ts.isPropertyAccessExpression(location) ? location.name
75388
75397
  : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
75389
75398
  : undefined;
75390
- if (!testedNode) {
75399
+ var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
75400
+ && ts.isAssertionExpression(ts.skipParentheses(location.expression));
75401
+ if (!testedNode || isPropertyExpressionCast) {
75391
75402
  return;
75392
75403
  }
75393
75404
  var possiblyFalsy = getFalsyFlags(type);
package/lib/typescript.js CHANGED
@@ -290,7 +290,7 @@ var ts;
290
290
  // The following is baselined as a literal template type without intervention
291
291
  /** The version of the TypeScript compiler release */
292
292
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
293
- ts.version = ts.versionMajorMinor + ".0-dev";
293
+ ts.version = "4.2.2";
294
294
  /* @internal */
295
295
  var Comparison;
296
296
  (function (Comparison) {
@@ -55871,7 +55871,7 @@ var ts;
55871
55871
  }
55872
55872
  return true;
55873
55873
  }
55874
- function removeRedundantLiteralTypes(types, includes) {
55874
+ function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
55875
55875
  var i = types.length;
55876
55876
  while (i > 0) {
55877
55877
  i--;
@@ -55881,7 +55881,7 @@ var ts;
55881
55881
  flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
55882
55882
  flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
55883
55883
  flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
55884
- flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55884
+ reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55885
55885
  isFreshLiteralType(t) && containsType(types, t.regularType);
55886
55886
  if (remove) {
55887
55887
  ts.orderedRemoveItemAt(types, i);
@@ -55949,7 +55949,7 @@ var ts;
55949
55949
  }
55950
55950
  if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
55951
55951
  if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
55952
- removeRedundantLiteralTypes(typeSet, includes);
55952
+ removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
55953
55953
  }
55954
55954
  if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
55955
55955
  removeStringLiteralsMatchedByTemplateLiterals(typeSet);
@@ -63970,7 +63970,16 @@ var ts;
63970
63970
  var type = getTypeOfDottedName(node.expression, diagnostic);
63971
63971
  if (type) {
63972
63972
  var name = node.name;
63973
- var prop = getPropertyOfType(type, ts.isPrivateIdentifier(name) ? ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
63973
+ var prop = void 0;
63974
+ if (ts.isPrivateIdentifier(name)) {
63975
+ if (!type.symbol) {
63976
+ return undefined;
63977
+ }
63978
+ prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
63979
+ }
63980
+ else {
63981
+ prop = getPropertyOfType(type, name.escapedText);
63982
+ }
63974
63983
  return prop && getExplicitTypeOfSymbol(prop, diagnostic);
63975
63984
  }
63976
63985
  return undefined;
@@ -75387,7 +75396,9 @@ var ts;
75387
75396
  : ts.isPropertyAccessExpression(location) ? location.name
75388
75397
  : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
75389
75398
  : undefined;
75390
- if (!testedNode) {
75399
+ var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
75400
+ && ts.isAssertionExpression(ts.skipParentheses(location.expression));
75401
+ if (!testedNode || isPropertyExpressionCast) {
75391
75402
  return;
75392
75403
  }
75393
75404
  var possiblyFalsy = getFalsyFlags(type);
@@ -290,7 +290,7 @@ var ts;
290
290
  // The following is baselined as a literal template type without intervention
291
291
  /** The version of the TypeScript compiler release */
292
292
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
293
- ts.version = ts.versionMajorMinor + ".0-dev";
293
+ ts.version = "4.2.2";
294
294
  /* @internal */
295
295
  var Comparison;
296
296
  (function (Comparison) {
@@ -55871,7 +55871,7 @@ var ts;
55871
55871
  }
55872
55872
  return true;
55873
55873
  }
55874
- function removeRedundantLiteralTypes(types, includes) {
55874
+ function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
55875
55875
  var i = types.length;
55876
55876
  while (i > 0) {
55877
55877
  i--;
@@ -55881,7 +55881,7 @@ var ts;
55881
55881
  flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
55882
55882
  flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
55883
55883
  flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
55884
- flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55884
+ reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55885
55885
  isFreshLiteralType(t) && containsType(types, t.regularType);
55886
55886
  if (remove) {
55887
55887
  ts.orderedRemoveItemAt(types, i);
@@ -55949,7 +55949,7 @@ var ts;
55949
55949
  }
55950
55950
  if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
55951
55951
  if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
55952
- removeRedundantLiteralTypes(typeSet, includes);
55952
+ removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
55953
55953
  }
55954
55954
  if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
55955
55955
  removeStringLiteralsMatchedByTemplateLiterals(typeSet);
@@ -63970,7 +63970,16 @@ var ts;
63970
63970
  var type = getTypeOfDottedName(node.expression, diagnostic);
63971
63971
  if (type) {
63972
63972
  var name = node.name;
63973
- var prop = getPropertyOfType(type, ts.isPrivateIdentifier(name) ? ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
63973
+ var prop = void 0;
63974
+ if (ts.isPrivateIdentifier(name)) {
63975
+ if (!type.symbol) {
63976
+ return undefined;
63977
+ }
63978
+ prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
63979
+ }
63980
+ else {
63981
+ prop = getPropertyOfType(type, name.escapedText);
63982
+ }
63974
63983
  return prop && getExplicitTypeOfSymbol(prop, diagnostic);
63975
63984
  }
63976
63985
  return undefined;
@@ -75387,7 +75396,9 @@ var ts;
75387
75396
  : ts.isPropertyAccessExpression(location) ? location.name
75388
75397
  : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
75389
75398
  : undefined;
75390
- if (!testedNode) {
75399
+ var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
75400
+ && ts.isAssertionExpression(ts.skipParentheses(location.expression));
75401
+ if (!testedNode || isPropertyExpressionCast) {
75391
75402
  return;
75392
75403
  }
75393
75404
  var possiblyFalsy = getFalsyFlags(type);
@@ -85,7 +85,7 @@ var ts;
85
85
  // The following is baselined as a literal template type without intervention
86
86
  /** The version of the TypeScript compiler release */
87
87
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
88
- ts.version = ts.versionMajorMinor + ".0-dev";
88
+ ts.version = "4.2.2";
89
89
  /* @internal */
90
90
  var Comparison;
91
91
  (function (Comparison) {
@@ -55666,7 +55666,7 @@ var ts;
55666
55666
  }
55667
55667
  return true;
55668
55668
  }
55669
- function removeRedundantLiteralTypes(types, includes) {
55669
+ function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
55670
55670
  var i = types.length;
55671
55671
  while (i > 0) {
55672
55672
  i--;
@@ -55676,7 +55676,7 @@ var ts;
55676
55676
  flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
55677
55677
  flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
55678
55678
  flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
55679
- flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55679
+ reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
55680
55680
  isFreshLiteralType(t) && containsType(types, t.regularType);
55681
55681
  if (remove) {
55682
55682
  ts.orderedRemoveItemAt(types, i);
@@ -55744,7 +55744,7 @@ var ts;
55744
55744
  }
55745
55745
  if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
55746
55746
  if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
55747
- removeRedundantLiteralTypes(typeSet, includes);
55747
+ removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
55748
55748
  }
55749
55749
  if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
55750
55750
  removeStringLiteralsMatchedByTemplateLiterals(typeSet);
@@ -63765,7 +63765,16 @@ var ts;
63765
63765
  var type = getTypeOfDottedName(node.expression, diagnostic);
63766
63766
  if (type) {
63767
63767
  var name = node.name;
63768
- var prop = getPropertyOfType(type, ts.isPrivateIdentifier(name) ? ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
63768
+ var prop = void 0;
63769
+ if (ts.isPrivateIdentifier(name)) {
63770
+ if (!type.symbol) {
63771
+ return undefined;
63772
+ }
63773
+ prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
63774
+ }
63775
+ else {
63776
+ prop = getPropertyOfType(type, name.escapedText);
63777
+ }
63769
63778
  return prop && getExplicitTypeOfSymbol(prop, diagnostic);
63770
63779
  }
63771
63780
  return undefined;
@@ -75182,7 +75191,9 @@ var ts;
75182
75191
  : ts.isPropertyAccessExpression(location) ? location.name
75183
75192
  : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
75184
75193
  : undefined;
75185
- if (!testedNode) {
75194
+ var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
75195
+ && ts.isAssertionExpression(ts.skipParentheses(location.expression));
75196
+ if (!testedNode || isPropertyExpressionCast) {
75186
75197
  return;
75187
75198
  }
75188
75199
  var possiblyFalsy = getFalsyFlags(type);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.2.1-rc",
5
+ "version": "4.2.2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [