typescript 4.6.0-dev.20220121 → 4.6.0-dev.20220125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -69,15 +69,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.6";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220121";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220125";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
+ var globals = typeof globalThis !== "undefined" ? globalThis :
76
+ typeof global !== "undefined" ? global :
77
+ typeof self !== "undefined" ? self :
78
+ undefined;
75
79
  function tryGetNativeMap() {
76
- return typeof Map !== "undefined" && "entries" in Map.prototype && new Map([[0, 0]]).size === 1 ? Map : undefined;
80
+ var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
81
+ return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
77
82
  }
78
83
  NativeCollections.tryGetNativeMap = tryGetNativeMap;
79
84
  function tryGetNativeSet() {
80
- return typeof Set !== "undefined" && "entries" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;
85
+ var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
86
+ return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
81
87
  }
82
88
  NativeCollections.tryGetNativeSet = tryGetNativeSet;
83
89
  })(NativeCollections || (NativeCollections = {}));
@@ -56693,10 +56699,21 @@ var ts;
56693
56699
  }
56694
56700
  if (flags & 2097152) {
56695
56701
  ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068));
56696
- return ts.reduceLeft(type.types, function (facts, t) { return facts & getTypeFacts(t, ignoreObjects); }, 16777215);
56702
+ return getIntersectionTypeFacts(type, ignoreObjects);
56697
56703
  }
56698
56704
  return 16777215;
56699
56705
  }
56706
+ function getIntersectionTypeFacts(type, ignoreObjects) {
56707
+ var oredFacts = 0;
56708
+ var andedFacts = 16777215;
56709
+ for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
56710
+ var t = _a[_i];
56711
+ var f = getTypeFacts(t, ignoreObjects);
56712
+ oredFacts |= f;
56713
+ andedFacts &= f;
56714
+ }
56715
+ return oredFacts & 8288 | andedFacts & 16768927;
56716
+ }
56700
56717
  function getTypeWithFacts(type, include) {
56701
56718
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
56702
56719
  }
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20220121";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20220125";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -111,13 +111,18 @@ var ts;
111
111
  /* @internal */
112
112
  var NativeCollections;
113
113
  (function (NativeCollections) {
114
+ var globals = typeof globalThis !== "undefined" ? globalThis :
115
+ typeof global !== "undefined" ? global :
116
+ typeof self !== "undefined" ? self :
117
+ undefined;
114
118
  /**
115
119
  * Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
116
120
  */
117
121
  function tryGetNativeMap() {
118
122
  // Internet Explorer's Map doesn't support iteration, so don't use it.
123
+ var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
119
124
  // eslint-disable-next-line no-in-operator
120
- return typeof Map !== "undefined" && "entries" in Map.prototype && new Map([[0, 0]]).size === 1 ? Map : undefined;
125
+ return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
121
126
  }
122
127
  NativeCollections.tryGetNativeMap = tryGetNativeMap;
123
128
  /**
@@ -125,8 +130,9 @@ var ts;
125
130
  */
126
131
  function tryGetNativeSet() {
127
132
  // Internet Explorer's Set doesn't support iteration, so don't use it.
133
+ var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
128
134
  // eslint-disable-next-line no-in-operator
129
- return typeof Set !== "undefined" && "entries" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;
135
+ return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
130
136
  }
131
137
  NativeCollections.tryGetNativeSet = tryGetNativeSet;
132
138
  })(NativeCollections || (NativeCollections = {}));
@@ -46788,6 +46794,9 @@ var ts;
46788
46794
  TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 16318463] = "EmptyObjectStrictFacts";
46789
46795
  TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
46790
46796
  TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
46797
+ // Masks
46798
+ TypeFacts[TypeFacts["OrFactsMask"] = 8288] = "OrFactsMask";
46799
+ TypeFacts[TypeFacts["AndFactsMask"] = 16768927] = "AndFactsMask";
46791
46800
  })(TypeFacts || (TypeFacts = {}));
46792
46801
  var typeofEQFacts = new ts.Map(ts.getEntries({
46793
46802
  string: 1 /* TypeofEQString */,
@@ -67929,10 +67938,23 @@ var ts;
67929
67938
  // When an intersection contains a primitive type we ignore object type constituents as they are
67930
67939
  // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
67931
67940
  ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
67932
- return ts.reduceLeft(type.types, function (facts, t) { return facts & getTypeFacts(t, ignoreObjects); }, 16777215 /* All */);
67941
+ return getIntersectionTypeFacts(type, ignoreObjects);
67933
67942
  }
67934
67943
  return 16777215 /* All */;
67935
67944
  }
67945
+ function getIntersectionTypeFacts(type, ignoreObjects) {
67946
+ // When computing the type facts of an intersection type, certain type facts are computed as `and`
67947
+ // and others are computed as `or`.
67948
+ var oredFacts = 0 /* None */;
67949
+ var andedFacts = 16777215 /* All */;
67950
+ for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
67951
+ var t = _a[_i];
67952
+ var f = getTypeFacts(t, ignoreObjects);
67953
+ oredFacts |= f;
67954
+ andedFacts &= f;
67955
+ }
67956
+ return oredFacts & 8288 /* OrFactsMask */ | andedFacts & 16768927 /* AndFactsMask */;
67957
+ }
67936
67958
  function getTypeWithFacts(type, include) {
67937
67959
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
67938
67960
  }
@@ -136279,7 +136301,7 @@ var ts;
136279
136301
  return file && { reference: libReferenceDirective, fileName: file.fileName, file: file, unverified: false };
136280
136302
  }
136281
136303
  if ((_a = sourceFile.resolvedModules) === null || _a === void 0 ? void 0 : _a.size()) {
136282
- var node = ts.getTokenAtPosition(sourceFile, position);
136304
+ var node = ts.getTouchingToken(sourceFile, position);
136283
136305
  if (ts.isModuleSpecifierLike(node) && ts.isExternalModuleNameRelative(node.text) && sourceFile.resolvedModules.has(node.text, ts.getModeForUsageLocation(sourceFile, node))) {
136284
136306
  var verifiedFileName = (_b = sourceFile.resolvedModules.get(node.text, ts.getModeForUsageLocation(sourceFile, node))) === null || _b === void 0 ? void 0 : _b.resolvedFileName;
136285
136307
  var fileName = verifiedFileName || ts.resolvePath(ts.getDirectoryPath(sourceFile.fileName), node.text);
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20220121";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220125";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -305,13 +305,18 @@ var ts;
305
305
  /* @internal */
306
306
  var NativeCollections;
307
307
  (function (NativeCollections) {
308
+ var globals = typeof globalThis !== "undefined" ? globalThis :
309
+ typeof global !== "undefined" ? global :
310
+ typeof self !== "undefined" ? self :
311
+ undefined;
308
312
  /**
309
313
  * Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
310
314
  */
311
315
  function tryGetNativeMap() {
312
316
  // Internet Explorer's Map doesn't support iteration, so don't use it.
317
+ var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
313
318
  // eslint-disable-next-line no-in-operator
314
- return typeof Map !== "undefined" && "entries" in Map.prototype && new Map([[0, 0]]).size === 1 ? Map : undefined;
319
+ return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
315
320
  }
316
321
  NativeCollections.tryGetNativeMap = tryGetNativeMap;
317
322
  /**
@@ -319,8 +324,9 @@ var ts;
319
324
  */
320
325
  function tryGetNativeSet() {
321
326
  // Internet Explorer's Set doesn't support iteration, so don't use it.
327
+ var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
322
328
  // eslint-disable-next-line no-in-operator
323
- return typeof Set !== "undefined" && "entries" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;
329
+ return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
324
330
  }
325
331
  NativeCollections.tryGetNativeSet = tryGetNativeSet;
326
332
  })(NativeCollections || (NativeCollections = {}));
@@ -46982,6 +46988,9 @@ var ts;
46982
46988
  TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 16318463] = "EmptyObjectStrictFacts";
46983
46989
  TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
46984
46990
  TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
46991
+ // Masks
46992
+ TypeFacts[TypeFacts["OrFactsMask"] = 8288] = "OrFactsMask";
46993
+ TypeFacts[TypeFacts["AndFactsMask"] = 16768927] = "AndFactsMask";
46985
46994
  })(TypeFacts || (TypeFacts = {}));
46986
46995
  var typeofEQFacts = new ts.Map(ts.getEntries({
46987
46996
  string: 1 /* TypeofEQString */,
@@ -68123,10 +68132,23 @@ var ts;
68123
68132
  // When an intersection contains a primitive type we ignore object type constituents as they are
68124
68133
  // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
68125
68134
  ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
68126
- return ts.reduceLeft(type.types, function (facts, t) { return facts & getTypeFacts(t, ignoreObjects); }, 16777215 /* All */);
68135
+ return getIntersectionTypeFacts(type, ignoreObjects);
68127
68136
  }
68128
68137
  return 16777215 /* All */;
68129
68138
  }
68139
+ function getIntersectionTypeFacts(type, ignoreObjects) {
68140
+ // When computing the type facts of an intersection type, certain type facts are computed as `and`
68141
+ // and others are computed as `or`.
68142
+ var oredFacts = 0 /* None */;
68143
+ var andedFacts = 16777215 /* All */;
68144
+ for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
68145
+ var t = _a[_i];
68146
+ var f = getTypeFacts(t, ignoreObjects);
68147
+ oredFacts |= f;
68148
+ andedFacts &= f;
68149
+ }
68150
+ return oredFacts & 8288 /* OrFactsMask */ | andedFacts & 16768927 /* AndFactsMask */;
68151
+ }
68130
68152
  function getTypeWithFacts(type, include) {
68131
68153
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
68132
68154
  }
@@ -136890,7 +136912,7 @@ var ts;
136890
136912
  return file && { reference: libReferenceDirective, fileName: file.fileName, file: file, unverified: false };
136891
136913
  }
136892
136914
  if ((_a = sourceFile.resolvedModules) === null || _a === void 0 ? void 0 : _a.size()) {
136893
- var node = ts.getTokenAtPosition(sourceFile, position);
136915
+ var node = ts.getTouchingToken(sourceFile, position);
136894
136916
  if (ts.isModuleSpecifierLike(node) && ts.isExternalModuleNameRelative(node.text) && sourceFile.resolvedModules.has(node.text, ts.getModeForUsageLocation(sourceFile, node))) {
136895
136917
  var verifiedFileName = (_b = sourceFile.resolvedModules.get(node.text, ts.getModeForUsageLocation(sourceFile, node))) === null || _b === void 0 ? void 0 : _b.resolvedFileName;
136896
136918
  var fileName = verifiedFileName || ts.resolvePath(ts.getDirectoryPath(sourceFile.fileName), node.text);
package/lib/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20220121";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220125";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -305,13 +305,18 @@ var ts;
305
305
  /* @internal */
306
306
  var NativeCollections;
307
307
  (function (NativeCollections) {
308
+ var globals = typeof globalThis !== "undefined" ? globalThis :
309
+ typeof global !== "undefined" ? global :
310
+ typeof self !== "undefined" ? self :
311
+ undefined;
308
312
  /**
309
313
  * Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
310
314
  */
311
315
  function tryGetNativeMap() {
312
316
  // Internet Explorer's Map doesn't support iteration, so don't use it.
317
+ var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
313
318
  // eslint-disable-next-line no-in-operator
314
- return typeof Map !== "undefined" && "entries" in Map.prototype && new Map([[0, 0]]).size === 1 ? Map : undefined;
319
+ return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
315
320
  }
316
321
  NativeCollections.tryGetNativeMap = tryGetNativeMap;
317
322
  /**
@@ -319,8 +324,9 @@ var ts;
319
324
  */
320
325
  function tryGetNativeSet() {
321
326
  // Internet Explorer's Set doesn't support iteration, so don't use it.
327
+ var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
322
328
  // eslint-disable-next-line no-in-operator
323
- return typeof Set !== "undefined" && "entries" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;
329
+ return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
324
330
  }
325
331
  NativeCollections.tryGetNativeSet = tryGetNativeSet;
326
332
  })(NativeCollections || (NativeCollections = {}));
@@ -46982,6 +46988,9 @@ var ts;
46982
46988
  TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 16318463] = "EmptyObjectStrictFacts";
46983
46989
  TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
46984
46990
  TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
46991
+ // Masks
46992
+ TypeFacts[TypeFacts["OrFactsMask"] = 8288] = "OrFactsMask";
46993
+ TypeFacts[TypeFacts["AndFactsMask"] = 16768927] = "AndFactsMask";
46985
46994
  })(TypeFacts || (TypeFacts = {}));
46986
46995
  var typeofEQFacts = new ts.Map(ts.getEntries({
46987
46996
  string: 1 /* TypeofEQString */,
@@ -68123,10 +68132,23 @@ var ts;
68123
68132
  // When an intersection contains a primitive type we ignore object type constituents as they are
68124
68133
  // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
68125
68134
  ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
68126
- return ts.reduceLeft(type.types, function (facts, t) { return facts & getTypeFacts(t, ignoreObjects); }, 16777215 /* All */);
68135
+ return getIntersectionTypeFacts(type, ignoreObjects);
68127
68136
  }
68128
68137
  return 16777215 /* All */;
68129
68138
  }
68139
+ function getIntersectionTypeFacts(type, ignoreObjects) {
68140
+ // When computing the type facts of an intersection type, certain type facts are computed as `and`
68141
+ // and others are computed as `or`.
68142
+ var oredFacts = 0 /* None */;
68143
+ var andedFacts = 16777215 /* All */;
68144
+ for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
68145
+ var t = _a[_i];
68146
+ var f = getTypeFacts(t, ignoreObjects);
68147
+ oredFacts |= f;
68148
+ andedFacts &= f;
68149
+ }
68150
+ return oredFacts & 8288 /* OrFactsMask */ | andedFacts & 16768927 /* AndFactsMask */;
68151
+ }
68130
68152
  function getTypeWithFacts(type, include) {
68131
68153
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
68132
68154
  }
@@ -136890,7 +136912,7 @@ var ts;
136890
136912
  return file && { reference: libReferenceDirective, fileName: file.fileName, file: file, unverified: false };
136891
136913
  }
136892
136914
  if ((_a = sourceFile.resolvedModules) === null || _a === void 0 ? void 0 : _a.size()) {
136893
- var node = ts.getTokenAtPosition(sourceFile, position);
136915
+ var node = ts.getTouchingToken(sourceFile, position);
136894
136916
  if (ts.isModuleSpecifierLike(node) && ts.isExternalModuleNameRelative(node.text) && sourceFile.resolvedModules.has(node.text, ts.getModeForUsageLocation(sourceFile, node))) {
136895
136917
  var verifiedFileName = (_b = sourceFile.resolvedModules.get(node.text, ts.getModeForUsageLocation(sourceFile, node))) === null || _b === void 0 ? void 0 : _b.resolvedFileName;
136896
136918
  var fileName = verifiedFileName || ts.resolvePath(ts.getDirectoryPath(sourceFile.fileName), node.text);
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20220121";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220125";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -305,13 +305,18 @@ var ts;
305
305
  /* @internal */
306
306
  var NativeCollections;
307
307
  (function (NativeCollections) {
308
+ var globals = typeof globalThis !== "undefined" ? globalThis :
309
+ typeof global !== "undefined" ? global :
310
+ typeof self !== "undefined" ? self :
311
+ undefined;
308
312
  /**
309
313
  * Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
310
314
  */
311
315
  function tryGetNativeMap() {
312
316
  // Internet Explorer's Map doesn't support iteration, so don't use it.
317
+ var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
313
318
  // eslint-disable-next-line no-in-operator
314
- return typeof Map !== "undefined" && "entries" in Map.prototype && new Map([[0, 0]]).size === 1 ? Map : undefined;
319
+ return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
315
320
  }
316
321
  NativeCollections.tryGetNativeMap = tryGetNativeMap;
317
322
  /**
@@ -319,8 +324,9 @@ var ts;
319
324
  */
320
325
  function tryGetNativeSet() {
321
326
  // Internet Explorer's Set doesn't support iteration, so don't use it.
327
+ var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
322
328
  // eslint-disable-next-line no-in-operator
323
- return typeof Set !== "undefined" && "entries" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;
329
+ return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
324
330
  }
325
331
  NativeCollections.tryGetNativeSet = tryGetNativeSet;
326
332
  })(NativeCollections || (NativeCollections = {}));
@@ -46982,6 +46988,9 @@ var ts;
46982
46988
  TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 16318463] = "EmptyObjectStrictFacts";
46983
46989
  TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
46984
46990
  TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
46991
+ // Masks
46992
+ TypeFacts[TypeFacts["OrFactsMask"] = 8288] = "OrFactsMask";
46993
+ TypeFacts[TypeFacts["AndFactsMask"] = 16768927] = "AndFactsMask";
46985
46994
  })(TypeFacts || (TypeFacts = {}));
46986
46995
  var typeofEQFacts = new ts.Map(ts.getEntries({
46987
46996
  string: 1 /* TypeofEQString */,
@@ -68123,10 +68132,23 @@ var ts;
68123
68132
  // When an intersection contains a primitive type we ignore object type constituents as they are
68124
68133
  // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
68125
68134
  ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
68126
- return ts.reduceLeft(type.types, function (facts, t) { return facts & getTypeFacts(t, ignoreObjects); }, 16777215 /* All */);
68135
+ return getIntersectionTypeFacts(type, ignoreObjects);
68127
68136
  }
68128
68137
  return 16777215 /* All */;
68129
68138
  }
68139
+ function getIntersectionTypeFacts(type, ignoreObjects) {
68140
+ // When computing the type facts of an intersection type, certain type facts are computed as `and`
68141
+ // and others are computed as `or`.
68142
+ var oredFacts = 0 /* None */;
68143
+ var andedFacts = 16777215 /* All */;
68144
+ for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
68145
+ var t = _a[_i];
68146
+ var f = getTypeFacts(t, ignoreObjects);
68147
+ oredFacts |= f;
68148
+ andedFacts &= f;
68149
+ }
68150
+ return oredFacts & 8288 /* OrFactsMask */ | andedFacts & 16768927 /* AndFactsMask */;
68151
+ }
68130
68152
  function getTypeWithFacts(type, include) {
68131
68153
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
68132
68154
  }
@@ -136890,7 +136912,7 @@ var ts;
136890
136912
  return file && { reference: libReferenceDirective, fileName: file.fileName, file: file, unverified: false };
136891
136913
  }
136892
136914
  if ((_a = sourceFile.resolvedModules) === null || _a === void 0 ? void 0 : _a.size()) {
136893
- var node = ts.getTokenAtPosition(sourceFile, position);
136915
+ var node = ts.getTouchingToken(sourceFile, position);
136894
136916
  if (ts.isModuleSpecifierLike(node) && ts.isExternalModuleNameRelative(node.text) && sourceFile.resolvedModules.has(node.text, ts.getModeForUsageLocation(sourceFile, node))) {
136895
136917
  var verifiedFileName = (_b = sourceFile.resolvedModules.get(node.text, ts.getModeForUsageLocation(sourceFile, node))) === null || _b === void 0 ? void 0 : _b.resolvedFileName;
136896
136918
  var fileName = verifiedFileName || ts.resolvePath(ts.getDirectoryPath(sourceFile.fileName), node.text);
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20220121";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220125";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -100,13 +100,18 @@ var ts;
100
100
  /* @internal */
101
101
  var NativeCollections;
102
102
  (function (NativeCollections) {
103
+ var globals = typeof globalThis !== "undefined" ? globalThis :
104
+ typeof global !== "undefined" ? global :
105
+ typeof self !== "undefined" ? self :
106
+ undefined;
103
107
  /**
104
108
  * Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
105
109
  */
106
110
  function tryGetNativeMap() {
107
111
  // Internet Explorer's Map doesn't support iteration, so don't use it.
112
+ var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
108
113
  // eslint-disable-next-line no-in-operator
109
- return typeof Map !== "undefined" && "entries" in Map.prototype && new Map([[0, 0]]).size === 1 ? Map : undefined;
114
+ return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
110
115
  }
111
116
  NativeCollections.tryGetNativeMap = tryGetNativeMap;
112
117
  /**
@@ -114,8 +119,9 @@ var ts;
114
119
  */
115
120
  function tryGetNativeSet() {
116
121
  // Internet Explorer's Set doesn't support iteration, so don't use it.
122
+ var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
117
123
  // eslint-disable-next-line no-in-operator
118
- return typeof Set !== "undefined" && "entries" in Set.prototype && new Set([0]).size === 1 ? Set : undefined;
124
+ return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
119
125
  }
120
126
  NativeCollections.tryGetNativeSet = tryGetNativeSet;
121
127
  })(NativeCollections || (NativeCollections = {}));
@@ -46777,6 +46783,9 @@ var ts;
46777
46783
  TypeFacts[TypeFacts["EmptyObjectStrictFacts"] = 16318463] = "EmptyObjectStrictFacts";
46778
46784
  TypeFacts[TypeFacts["AllTypeofNE"] = 556800] = "AllTypeofNE";
46779
46785
  TypeFacts[TypeFacts["EmptyObjectFacts"] = 16777215] = "EmptyObjectFacts";
46786
+ // Masks
46787
+ TypeFacts[TypeFacts["OrFactsMask"] = 8288] = "OrFactsMask";
46788
+ TypeFacts[TypeFacts["AndFactsMask"] = 16768927] = "AndFactsMask";
46780
46789
  })(TypeFacts || (TypeFacts = {}));
46781
46790
  var typeofEQFacts = new ts.Map(ts.getEntries({
46782
46791
  string: 1 /* TypeofEQString */,
@@ -67918,10 +67927,23 @@ var ts;
67918
67927
  // When an intersection contains a primitive type we ignore object type constituents as they are
67919
67928
  // presumably type tags. For example, in string & { __kind__: "name" } we ignore the object type.
67920
67929
  ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068 /* Primitive */));
67921
- return ts.reduceLeft(type.types, function (facts, t) { return facts & getTypeFacts(t, ignoreObjects); }, 16777215 /* All */);
67930
+ return getIntersectionTypeFacts(type, ignoreObjects);
67922
67931
  }
67923
67932
  return 16777215 /* All */;
67924
67933
  }
67934
+ function getIntersectionTypeFacts(type, ignoreObjects) {
67935
+ // When computing the type facts of an intersection type, certain type facts are computed as `and`
67936
+ // and others are computed as `or`.
67937
+ var oredFacts = 0 /* None */;
67938
+ var andedFacts = 16777215 /* All */;
67939
+ for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
67940
+ var t = _a[_i];
67941
+ var f = getTypeFacts(t, ignoreObjects);
67942
+ oredFacts |= f;
67943
+ andedFacts &= f;
67944
+ }
67945
+ return oredFacts & 8288 /* OrFactsMask */ | andedFacts & 16768927 /* AndFactsMask */;
67946
+ }
67925
67947
  function getTypeWithFacts(type, include) {
67926
67948
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
67927
67949
  }
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.6.0-dev.20220121",
5
+ "version": "4.6.0-dev.20220125",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [