typescript 5.1.0-dev.20230310 → 5.1.0-dev.20230312
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 +23 -22
- package/lib/tsserver.js +23 -22
- package/lib/tsserverlibrary.js +23 -22
- package/lib/typescript.js +23 -22
- package/lib/typingsInstaller.js +12 -6
- package/package.json +2 -2
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-dev.
|
|
26
|
+
var version = `${versionMajorMinor}.0-dev.20230312`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -1306,7 +1306,7 @@ function trimEndImpl(s) {
|
|
|
1306
1306
|
return s.slice(0, end + 1);
|
|
1307
1307
|
}
|
|
1308
1308
|
function isNodeLikeSystem() {
|
|
1309
|
-
return typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object";
|
|
1309
|
+
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
|
|
1310
1310
|
}
|
|
1311
1311
|
|
|
1312
1312
|
// src/compiler/debug.ts
|
|
@@ -4914,7 +4914,7 @@ var sys = (() => {
|
|
|
4914
4914
|
getAccessibleSortedChildDirectories: (path) => getAccessibleFileSystemEntries(path).directories,
|
|
4915
4915
|
realpath,
|
|
4916
4916
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
4917
|
-
useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
|
|
4917
|
+
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
4918
4918
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
4919
4919
|
inodeWatching: isLinuxOrMacOs,
|
|
4920
4920
|
sysLog
|
|
@@ -5000,8 +5000,10 @@ var sys = (() => {
|
|
|
5000
5000
|
process.stdout.write("\x1Bc");
|
|
5001
5001
|
},
|
|
5002
5002
|
setBlocking: () => {
|
|
5003
|
-
|
|
5004
|
-
|
|
5003
|
+
var _a2;
|
|
5004
|
+
const handle = (_a2 = process.stdout) == null ? void 0 : _a2._handle;
|
|
5005
|
+
if (handle && handle.setBlocking) {
|
|
5006
|
+
handle.setBlocking(true);
|
|
5005
5007
|
}
|
|
5006
5008
|
},
|
|
5007
5009
|
bufferFrom,
|
|
@@ -36574,6 +36576,10 @@ function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
|
|
|
36574
36576
|
originalPath: pathsAreEqual ? void 0 : fileName
|
|
36575
36577
|
};
|
|
36576
36578
|
}
|
|
36579
|
+
function getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState) {
|
|
36580
|
+
const nameForLookup = endsWith(typeRoot, "/node_modules/@types") || endsWith(typeRoot, "/node_modules/@types/") ? mangleScopedPackageNameWithTrace(typeReferenceDirectiveName, moduleResolutionState) : typeReferenceDirectiveName;
|
|
36581
|
+
return combinePaths(typeRoot, nameForLookup);
|
|
36582
|
+
}
|
|
36577
36583
|
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
|
|
36578
36584
|
Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
|
|
36579
36585
|
const traceEnabled = isTraceEnabled(options, host);
|
|
@@ -36692,7 +36698,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
36692
36698
|
trace(host, Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", "));
|
|
36693
36699
|
}
|
|
36694
36700
|
return firstDefined(typeRoots, (typeRoot) => {
|
|
36695
|
-
const candidate =
|
|
36701
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState);
|
|
36696
36702
|
const directoryExists = directoryProbablyExists(typeRoot, host);
|
|
36697
36703
|
if (!directoryExists && traceEnabled) {
|
|
36698
36704
|
trace(host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -38678,7 +38684,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
38678
38684
|
if (!state.compilerOptions.typeRoots)
|
|
38679
38685
|
return;
|
|
38680
38686
|
for (const typeRoot of state.compilerOptions.typeRoots) {
|
|
38681
|
-
const candidate =
|
|
38687
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, moduleName, state);
|
|
38682
38688
|
const directoryExists = directoryProbablyExists(typeRoot, state.host);
|
|
38683
38689
|
if (!directoryExists && state.traceEnabled) {
|
|
38684
38690
|
trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -58645,20 +58651,8 @@ function createTypeChecker(host) {
|
|
|
58645
58651
|
return result;
|
|
58646
58652
|
}
|
|
58647
58653
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
58648
|
-
|
|
58649
|
-
|
|
58650
|
-
const iterableType = getGlobalIterableType(
|
|
58651
|
-
/*reportErrors*/
|
|
58652
|
-
false
|
|
58653
|
-
);
|
|
58654
|
-
if (iterableType !== emptyGenericType) {
|
|
58655
|
-
const anyIterable = createIterableType(anyType);
|
|
58656
|
-
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
58657
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
58658
|
-
} else {
|
|
58659
|
-
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
58660
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
58661
|
-
}
|
|
58654
|
+
const arrayLikeTargetParts = filterType(childrenTargetType, isAssignableToAvailableAnyIterable);
|
|
58655
|
+
const nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isAssignableToAvailableAnyIterable(t));
|
|
58662
58656
|
if (moreThanOneRealChildren) {
|
|
58663
58657
|
if (arrayLikeTargetParts !== neverType) {
|
|
58664
58658
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
@@ -61944,6 +61938,13 @@ function createTypeChecker(host) {
|
|
|
61944
61938
|
function isArrayOrTupleLikeType(type) {
|
|
61945
61939
|
return isArrayLikeType(type) || isTupleLikeType(type);
|
|
61946
61940
|
}
|
|
61941
|
+
function isAssignableToAvailableAnyIterable(type) {
|
|
61942
|
+
const anyIterable = getGlobalIterableType(
|
|
61943
|
+
/*reportErrors*/
|
|
61944
|
+
false
|
|
61945
|
+
) !== emptyGenericType && createIterableType(anyType);
|
|
61946
|
+
return anyIterable ? isTypeAssignableTo(type, anyIterable) : isArrayOrTupleLikeType(type);
|
|
61947
|
+
}
|
|
61947
61948
|
function getTupleElementType(type, index) {
|
|
61948
61949
|
const propType = getTypeOfPropertyOfType(type, "" + index);
|
|
61949
61950
|
if (propType) {
|
|
@@ -66697,7 +66698,7 @@ function createTypeChecker(host) {
|
|
|
66697
66698
|
return void 0;
|
|
66698
66699
|
}
|
|
66699
66700
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
66700
|
-
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
66701
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(filterType(arrayContextualType, (t) => !!getIndexTypeOfType(t, numberType) || isAssignableToAvailableAnyIterable(t)), "" + index) || mapType(
|
|
66701
66702
|
arrayContextualType,
|
|
66702
66703
|
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
66703
66704
|
t,
|
package/lib/tsserver.js
CHANGED
|
@@ -2284,7 +2284,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2284
2284
|
|
|
2285
2285
|
// src/compiler/corePublic.ts
|
|
2286
2286
|
var versionMajorMinor = "5.1";
|
|
2287
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2287
|
+
var version = `${versionMajorMinor}.0-dev.20230312`;
|
|
2288
2288
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2289
2289
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2290
2290
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3955,7 +3955,7 @@ function trimEndImpl(s) {
|
|
|
3955
3955
|
return s.slice(0, end + 1);
|
|
3956
3956
|
}
|
|
3957
3957
|
function isNodeLikeSystem() {
|
|
3958
|
-
return typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object";
|
|
3958
|
+
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
|
|
3959
3959
|
}
|
|
3960
3960
|
|
|
3961
3961
|
// src/compiler/debug.ts
|
|
@@ -8352,7 +8352,7 @@ var sys = (() => {
|
|
|
8352
8352
|
getAccessibleSortedChildDirectories: (path) => getAccessibleFileSystemEntries(path).directories,
|
|
8353
8353
|
realpath,
|
|
8354
8354
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
8355
|
-
useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
|
|
8355
|
+
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
8356
8356
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
8357
8357
|
inodeWatching: isLinuxOrMacOs,
|
|
8358
8358
|
sysLog
|
|
@@ -8438,8 +8438,10 @@ var sys = (() => {
|
|
|
8438
8438
|
process.stdout.write("\x1Bc");
|
|
8439
8439
|
},
|
|
8440
8440
|
setBlocking: () => {
|
|
8441
|
-
|
|
8442
|
-
|
|
8441
|
+
var _a2;
|
|
8442
|
+
const handle = (_a2 = process.stdout) == null ? void 0 : _a2._handle;
|
|
8443
|
+
if (handle && handle.setBlocking) {
|
|
8444
|
+
handle.setBlocking(true);
|
|
8443
8445
|
}
|
|
8444
8446
|
},
|
|
8445
8447
|
bufferFrom,
|
|
@@ -40970,6 +40972,10 @@ function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
|
|
|
40970
40972
|
originalPath: pathsAreEqual ? void 0 : fileName
|
|
40971
40973
|
};
|
|
40972
40974
|
}
|
|
40975
|
+
function getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState) {
|
|
40976
|
+
const nameForLookup = endsWith(typeRoot, "/node_modules/@types") || endsWith(typeRoot, "/node_modules/@types/") ? mangleScopedPackageNameWithTrace(typeReferenceDirectiveName, moduleResolutionState) : typeReferenceDirectiveName;
|
|
40977
|
+
return combinePaths(typeRoot, nameForLookup);
|
|
40978
|
+
}
|
|
40973
40979
|
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
|
|
40974
40980
|
Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
|
|
40975
40981
|
const traceEnabled = isTraceEnabled(options, host);
|
|
@@ -41088,7 +41094,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
41088
41094
|
trace(host, Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", "));
|
|
41089
41095
|
}
|
|
41090
41096
|
return firstDefined(typeRoots, (typeRoot) => {
|
|
41091
|
-
const candidate =
|
|
41097
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState);
|
|
41092
41098
|
const directoryExists = directoryProbablyExists(typeRoot, host);
|
|
41093
41099
|
if (!directoryExists && traceEnabled) {
|
|
41094
41100
|
trace(host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -43213,7 +43219,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
43213
43219
|
if (!state.compilerOptions.typeRoots)
|
|
43214
43220
|
return;
|
|
43215
43221
|
for (const typeRoot of state.compilerOptions.typeRoots) {
|
|
43216
|
-
const candidate =
|
|
43222
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, moduleName, state);
|
|
43217
43223
|
const directoryExists = directoryProbablyExists(typeRoot, state.host);
|
|
43218
43224
|
if (!directoryExists && state.traceEnabled) {
|
|
43219
43225
|
trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -63234,20 +63240,8 @@ function createTypeChecker(host) {
|
|
|
63234
63240
|
return result;
|
|
63235
63241
|
}
|
|
63236
63242
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
63237
|
-
|
|
63238
|
-
|
|
63239
|
-
const iterableType = getGlobalIterableType(
|
|
63240
|
-
/*reportErrors*/
|
|
63241
|
-
false
|
|
63242
|
-
);
|
|
63243
|
-
if (iterableType !== emptyGenericType) {
|
|
63244
|
-
const anyIterable = createIterableType(anyType);
|
|
63245
|
-
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
63246
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
63247
|
-
} else {
|
|
63248
|
-
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
63249
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
63250
|
-
}
|
|
63243
|
+
const arrayLikeTargetParts = filterType(childrenTargetType, isAssignableToAvailableAnyIterable);
|
|
63244
|
+
const nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isAssignableToAvailableAnyIterable(t));
|
|
63251
63245
|
if (moreThanOneRealChildren) {
|
|
63252
63246
|
if (arrayLikeTargetParts !== neverType) {
|
|
63253
63247
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
@@ -66533,6 +66527,13 @@ function createTypeChecker(host) {
|
|
|
66533
66527
|
function isArrayOrTupleLikeType(type) {
|
|
66534
66528
|
return isArrayLikeType(type) || isTupleLikeType(type);
|
|
66535
66529
|
}
|
|
66530
|
+
function isAssignableToAvailableAnyIterable(type) {
|
|
66531
|
+
const anyIterable = getGlobalIterableType(
|
|
66532
|
+
/*reportErrors*/
|
|
66533
|
+
false
|
|
66534
|
+
) !== emptyGenericType && createIterableType(anyType);
|
|
66535
|
+
return anyIterable ? isTypeAssignableTo(type, anyIterable) : isArrayOrTupleLikeType(type);
|
|
66536
|
+
}
|
|
66536
66537
|
function getTupleElementType(type, index) {
|
|
66537
66538
|
const propType = getTypeOfPropertyOfType(type, "" + index);
|
|
66538
66539
|
if (propType) {
|
|
@@ -71286,7 +71287,7 @@ function createTypeChecker(host) {
|
|
|
71286
71287
|
return void 0;
|
|
71287
71288
|
}
|
|
71288
71289
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
71289
|
-
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
71290
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(filterType(arrayContextualType, (t) => !!getIndexTypeOfType(t, numberType) || isAssignableToAvailableAnyIterable(t)), "" + index) || mapType(
|
|
71290
71291
|
arrayContextualType,
|
|
71291
71292
|
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
71292
71293
|
t,
|
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-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230312`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -1620,7 +1620,7 @@ var ts = (() => {
|
|
|
1620
1620
|
return s.slice(0, end + 1);
|
|
1621
1621
|
}
|
|
1622
1622
|
function isNodeLikeSystem() {
|
|
1623
|
-
return typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object";
|
|
1623
|
+
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
|
|
1624
1624
|
}
|
|
1625
1625
|
var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale, trimString, trimStringEnd, trimStringStart;
|
|
1626
1626
|
var init_core = __esm({
|
|
@@ -6167,7 +6167,7 @@ ${lanes.join("\n")}
|
|
|
6167
6167
|
getAccessibleSortedChildDirectories: (path) => getAccessibleFileSystemEntries(path).directories,
|
|
6168
6168
|
realpath,
|
|
6169
6169
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
6170
|
-
useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
|
|
6170
|
+
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
6171
6171
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
6172
6172
|
inodeWatching: isLinuxOrMacOs,
|
|
6173
6173
|
sysLog
|
|
@@ -6253,8 +6253,10 @@ ${lanes.join("\n")}
|
|
|
6253
6253
|
process.stdout.write("\x1Bc");
|
|
6254
6254
|
},
|
|
6255
6255
|
setBlocking: () => {
|
|
6256
|
-
|
|
6257
|
-
|
|
6256
|
+
var _a2;
|
|
6257
|
+
const handle = (_a2 = process.stdout) == null ? void 0 : _a2._handle;
|
|
6258
|
+
if (handle && handle.setBlocking) {
|
|
6259
|
+
handle.setBlocking(true);
|
|
6258
6260
|
}
|
|
6259
6261
|
},
|
|
6260
6262
|
bufferFrom,
|
|
@@ -38873,6 +38875,10 @@ ${lanes.join("\n")}
|
|
|
38873
38875
|
originalPath: pathsAreEqual ? void 0 : fileName
|
|
38874
38876
|
};
|
|
38875
38877
|
}
|
|
38878
|
+
function getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState) {
|
|
38879
|
+
const nameForLookup = endsWith(typeRoot, "/node_modules/@types") || endsWith(typeRoot, "/node_modules/@types/") ? mangleScopedPackageNameWithTrace(typeReferenceDirectiveName, moduleResolutionState) : typeReferenceDirectiveName;
|
|
38880
|
+
return combinePaths(typeRoot, nameForLookup);
|
|
38881
|
+
}
|
|
38876
38882
|
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
|
|
38877
38883
|
Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
|
|
38878
38884
|
const traceEnabled = isTraceEnabled(options, host);
|
|
@@ -38991,7 +38997,7 @@ ${lanes.join("\n")}
|
|
|
38991
38997
|
trace(host, Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", "));
|
|
38992
38998
|
}
|
|
38993
38999
|
return firstDefined(typeRoots, (typeRoot) => {
|
|
38994
|
-
const candidate =
|
|
39000
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState);
|
|
38995
39001
|
const directoryExists = directoryProbablyExists(typeRoot, host);
|
|
38996
39002
|
if (!directoryExists && traceEnabled) {
|
|
38997
39003
|
trace(host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -41101,7 +41107,7 @@ ${lanes.join("\n")}
|
|
|
41101
41107
|
if (!state.compilerOptions.typeRoots)
|
|
41102
41108
|
return;
|
|
41103
41109
|
for (const typeRoot of state.compilerOptions.typeRoots) {
|
|
41104
|
-
const candidate =
|
|
41110
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, moduleName, state);
|
|
41105
41111
|
const directoryExists = directoryProbablyExists(typeRoot, state.host);
|
|
41106
41112
|
if (!directoryExists && state.traceEnabled) {
|
|
41107
41113
|
trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -61046,20 +61052,8 @@ ${lanes.join("\n")}
|
|
|
61046
61052
|
return result;
|
|
61047
61053
|
}
|
|
61048
61054
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
61049
|
-
|
|
61050
|
-
|
|
61051
|
-
const iterableType = getGlobalIterableType(
|
|
61052
|
-
/*reportErrors*/
|
|
61053
|
-
false
|
|
61054
|
-
);
|
|
61055
|
-
if (iterableType !== emptyGenericType) {
|
|
61056
|
-
const anyIterable = createIterableType(anyType);
|
|
61057
|
-
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
61058
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
61059
|
-
} else {
|
|
61060
|
-
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
61061
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
61062
|
-
}
|
|
61055
|
+
const arrayLikeTargetParts = filterType(childrenTargetType, isAssignableToAvailableAnyIterable);
|
|
61056
|
+
const nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isAssignableToAvailableAnyIterable(t));
|
|
61063
61057
|
if (moreThanOneRealChildren) {
|
|
61064
61058
|
if (arrayLikeTargetParts !== neverType) {
|
|
61065
61059
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
@@ -64345,6 +64339,13 @@ ${lanes.join("\n")}
|
|
|
64345
64339
|
function isArrayOrTupleLikeType(type) {
|
|
64346
64340
|
return isArrayLikeType(type) || isTupleLikeType(type);
|
|
64347
64341
|
}
|
|
64342
|
+
function isAssignableToAvailableAnyIterable(type) {
|
|
64343
|
+
const anyIterable = getGlobalIterableType(
|
|
64344
|
+
/*reportErrors*/
|
|
64345
|
+
false
|
|
64346
|
+
) !== emptyGenericType && createIterableType(anyType);
|
|
64347
|
+
return anyIterable ? isTypeAssignableTo(type, anyIterable) : isArrayOrTupleLikeType(type);
|
|
64348
|
+
}
|
|
64348
64349
|
function getTupleElementType(type, index) {
|
|
64349
64350
|
const propType = getTypeOfPropertyOfType(type, "" + index);
|
|
64350
64351
|
if (propType) {
|
|
@@ -69098,7 +69099,7 @@ ${lanes.join("\n")}
|
|
|
69098
69099
|
return void 0;
|
|
69099
69100
|
}
|
|
69100
69101
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
69101
|
-
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
69102
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(filterType(arrayContextualType, (t) => !!getIndexTypeOfType(t, numberType) || isAssignableToAvailableAnyIterable(t)), "" + index) || mapType(
|
|
69102
69103
|
arrayContextualType,
|
|
69103
69104
|
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
69104
69105
|
t,
|
package/lib/typescript.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-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230312`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -1620,7 +1620,7 @@ var ts = (() => {
|
|
|
1620
1620
|
return s.slice(0, end + 1);
|
|
1621
1621
|
}
|
|
1622
1622
|
function isNodeLikeSystem() {
|
|
1623
|
-
return typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object";
|
|
1623
|
+
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
|
|
1624
1624
|
}
|
|
1625
1625
|
var emptyArray, emptyMap, emptySet, SortKind, elementAt, hasOwnProperty, fileNameLowerCaseRegExp, AssertionLevel, createUIStringComparer, uiComparerCaseSensitive, uiLocale, trimString, trimStringEnd, trimStringStart;
|
|
1626
1626
|
var init_core = __esm({
|
|
@@ -6167,7 +6167,7 @@ ${lanes.join("\n")}
|
|
|
6167
6167
|
getAccessibleSortedChildDirectories: (path) => getAccessibleFileSystemEntries(path).directories,
|
|
6168
6168
|
realpath,
|
|
6169
6169
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
6170
|
-
useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
|
|
6170
|
+
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
6171
6171
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
6172
6172
|
inodeWatching: isLinuxOrMacOs,
|
|
6173
6173
|
sysLog
|
|
@@ -6253,8 +6253,10 @@ ${lanes.join("\n")}
|
|
|
6253
6253
|
process.stdout.write("\x1Bc");
|
|
6254
6254
|
},
|
|
6255
6255
|
setBlocking: () => {
|
|
6256
|
-
|
|
6257
|
-
|
|
6256
|
+
var _a2;
|
|
6257
|
+
const handle = (_a2 = process.stdout) == null ? void 0 : _a2._handle;
|
|
6258
|
+
if (handle && handle.setBlocking) {
|
|
6259
|
+
handle.setBlocking(true);
|
|
6258
6260
|
}
|
|
6259
6261
|
},
|
|
6260
6262
|
bufferFrom,
|
|
@@ -38873,6 +38875,10 @@ ${lanes.join("\n")}
|
|
|
38873
38875
|
originalPath: pathsAreEqual ? void 0 : fileName
|
|
38874
38876
|
};
|
|
38875
38877
|
}
|
|
38878
|
+
function getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState) {
|
|
38879
|
+
const nameForLookup = endsWith(typeRoot, "/node_modules/@types") || endsWith(typeRoot, "/node_modules/@types/") ? mangleScopedPackageNameWithTrace(typeReferenceDirectiveName, moduleResolutionState) : typeReferenceDirectiveName;
|
|
38880
|
+
return combinePaths(typeRoot, nameForLookup);
|
|
38881
|
+
}
|
|
38876
38882
|
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
|
|
38877
38883
|
Debug.assert(typeof typeReferenceDirectiveName === "string", "Non-string value passed to `ts.resolveTypeReferenceDirective`, likely by a wrapping package working with an outdated `resolveTypeReferenceDirectives` signature. This is probably not a problem in TS itself.");
|
|
38878
38884
|
const traceEnabled = isTraceEnabled(options, host);
|
|
@@ -38991,7 +38997,7 @@ ${lanes.join("\n")}
|
|
|
38991
38997
|
trace(host, Diagnostics.Resolving_with_primary_search_path_0, typeRoots.join(", "));
|
|
38992
38998
|
}
|
|
38993
38999
|
return firstDefined(typeRoots, (typeRoot) => {
|
|
38994
|
-
const candidate =
|
|
39000
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState);
|
|
38995
39001
|
const directoryExists = directoryProbablyExists(typeRoot, host);
|
|
38996
39002
|
if (!directoryExists && traceEnabled) {
|
|
38997
39003
|
trace(host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -41101,7 +41107,7 @@ ${lanes.join("\n")}
|
|
|
41101
41107
|
if (!state.compilerOptions.typeRoots)
|
|
41102
41108
|
return;
|
|
41103
41109
|
for (const typeRoot of state.compilerOptions.typeRoots) {
|
|
41104
|
-
const candidate =
|
|
41110
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, moduleName, state);
|
|
41105
41111
|
const directoryExists = directoryProbablyExists(typeRoot, state.host);
|
|
41106
41112
|
if (!directoryExists && state.traceEnabled) {
|
|
41107
41113
|
trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
|
@@ -61046,20 +61052,8 @@ ${lanes.join("\n")}
|
|
|
61046
61052
|
return result;
|
|
61047
61053
|
}
|
|
61048
61054
|
const moreThanOneRealChildren = length(validChildren) > 1;
|
|
61049
|
-
|
|
61050
|
-
|
|
61051
|
-
const iterableType = getGlobalIterableType(
|
|
61052
|
-
/*reportErrors*/
|
|
61053
|
-
false
|
|
61054
|
-
);
|
|
61055
|
-
if (iterableType !== emptyGenericType) {
|
|
61056
|
-
const anyIterable = createIterableType(anyType);
|
|
61057
|
-
arrayLikeTargetParts = filterType(childrenTargetType, (t) => isTypeAssignableTo(t, anyIterable));
|
|
61058
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isTypeAssignableTo(t, anyIterable));
|
|
61059
|
-
} else {
|
|
61060
|
-
arrayLikeTargetParts = filterType(childrenTargetType, isArrayOrTupleLikeType);
|
|
61061
|
-
nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isArrayOrTupleLikeType(t));
|
|
61062
|
-
}
|
|
61055
|
+
const arrayLikeTargetParts = filterType(childrenTargetType, isAssignableToAvailableAnyIterable);
|
|
61056
|
+
const nonArrayLikeTargetParts = filterType(childrenTargetType, (t) => !isAssignableToAvailableAnyIterable(t));
|
|
61063
61057
|
if (moreThanOneRealChildren) {
|
|
61064
61058
|
if (arrayLikeTargetParts !== neverType) {
|
|
61065
61059
|
const realSource = createTupleType(checkJsxChildren(containingElement, 0 /* Normal */));
|
|
@@ -64345,6 +64339,13 @@ ${lanes.join("\n")}
|
|
|
64345
64339
|
function isArrayOrTupleLikeType(type) {
|
|
64346
64340
|
return isArrayLikeType(type) || isTupleLikeType(type);
|
|
64347
64341
|
}
|
|
64342
|
+
function isAssignableToAvailableAnyIterable(type) {
|
|
64343
|
+
const anyIterable = getGlobalIterableType(
|
|
64344
|
+
/*reportErrors*/
|
|
64345
|
+
false
|
|
64346
|
+
) !== emptyGenericType && createIterableType(anyType);
|
|
64347
|
+
return anyIterable ? isTypeAssignableTo(type, anyIterable) : isArrayOrTupleLikeType(type);
|
|
64348
|
+
}
|
|
64348
64349
|
function getTupleElementType(type, index) {
|
|
64349
64350
|
const propType = getTypeOfPropertyOfType(type, "" + index);
|
|
64350
64351
|
if (propType) {
|
|
@@ -69098,7 +69099,7 @@ ${lanes.join("\n")}
|
|
|
69098
69099
|
return void 0;
|
|
69099
69100
|
}
|
|
69100
69101
|
function getContextualTypeForElementExpression(arrayContextualType, index) {
|
|
69101
|
-
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(arrayContextualType, "" + index) || mapType(
|
|
69102
|
+
return arrayContextualType && (index >= 0 && getTypeOfPropertyOfContextualType(filterType(arrayContextualType, (t) => !!getIndexTypeOfType(t, numberType) || isAssignableToAvailableAnyIterable(t)), "" + index) || mapType(
|
|
69102
69103
|
arrayContextualType,
|
|
69103
69104
|
(t) => isTupleType(t) ? getElementTypeOfSliceOfTupleType(
|
|
69104
69105
|
t,
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.1";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230312`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -841,7 +841,7 @@ function trimEndImpl(s) {
|
|
|
841
841
|
return s.slice(0, end + 1);
|
|
842
842
|
}
|
|
843
843
|
function isNodeLikeSystem() {
|
|
844
|
-
return typeof process !== "undefined" && process.nextTick && !process.browser && typeof module === "object";
|
|
844
|
+
return typeof process !== "undefined" && !!process.nextTick && !process.browser && typeof module === "object";
|
|
845
845
|
}
|
|
846
846
|
|
|
847
847
|
// src/compiler/debug.ts
|
|
@@ -4302,7 +4302,7 @@ var sys = (() => {
|
|
|
4302
4302
|
getAccessibleSortedChildDirectories: (path2) => getAccessibleFileSystemEntries(path2).directories,
|
|
4303
4303
|
realpath,
|
|
4304
4304
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
4305
|
-
useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
|
|
4305
|
+
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
4306
4306
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
4307
4307
|
inodeWatching: isLinuxOrMacOs,
|
|
4308
4308
|
sysLog
|
|
@@ -4388,8 +4388,10 @@ var sys = (() => {
|
|
|
4388
4388
|
process.stdout.write("\x1Bc");
|
|
4389
4389
|
},
|
|
4390
4390
|
setBlocking: () => {
|
|
4391
|
-
|
|
4392
|
-
|
|
4391
|
+
var _a2;
|
|
4392
|
+
const handle = (_a2 = process.stdout) == null ? void 0 : _a2._handle;
|
|
4393
|
+
if (handle && handle.setBlocking) {
|
|
4394
|
+
handle.setBlocking(true);
|
|
4393
4395
|
}
|
|
4394
4396
|
},
|
|
4395
4397
|
bufferFrom,
|
|
@@ -27318,6 +27320,10 @@ function getOriginalAndResolvedFileName(fileName, host, traceEnabled) {
|
|
|
27318
27320
|
originalPath: pathsAreEqual ? void 0 : fileName
|
|
27319
27321
|
};
|
|
27320
27322
|
}
|
|
27323
|
+
function getCandidateFromTypeRoot(typeRoot, typeReferenceDirectiveName, moduleResolutionState) {
|
|
27324
|
+
const nameForLookup = endsWith(typeRoot, "/node_modules/@types") || endsWith(typeRoot, "/node_modules/@types/") ? mangleScopedPackageNameWithTrace(typeReferenceDirectiveName, moduleResolutionState) : typeReferenceDirectiveName;
|
|
27325
|
+
return combinePaths(typeRoot, nameForLookup);
|
|
27326
|
+
}
|
|
27321
27327
|
function getNodeResolutionFeatures(options) {
|
|
27322
27328
|
let features = 0 /* None */;
|
|
27323
27329
|
switch (getEmitModuleResolutionKind(options)) {
|
|
@@ -28827,7 +28833,7 @@ function resolveFromTypeRoot(moduleName, state) {
|
|
|
28827
28833
|
if (!state.compilerOptions.typeRoots)
|
|
28828
28834
|
return;
|
|
28829
28835
|
for (const typeRoot of state.compilerOptions.typeRoots) {
|
|
28830
|
-
const candidate =
|
|
28836
|
+
const candidate = getCandidateFromTypeRoot(typeRoot, moduleName, state);
|
|
28831
28837
|
const directoryExists = directoryProbablyExists(typeRoot, state.host);
|
|
28832
28838
|
if (!directoryExists && state.traceEnabled) {
|
|
28833
28839
|
trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, typeRoot);
|
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": "5.1.0-dev.
|
|
5
|
+
"version": "5.1.0-dev.20230312",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"node": "14.21.1",
|
|
113
113
|
"npm": "8.19.3"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "32d2253e37e8a02a385a859c2d0b721c7674a045"
|
|
116
116
|
}
|