@typescript-deploys/pr-build 5.1.0-pr-53134-21 → 5.1.0-pr-53192-9
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/ThirdPartyNoticeText.txt +13 -13
- package/lib/lib.dom.d.ts +743 -16
- package/lib/lib.dom.iterable.d.ts +28 -0
- package/lib/lib.es5.d.ts +0 -6
- package/lib/lib.webworker.d.ts +577 -4
- package/lib/lib.webworker.iterable.d.ts +28 -0
- package/lib/tsc.js +32 -32
- package/lib/tsserver.js +36 -39
- package/lib/tsserverlibrary.d.ts +0 -1
- package/lib/tsserverlibrary.js +34 -35
- package/lib/typescript.d.ts +0 -1
- package/lib/typescript.js +34 -34
- package/lib/typingsInstaller.js +3 -19
- package/package.json +3 -3
|
@@ -20,6 +20,27 @@ and limitations under the License.
|
|
|
20
20
|
/// Worker Iterable APIs
|
|
21
21
|
/////////////////////////////
|
|
22
22
|
|
|
23
|
+
interface CSSNumericArray {
|
|
24
|
+
[Symbol.iterator](): IterableIterator<CSSNumericValue>;
|
|
25
|
+
entries(): IterableIterator<[number, CSSNumericValue]>;
|
|
26
|
+
keys(): IterableIterator<number>;
|
|
27
|
+
values(): IterableIterator<CSSNumericValue>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface CSSTransformValue {
|
|
31
|
+
[Symbol.iterator](): IterableIterator<CSSTransformComponent>;
|
|
32
|
+
entries(): IterableIterator<[number, CSSTransformComponent]>;
|
|
33
|
+
keys(): IterableIterator<number>;
|
|
34
|
+
values(): IterableIterator<CSSTransformComponent>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface CSSUnparsedValue {
|
|
38
|
+
[Symbol.iterator](): IterableIterator<CSSUnparsedSegment>;
|
|
39
|
+
entries(): IterableIterator<[number, CSSUnparsedSegment]>;
|
|
40
|
+
keys(): IterableIterator<number>;
|
|
41
|
+
values(): IterableIterator<CSSUnparsedSegment>;
|
|
42
|
+
}
|
|
43
|
+
|
|
23
44
|
interface Cache {
|
|
24
45
|
addAll(requests: Iterable<RequestInfo>): Promise<void>;
|
|
25
46
|
}
|
|
@@ -82,6 +103,13 @@ interface MessageEvent<T = any> {
|
|
|
82
103
|
initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
|
|
83
104
|
}
|
|
84
105
|
|
|
106
|
+
interface StylePropertyMapReadOnly {
|
|
107
|
+
[Symbol.iterator](): IterableIterator<[string, Iterable<CSSStyleValue>]>;
|
|
108
|
+
entries(): IterableIterator<[string, Iterable<CSSStyleValue>]>;
|
|
109
|
+
keys(): IterableIterator<string>;
|
|
110
|
+
values(): IterableIterator<Iterable<CSSStyleValue>>;
|
|
111
|
+
}
|
|
112
|
+
|
|
85
113
|
interface SubtleCrypto {
|
|
86
114
|
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
|
|
87
115
|
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.1";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20230310`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -3743,7 +3743,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3743
3743
|
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
|
|
3744
3744
|
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
|
|
3745
3745
|
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
|
|
3746
|
-
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] =
|
|
3746
|
+
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
|
|
3747
3747
|
return TypeFlags2;
|
|
3748
3748
|
})(TypeFlags || {});
|
|
3749
3749
|
var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
@@ -4876,20 +4876,6 @@ function patchWriteFileEnsuringDirectory(sys2) {
|
|
|
4876
4876
|
(path2) => sys2.directoryExists(path2)
|
|
4877
4877
|
);
|
|
4878
4878
|
}
|
|
4879
|
-
function getNodeMajorVersion() {
|
|
4880
|
-
if (typeof process === "undefined") {
|
|
4881
|
-
return void 0;
|
|
4882
|
-
}
|
|
4883
|
-
const version2 = process.version;
|
|
4884
|
-
if (!version2) {
|
|
4885
|
-
return void 0;
|
|
4886
|
-
}
|
|
4887
|
-
const dot = version2.indexOf(".");
|
|
4888
|
-
if (dot === -1) {
|
|
4889
|
-
return void 0;
|
|
4890
|
-
}
|
|
4891
|
-
return parseInt(version2.substring(1, dot));
|
|
4892
|
-
}
|
|
4893
4879
|
var sys = (() => {
|
|
4894
4880
|
const byteOrderMarkIndicator = "\uFEFF";
|
|
4895
4881
|
function getNodeSystem() {
|
|
@@ -4906,14 +4892,12 @@ var sys = (() => {
|
|
|
4906
4892
|
let activeSession;
|
|
4907
4893
|
let profilePath = "./profile.cpuprofile";
|
|
4908
4894
|
const Buffer2 = require("buffer").Buffer;
|
|
4909
|
-
const nodeVersion = getNodeMajorVersion();
|
|
4910
|
-
const isNode4OrLater = nodeVersion >= 4;
|
|
4911
4895
|
const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
4912
4896
|
const platform = _os.platform();
|
|
4913
4897
|
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
4914
4898
|
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
4915
4899
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
4916
|
-
const fsSupportsRecursiveFsWatch =
|
|
4900
|
+
const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
|
|
4917
4901
|
const getCurrentDirectory = memoize(() => process.cwd());
|
|
4918
4902
|
const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
|
|
4919
4903
|
pollingWatchFileWorker: fsWatchFileWorker,
|
|
@@ -52679,10 +52663,9 @@ function createTypeChecker(host) {
|
|
|
52679
52663
|
return [sig.parameters];
|
|
52680
52664
|
function expandSignatureParametersWithTupleMembers(restType, restIndex) {
|
|
52681
52665
|
const elementTypes = getTypeArguments(restType);
|
|
52682
|
-
const associatedNames = restType
|
|
52666
|
+
const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
|
|
52683
52667
|
const restParams = map(elementTypes, (t, i) => {
|
|
52684
|
-
const
|
|
52685
|
-
const name = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
52668
|
+
const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
52686
52669
|
const flags = restType.target.elementFlags[i];
|
|
52687
52670
|
const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
|
|
52688
52671
|
const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
|
|
@@ -52691,6 +52674,20 @@ function createTypeChecker(host) {
|
|
|
52691
52674
|
});
|
|
52692
52675
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
52693
52676
|
}
|
|
52677
|
+
function getUniqAssociatedNamesFromTupleType(type) {
|
|
52678
|
+
const associatedNamesMap = /* @__PURE__ */ new Map();
|
|
52679
|
+
return map(type.target.labeledElementDeclarations, (labeledElement) => {
|
|
52680
|
+
const name = getTupleElementLabel(labeledElement);
|
|
52681
|
+
const prevCounter = associatedNamesMap.get(name);
|
|
52682
|
+
if (prevCounter === void 0) {
|
|
52683
|
+
associatedNamesMap.set(name, 1);
|
|
52684
|
+
return name;
|
|
52685
|
+
} else {
|
|
52686
|
+
associatedNamesMap.set(name, prevCounter + 1);
|
|
52687
|
+
return `${name}_${prevCounter}`;
|
|
52688
|
+
}
|
|
52689
|
+
});
|
|
52690
|
+
}
|
|
52694
52691
|
}
|
|
52695
52692
|
function getDefaultConstructSignatures(classType) {
|
|
52696
52693
|
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
@@ -55388,7 +55385,7 @@ function createTypeChecker(host) {
|
|
|
55388
55385
|
}
|
|
55389
55386
|
function getGlobalOmitSymbol() {
|
|
55390
55387
|
deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalTypeAliasSymbol(
|
|
55391
|
-
"
|
|
55388
|
+
"Omit",
|
|
55392
55389
|
/*arity*/
|
|
55393
55390
|
2,
|
|
55394
55391
|
/*reportErrors*/
|
|
@@ -55998,7 +55995,7 @@ function createTypeChecker(host) {
|
|
|
55998
55995
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
55999
55996
|
}
|
|
56000
55997
|
}
|
|
56001
|
-
const objectFlags = (includes &
|
|
55998
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
|
|
56002
55999
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
56003
56000
|
}
|
|
56004
56001
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -56123,7 +56120,7 @@ function createTypeChecker(host) {
|
|
|
56123
56120
|
function eachUnionContains(unionTypes2, type) {
|
|
56124
56121
|
for (const u of unionTypes2) {
|
|
56125
56122
|
if (!containsType(u.types, type)) {
|
|
56126
|
-
const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
|
|
56123
|
+
const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & (32 /* Enum */ | 256 /* NumberLiteral */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
|
|
56127
56124
|
if (!primitive || !containsType(u.types, primitive)) {
|
|
56128
56125
|
return false;
|
|
56129
56126
|
}
|
|
@@ -56150,9 +56147,6 @@ function createTypeChecker(host) {
|
|
|
56150
56147
|
}
|
|
56151
56148
|
return false;
|
|
56152
56149
|
}
|
|
56153
|
-
function eachIsUnionContaining(types, flag) {
|
|
56154
|
-
return every(types, (t) => !!(t.flags & 1048576 /* Union */) && some(t.types, (tt) => !!(tt.flags & flag)));
|
|
56155
|
-
}
|
|
56156
56150
|
function removeFromEach(types, flag) {
|
|
56157
56151
|
for (let i = 0; i < types.length; i++) {
|
|
56158
56152
|
types[i] = filterType(types[i], (t) => !(t.flags & flag));
|
|
@@ -56241,11 +56235,11 @@ function createTypeChecker(host) {
|
|
|
56241
56235
|
if (includes & 1048576 /* Union */) {
|
|
56242
56236
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
56243
56237
|
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
56244
|
-
} else if (
|
|
56238
|
+
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
|
|
56245
56239
|
const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
|
|
56246
56240
|
removeFromEach(typeSet, 32768 /* Undefined */);
|
|
56247
56241
|
result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
56248
|
-
} else if (
|
|
56242
|
+
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
56249
56243
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
56250
56244
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
56251
56245
|
} else {
|
|
@@ -59785,6 +59779,11 @@ function createTypeChecker(host) {
|
|
|
59785
59779
|
if (containsType(targetTypes, source2)) {
|
|
59786
59780
|
return -1 /* True */;
|
|
59787
59781
|
}
|
|
59782
|
+
if (getObjectFlags(target2) & 32768 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
|
|
59783
|
+
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
59784
|
+
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
59785
|
+
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
59786
|
+
}
|
|
59788
59787
|
const match = getMatchingUnionConstituentForType(target2, source2);
|
|
59789
59788
|
if (match) {
|
|
59790
59789
|
const related = isRelatedTo(
|
|
@@ -67270,13 +67269,14 @@ function createTypeChecker(host) {
|
|
|
67270
67269
|
const elementFlags = [];
|
|
67271
67270
|
pushCachedContextualType(node);
|
|
67272
67271
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
67273
|
-
const
|
|
67272
|
+
const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent);
|
|
67273
|
+
const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
|
|
67274
67274
|
const contextualType = getApparentTypeOfContextualType(
|
|
67275
67275
|
node,
|
|
67276
67276
|
/*contextFlags*/
|
|
67277
67277
|
void 0
|
|
67278
67278
|
);
|
|
67279
|
-
const inTupleContext = !!contextualType && someType(contextualType, isTupleLikeType);
|
|
67279
|
+
const inTupleContext = isSpreadIntoCallOrNew || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
67280
67280
|
let hasOmittedExpression = false;
|
|
67281
67281
|
for (let i = 0; i < elementCount; i++) {
|
|
67282
67282
|
const e = elements[i];
|
package/lib/tsserver.js
CHANGED
|
@@ -883,7 +883,6 @@ __export(server_exports, {
|
|
|
883
883
|
getNodeForGeneratedName: () => getNodeForGeneratedName,
|
|
884
884
|
getNodeId: () => getNodeId,
|
|
885
885
|
getNodeKind: () => getNodeKind,
|
|
886
|
-
getNodeMajorVersion: () => getNodeMajorVersion,
|
|
887
886
|
getNodeModifiers: () => getNodeModifiers,
|
|
888
887
|
getNodeModulePathParts: () => getNodeModulePathParts,
|
|
889
888
|
getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration,
|
|
@@ -2285,7 +2284,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2285
2284
|
|
|
2286
2285
|
// src/compiler/corePublic.ts
|
|
2287
2286
|
var versionMajorMinor = "5.1";
|
|
2288
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2287
|
+
var version = `${versionMajorMinor}.0-insiders.20230310`;
|
|
2289
2288
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2290
2289
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2291
2290
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6664,7 +6663,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
6664
6663
|
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
|
|
6665
6664
|
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
|
|
6666
6665
|
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
|
|
6667
|
-
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] =
|
|
6666
|
+
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
|
|
6668
6667
|
return TypeFlags2;
|
|
6669
6668
|
})(TypeFlags || {});
|
|
6670
6669
|
var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
@@ -8315,20 +8314,6 @@ function patchWriteFileEnsuringDirectory(sys2) {
|
|
|
8315
8314
|
(path2) => sys2.directoryExists(path2)
|
|
8316
8315
|
);
|
|
8317
8316
|
}
|
|
8318
|
-
function getNodeMajorVersion() {
|
|
8319
|
-
if (typeof process === "undefined") {
|
|
8320
|
-
return void 0;
|
|
8321
|
-
}
|
|
8322
|
-
const version2 = process.version;
|
|
8323
|
-
if (!version2) {
|
|
8324
|
-
return void 0;
|
|
8325
|
-
}
|
|
8326
|
-
const dot = version2.indexOf(".");
|
|
8327
|
-
if (dot === -1) {
|
|
8328
|
-
return void 0;
|
|
8329
|
-
}
|
|
8330
|
-
return parseInt(version2.substring(1, dot));
|
|
8331
|
-
}
|
|
8332
8317
|
var sys = (() => {
|
|
8333
8318
|
const byteOrderMarkIndicator = "\uFEFF";
|
|
8334
8319
|
function getNodeSystem() {
|
|
@@ -8345,14 +8330,12 @@ var sys = (() => {
|
|
|
8345
8330
|
let activeSession;
|
|
8346
8331
|
let profilePath = "./profile.cpuprofile";
|
|
8347
8332
|
const Buffer2 = require("buffer").Buffer;
|
|
8348
|
-
const nodeVersion = getNodeMajorVersion();
|
|
8349
|
-
const isNode4OrLater = nodeVersion >= 4;
|
|
8350
8333
|
const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
8351
8334
|
const platform = _os.platform();
|
|
8352
8335
|
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
8353
8336
|
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
8354
8337
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
8355
|
-
const fsSupportsRecursiveFsWatch =
|
|
8338
|
+
const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
|
|
8356
8339
|
const getCurrentDirectory = memoize(() => process.cwd());
|
|
8357
8340
|
const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
|
|
8358
8341
|
pollingWatchFileWorker: fsWatchFileWorker,
|
|
@@ -57269,10 +57252,9 @@ function createTypeChecker(host) {
|
|
|
57269
57252
|
return [sig.parameters];
|
|
57270
57253
|
function expandSignatureParametersWithTupleMembers(restType, restIndex) {
|
|
57271
57254
|
const elementTypes = getTypeArguments(restType);
|
|
57272
|
-
const associatedNames = restType
|
|
57255
|
+
const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
|
|
57273
57256
|
const restParams = map(elementTypes, (t, i) => {
|
|
57274
|
-
const
|
|
57275
|
-
const name = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
57257
|
+
const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
57276
57258
|
const flags = restType.target.elementFlags[i];
|
|
57277
57259
|
const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
|
|
57278
57260
|
const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
|
|
@@ -57281,6 +57263,20 @@ function createTypeChecker(host) {
|
|
|
57281
57263
|
});
|
|
57282
57264
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
57283
57265
|
}
|
|
57266
|
+
function getUniqAssociatedNamesFromTupleType(type) {
|
|
57267
|
+
const associatedNamesMap = /* @__PURE__ */ new Map();
|
|
57268
|
+
return map(type.target.labeledElementDeclarations, (labeledElement) => {
|
|
57269
|
+
const name = getTupleElementLabel(labeledElement);
|
|
57270
|
+
const prevCounter = associatedNamesMap.get(name);
|
|
57271
|
+
if (prevCounter === void 0) {
|
|
57272
|
+
associatedNamesMap.set(name, 1);
|
|
57273
|
+
return name;
|
|
57274
|
+
} else {
|
|
57275
|
+
associatedNamesMap.set(name, prevCounter + 1);
|
|
57276
|
+
return `${name}_${prevCounter}`;
|
|
57277
|
+
}
|
|
57278
|
+
});
|
|
57279
|
+
}
|
|
57284
57280
|
}
|
|
57285
57281
|
function getDefaultConstructSignatures(classType) {
|
|
57286
57282
|
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
@@ -59978,7 +59974,7 @@ function createTypeChecker(host) {
|
|
|
59978
59974
|
}
|
|
59979
59975
|
function getGlobalOmitSymbol() {
|
|
59980
59976
|
deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalTypeAliasSymbol(
|
|
59981
|
-
"
|
|
59977
|
+
"Omit",
|
|
59982
59978
|
/*arity*/
|
|
59983
59979
|
2,
|
|
59984
59980
|
/*reportErrors*/
|
|
@@ -60588,7 +60584,7 @@ function createTypeChecker(host) {
|
|
|
60588
60584
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
60589
60585
|
}
|
|
60590
60586
|
}
|
|
60591
|
-
const objectFlags = (includes &
|
|
60587
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
|
|
60592
60588
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
60593
60589
|
}
|
|
60594
60590
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -60713,7 +60709,7 @@ function createTypeChecker(host) {
|
|
|
60713
60709
|
function eachUnionContains(unionTypes2, type) {
|
|
60714
60710
|
for (const u of unionTypes2) {
|
|
60715
60711
|
if (!containsType(u.types, type)) {
|
|
60716
|
-
const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
|
|
60712
|
+
const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & (32 /* Enum */ | 256 /* NumberLiteral */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
|
|
60717
60713
|
if (!primitive || !containsType(u.types, primitive)) {
|
|
60718
60714
|
return false;
|
|
60719
60715
|
}
|
|
@@ -60740,9 +60736,6 @@ function createTypeChecker(host) {
|
|
|
60740
60736
|
}
|
|
60741
60737
|
return false;
|
|
60742
60738
|
}
|
|
60743
|
-
function eachIsUnionContaining(types, flag) {
|
|
60744
|
-
return every(types, (t) => !!(t.flags & 1048576 /* Union */) && some(t.types, (tt) => !!(tt.flags & flag)));
|
|
60745
|
-
}
|
|
60746
60739
|
function removeFromEach(types, flag) {
|
|
60747
60740
|
for (let i = 0; i < types.length; i++) {
|
|
60748
60741
|
types[i] = filterType(types[i], (t) => !(t.flags & flag));
|
|
@@ -60831,11 +60824,11 @@ function createTypeChecker(host) {
|
|
|
60831
60824
|
if (includes & 1048576 /* Union */) {
|
|
60832
60825
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
60833
60826
|
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
60834
|
-
} else if (
|
|
60827
|
+
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
|
|
60835
60828
|
const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
|
|
60836
60829
|
removeFromEach(typeSet, 32768 /* Undefined */);
|
|
60837
60830
|
result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
60838
|
-
} else if (
|
|
60831
|
+
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
60839
60832
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
60840
60833
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
60841
60834
|
} else {
|
|
@@ -64375,6 +64368,11 @@ function createTypeChecker(host) {
|
|
|
64375
64368
|
if (containsType(targetTypes, source2)) {
|
|
64376
64369
|
return -1 /* True */;
|
|
64377
64370
|
}
|
|
64371
|
+
if (getObjectFlags(target2) & 32768 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
|
|
64372
|
+
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
64373
|
+
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
64374
|
+
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
64375
|
+
}
|
|
64378
64376
|
const match = getMatchingUnionConstituentForType(target2, source2);
|
|
64379
64377
|
if (match) {
|
|
64380
64378
|
const related = isRelatedTo(
|
|
@@ -71860,13 +71858,14 @@ function createTypeChecker(host) {
|
|
|
71860
71858
|
const elementFlags = [];
|
|
71861
71859
|
pushCachedContextualType(node);
|
|
71862
71860
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
71863
|
-
const
|
|
71861
|
+
const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent);
|
|
71862
|
+
const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
|
|
71864
71863
|
const contextualType = getApparentTypeOfContextualType(
|
|
71865
71864
|
node,
|
|
71866
71865
|
/*contextFlags*/
|
|
71867
71866
|
void 0
|
|
71868
71867
|
);
|
|
71869
|
-
const inTupleContext = !!contextualType && someType(contextualType, isTupleLikeType);
|
|
71868
|
+
const inTupleContext = isSpreadIntoCallOrNew || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
71870
71869
|
let hasOmittedExpression = false;
|
|
71871
71870
|
for (let i = 0; i < elementCount; i++) {
|
|
71872
71871
|
const e = elements[i];
|
|
@@ -143984,9 +143983,10 @@ function getInfo7(sourceFile, tokenPos, errorCode, checker, program) {
|
|
|
143984
143983
|
if (!isMemberName(token))
|
|
143985
143984
|
return void 0;
|
|
143986
143985
|
if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
|
|
143986
|
+
const targetType = checker.getContextualType(token) || checker.getTypeAtLocation(token);
|
|
143987
143987
|
const properties = arrayFrom(checker.getUnmatchedProperties(
|
|
143988
143988
|
checker.getTypeAtLocation(parent2.initializer),
|
|
143989
|
-
|
|
143989
|
+
targetType,
|
|
143990
143990
|
/* requireOptionalProperties */
|
|
143991
143991
|
false,
|
|
143992
143992
|
/* matchDiscriminantProperties */
|
|
@@ -168866,7 +168866,6 @@ __export(ts_exports3, {
|
|
|
168866
168866
|
getNodeForGeneratedName: () => getNodeForGeneratedName,
|
|
168867
168867
|
getNodeId: () => getNodeId,
|
|
168868
168868
|
getNodeKind: () => getNodeKind,
|
|
168869
|
-
getNodeMajorVersion: () => getNodeMajorVersion,
|
|
168870
168869
|
getNodeModifiers: () => getNodeModifiers,
|
|
168871
168870
|
getNodeModulePathParts: () => getNodeModulePathParts,
|
|
168872
168871
|
getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration,
|
|
@@ -181392,8 +181391,7 @@ function initializeNodeSystem() {
|
|
|
181392
181391
|
}
|
|
181393
181392
|
}
|
|
181394
181393
|
const libDirectory = getDirectoryPath(normalizePath(sys2.getExecutingFilePath()));
|
|
181395
|
-
const
|
|
181396
|
-
const useWatchGuard = process.platform === "win32" && nodeVersion >= 4;
|
|
181394
|
+
const useWatchGuard = process.platform === "win32";
|
|
181397
181395
|
const originalWatchDirectory = sys2.watchDirectory.bind(sys2);
|
|
181398
181396
|
const logger = createLogger();
|
|
181399
181397
|
Debug.loggingHost = {
|
|
@@ -181948,7 +181946,7 @@ function start({ args, logger, cancellationToken, serverMode, unknownServerMode,
|
|
|
181948
181946
|
logger.info(`Starting TS Server`);
|
|
181949
181947
|
logger.info(`Version: ${version}`);
|
|
181950
181948
|
logger.info(`Arguments: ${args.join(" ")}`);
|
|
181951
|
-
logger.info(`Platform: ${platform} NodeVersion: ${
|
|
181949
|
+
logger.info(`Platform: ${platform} NodeVersion: ${process.version} CaseSensitive: ${sys.useCaseSensitiveFileNames}`);
|
|
181952
181950
|
logger.info(`ServerMode: ${serverMode} hasUnknownServerMode: ${unknownServerMode}`);
|
|
181953
181951
|
setStackTraceLimit();
|
|
181954
181952
|
if (Debug.isDebugging) {
|
|
@@ -182826,7 +182824,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
182826
182824
|
getNodeForGeneratedName,
|
|
182827
182825
|
getNodeId,
|
|
182828
182826
|
getNodeKind,
|
|
182829
|
-
getNodeMajorVersion,
|
|
182830
182827
|
getNodeModifiers,
|
|
182831
182828
|
getNodeModulePathParts,
|
|
182832
182829
|
getNonAssignedNameOfDeclaration,
|
package/lib/tsserverlibrary.d.ts
CHANGED
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230310`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4472,7 +4472,7 @@ ${lanes.join("\n")}
|
|
|
4472
4472
|
TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard";
|
|
4473
4473
|
TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject";
|
|
4474
4474
|
TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable";
|
|
4475
|
-
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] =
|
|
4475
|
+
TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion";
|
|
4476
4476
|
return TypeFlags2;
|
|
4477
4477
|
})(TypeFlags || {});
|
|
4478
4478
|
ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
@@ -6098,20 +6098,6 @@ ${lanes.join("\n")}
|
|
|
6098
6098
|
(path2) => sys2.directoryExists(path2)
|
|
6099
6099
|
);
|
|
6100
6100
|
}
|
|
6101
|
-
function getNodeMajorVersion() {
|
|
6102
|
-
if (typeof process === "undefined") {
|
|
6103
|
-
return void 0;
|
|
6104
|
-
}
|
|
6105
|
-
const version2 = process.version;
|
|
6106
|
-
if (!version2) {
|
|
6107
|
-
return void 0;
|
|
6108
|
-
}
|
|
6109
|
-
const dot = version2.indexOf(".");
|
|
6110
|
-
if (dot === -1) {
|
|
6111
|
-
return void 0;
|
|
6112
|
-
}
|
|
6113
|
-
return parseInt(version2.substring(1, dot));
|
|
6114
|
-
}
|
|
6115
6101
|
function setSys(s) {
|
|
6116
6102
|
sys = s;
|
|
6117
6103
|
}
|
|
@@ -6159,14 +6145,12 @@ ${lanes.join("\n")}
|
|
|
6159
6145
|
let activeSession;
|
|
6160
6146
|
let profilePath = "./profile.cpuprofile";
|
|
6161
6147
|
const Buffer2 = require("buffer").Buffer;
|
|
6162
|
-
const nodeVersion = getNodeMajorVersion();
|
|
6163
|
-
const isNode4OrLater = nodeVersion >= 4;
|
|
6164
6148
|
const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
6165
6149
|
const platform = _os.platform();
|
|
6166
6150
|
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
6167
6151
|
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
6168
6152
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
6169
|
-
const fsSupportsRecursiveFsWatch =
|
|
6153
|
+
const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
|
|
6170
6154
|
const getCurrentDirectory = memoize(() => process.cwd());
|
|
6171
6155
|
const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
|
|
6172
6156
|
pollingWatchFileWorker: fsWatchFileWorker,
|
|
@@ -55080,10 +55064,9 @@ ${lanes.join("\n")}
|
|
|
55080
55064
|
return [sig.parameters];
|
|
55081
55065
|
function expandSignatureParametersWithTupleMembers(restType, restIndex) {
|
|
55082
55066
|
const elementTypes = getTypeArguments(restType);
|
|
55083
|
-
const associatedNames = restType
|
|
55067
|
+
const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
|
|
55084
55068
|
const restParams = map(elementTypes, (t, i) => {
|
|
55085
|
-
const
|
|
55086
|
-
const name = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
55069
|
+
const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
|
|
55087
55070
|
const flags = restType.target.elementFlags[i];
|
|
55088
55071
|
const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
|
|
55089
55072
|
const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
|
|
@@ -55092,6 +55075,20 @@ ${lanes.join("\n")}
|
|
|
55092
55075
|
});
|
|
55093
55076
|
return concatenate(sig.parameters.slice(0, restIndex), restParams);
|
|
55094
55077
|
}
|
|
55078
|
+
function getUniqAssociatedNamesFromTupleType(type) {
|
|
55079
|
+
const associatedNamesMap = /* @__PURE__ */ new Map();
|
|
55080
|
+
return map(type.target.labeledElementDeclarations, (labeledElement) => {
|
|
55081
|
+
const name = getTupleElementLabel(labeledElement);
|
|
55082
|
+
const prevCounter = associatedNamesMap.get(name);
|
|
55083
|
+
if (prevCounter === void 0) {
|
|
55084
|
+
associatedNamesMap.set(name, 1);
|
|
55085
|
+
return name;
|
|
55086
|
+
} else {
|
|
55087
|
+
associatedNamesMap.set(name, prevCounter + 1);
|
|
55088
|
+
return `${name}_${prevCounter}`;
|
|
55089
|
+
}
|
|
55090
|
+
});
|
|
55091
|
+
}
|
|
55095
55092
|
}
|
|
55096
55093
|
function getDefaultConstructSignatures(classType) {
|
|
55097
55094
|
const baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
@@ -57789,7 +57786,7 @@ ${lanes.join("\n")}
|
|
|
57789
57786
|
}
|
|
57790
57787
|
function getGlobalOmitSymbol() {
|
|
57791
57788
|
deferredGlobalOmitSymbol || (deferredGlobalOmitSymbol = getGlobalTypeAliasSymbol(
|
|
57792
|
-
"
|
|
57789
|
+
"Omit",
|
|
57793
57790
|
/*arity*/
|
|
57794
57791
|
2,
|
|
57795
57792
|
/*reportErrors*/
|
|
@@ -58399,7 +58396,7 @@ ${lanes.join("\n")}
|
|
|
58399
58396
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
58400
58397
|
}
|
|
58401
58398
|
}
|
|
58402
|
-
const objectFlags = (includes &
|
|
58399
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 32768 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 16777216 /* ContainsIntersections */ : 0);
|
|
58403
58400
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
58404
58401
|
}
|
|
58405
58402
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -58524,7 +58521,7 @@ ${lanes.join("\n")}
|
|
|
58524
58521
|
function eachUnionContains(unionTypes2, type) {
|
|
58525
58522
|
for (const u of unionTypes2) {
|
|
58526
58523
|
if (!containsType(u.types, type)) {
|
|
58527
|
-
const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & 256 /* NumberLiteral */ ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
|
|
58524
|
+
const primitive = type.flags & 128 /* StringLiteral */ ? stringType : type.flags & (32 /* Enum */ | 256 /* NumberLiteral */) ? numberType : type.flags & 2048 /* BigIntLiteral */ ? bigintType : type.flags & 8192 /* UniqueESSymbol */ ? esSymbolType : void 0;
|
|
58528
58525
|
if (!primitive || !containsType(u.types, primitive)) {
|
|
58529
58526
|
return false;
|
|
58530
58527
|
}
|
|
@@ -58551,9 +58548,6 @@ ${lanes.join("\n")}
|
|
|
58551
58548
|
}
|
|
58552
58549
|
return false;
|
|
58553
58550
|
}
|
|
58554
|
-
function eachIsUnionContaining(types, flag) {
|
|
58555
|
-
return every(types, (t) => !!(t.flags & 1048576 /* Union */) && some(t.types, (tt) => !!(tt.flags & flag)));
|
|
58556
|
-
}
|
|
58557
58551
|
function removeFromEach(types, flag) {
|
|
58558
58552
|
for (let i = 0; i < types.length; i++) {
|
|
58559
58553
|
types[i] = filterType(types[i], (t) => !(t.flags & flag));
|
|
@@ -58642,11 +58636,11 @@ ${lanes.join("\n")}
|
|
|
58642
58636
|
if (includes & 1048576 /* Union */) {
|
|
58643
58637
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
58644
58638
|
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
58645
|
-
} else if (
|
|
58639
|
+
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && t.types[0].flags & 32768 /* Undefined */))) {
|
|
58646
58640
|
const containedUndefinedType = some(typeSet, containsMissingType) ? missingType : undefinedType;
|
|
58647
58641
|
removeFromEach(typeSet, 32768 /* Undefined */);
|
|
58648
58642
|
result = getUnionType([getIntersectionType(typeSet), containedUndefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
58649
|
-
} else if (
|
|
58643
|
+
} else if (every(typeSet, (t) => !!(t.flags & 1048576 /* Union */ && (t.types[0].flags & 65536 /* Null */ || t.types[1].flags & 65536 /* Null */)))) {
|
|
58650
58644
|
removeFromEach(typeSet, 65536 /* Null */);
|
|
58651
58645
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
|
|
58652
58646
|
} else {
|
|
@@ -62186,6 +62180,11 @@ ${lanes.join("\n")}
|
|
|
62186
62180
|
if (containsType(targetTypes, source2)) {
|
|
62187
62181
|
return -1 /* True */;
|
|
62188
62182
|
}
|
|
62183
|
+
if (getObjectFlags(target2) & 32768 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
|
|
62184
|
+
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
62185
|
+
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
62186
|
+
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
62187
|
+
}
|
|
62189
62188
|
const match = getMatchingUnionConstituentForType(target2, source2);
|
|
62190
62189
|
if (match) {
|
|
62191
62190
|
const related = isRelatedTo(
|
|
@@ -69671,13 +69670,14 @@ ${lanes.join("\n")}
|
|
|
69671
69670
|
const elementFlags = [];
|
|
69672
69671
|
pushCachedContextualType(node);
|
|
69673
69672
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
69674
|
-
const
|
|
69673
|
+
const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent);
|
|
69674
|
+
const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
|
|
69675
69675
|
const contextualType = getApparentTypeOfContextualType(
|
|
69676
69676
|
node,
|
|
69677
69677
|
/*contextFlags*/
|
|
69678
69678
|
void 0
|
|
69679
69679
|
);
|
|
69680
|
-
const inTupleContext = !!contextualType && someType(contextualType, isTupleLikeType);
|
|
69680
|
+
const inTupleContext = isSpreadIntoCallOrNew || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
69681
69681
|
let hasOmittedExpression = false;
|
|
69682
69682
|
for (let i = 0; i < elementCount; i++) {
|
|
69683
69683
|
const e = elements[i];
|
|
@@ -142575,9 +142575,10 @@ ${lanes.join("\n")}
|
|
|
142575
142575
|
if (!isMemberName(token))
|
|
142576
142576
|
return void 0;
|
|
142577
142577
|
if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
|
|
142578
|
+
const targetType = checker.getContextualType(token) || checker.getTypeAtLocation(token);
|
|
142578
142579
|
const properties = arrayFrom(checker.getUnmatchedProperties(
|
|
142579
142580
|
checker.getTypeAtLocation(parent2.initializer),
|
|
142580
|
-
|
|
142581
|
+
targetType,
|
|
142581
142582
|
/* requireOptionalProperties */
|
|
142582
142583
|
false,
|
|
142583
142584
|
/* matchDiscriminantProperties */
|
|
@@ -179475,7 +179476,6 @@ ${e.message}`;
|
|
|
179475
179476
|
getNodeForGeneratedName: () => getNodeForGeneratedName,
|
|
179476
179477
|
getNodeId: () => getNodeId,
|
|
179477
179478
|
getNodeKind: () => getNodeKind,
|
|
179478
|
-
getNodeMajorVersion: () => getNodeMajorVersion,
|
|
179479
179479
|
getNodeModifiers: () => getNodeModifiers,
|
|
179480
179480
|
getNodeModulePathParts: () => getNodeModulePathParts,
|
|
179481
179481
|
getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration,
|
|
@@ -181832,7 +181832,6 @@ ${e.message}`;
|
|
|
181832
181832
|
getNodeForGeneratedName: () => getNodeForGeneratedName,
|
|
181833
181833
|
getNodeId: () => getNodeId,
|
|
181834
181834
|
getNodeKind: () => getNodeKind,
|
|
181835
|
-
getNodeMajorVersion: () => getNodeMajorVersion,
|
|
181836
181835
|
getNodeModifiers: () => getNodeModifiers,
|
|
181837
181836
|
getNodeModulePathParts: () => getNodeModulePathParts,
|
|
181838
181837
|
getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration,
|