typescript 5.7.0-dev.20241023 → 5.7.0-dev.20241024
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 +27 -29
- package/lib/typescript.js +39 -35
- package/package.json +2 -2
package/lib/_tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.7";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20241024`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -45041,31 +45041,29 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
45041
45041
|
return { kind: "node_modules", moduleSpecifiers: nodeModulesSpecifiers, computedWithoutCache: true };
|
|
45042
45042
|
}
|
|
45043
45043
|
}
|
|
45044
|
-
|
|
45045
|
-
|
|
45046
|
-
|
|
45047
|
-
|
|
45048
|
-
|
|
45049
|
-
|
|
45050
|
-
|
|
45051
|
-
|
|
45052
|
-
|
|
45053
|
-
|
|
45054
|
-
|
|
45055
|
-
|
|
45056
|
-
|
|
45057
|
-
|
|
45058
|
-
|
|
45059
|
-
|
|
45060
|
-
|
|
45061
|
-
if (pathContainsNodeModules(local)) {
|
|
45062
|
-
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
45063
|
-
} else {
|
|
45064
|
-
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
45065
|
-
}
|
|
45066
|
-
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
45044
|
+
const local = getLocalModuleSpecifier(
|
|
45045
|
+
modulePath.path,
|
|
45046
|
+
info,
|
|
45047
|
+
compilerOptions,
|
|
45048
|
+
host,
|
|
45049
|
+
options.overrideImportMode || importingSourceFile.impliedNodeFormat,
|
|
45050
|
+
preferences,
|
|
45051
|
+
/*pathsOnly*/
|
|
45052
|
+
modulePath.isRedirect || !!specifier
|
|
45053
|
+
);
|
|
45054
|
+
if (!local || forAutoImport && isExcludedByRegex(local, preferences.excludeRegexes)) {
|
|
45055
|
+
continue;
|
|
45056
|
+
}
|
|
45057
|
+
if (modulePath.isRedirect) {
|
|
45058
|
+
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
|
|
45059
|
+
} else if (pathIsBareSpecifier(local)) {
|
|
45060
|
+
if (pathContainsNodeModules(local)) {
|
|
45067
45061
|
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
45062
|
+
} else {
|
|
45063
|
+
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
45068
45064
|
}
|
|
45065
|
+
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
45066
|
+
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
45069
45067
|
}
|
|
45070
45068
|
}
|
|
45071
45069
|
return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? { kind: "paths", moduleSpecifiers: pathsSpecifiers, computedWithoutCache: true } : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? { kind: "redirect", moduleSpecifiers: redirectPathsSpecifiers, computedWithoutCache: true } : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? { kind: "node_modules", moduleSpecifiers: nodeModulesSpecifiers, computedWithoutCache: true } : { kind: "relative", moduleSpecifiers: relativeSpecifiers ?? emptyArray, computedWithoutCache: true };
|
|
@@ -51346,7 +51344,7 @@ function createTypeChecker(host) {
|
|
|
51346
51344
|
const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
|
|
51347
51345
|
for (const signature of signatures) {
|
|
51348
51346
|
const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
|
|
51349
|
-
typeElements.push(preserveCommentsOn(methodDeclaration));
|
|
51347
|
+
typeElements.push(preserveCommentsOn(methodDeclaration, signature.declaration || propertySymbol.valueDeclaration));
|
|
51350
51348
|
}
|
|
51351
51349
|
if (signatures.length || !optionalToken) {
|
|
51352
51350
|
return;
|
|
@@ -51381,8 +51379,8 @@ function createTypeChecker(host) {
|
|
|
51381
51379
|
optionalToken,
|
|
51382
51380
|
propertyTypeNode
|
|
51383
51381
|
);
|
|
51384
|
-
typeElements.push(preserveCommentsOn(propertySignature));
|
|
51385
|
-
function preserveCommentsOn(node) {
|
|
51382
|
+
typeElements.push(preserveCommentsOn(propertySignature, propertySymbol.valueDeclaration));
|
|
51383
|
+
function preserveCommentsOn(node, range) {
|
|
51386
51384
|
var _a2;
|
|
51387
51385
|
const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 348 /* JSDocPropertyTag */);
|
|
51388
51386
|
if (jsdocPropertyTag) {
|
|
@@ -51390,8 +51388,8 @@ function createTypeChecker(host) {
|
|
|
51390
51388
|
if (commentText) {
|
|
51391
51389
|
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
|
|
51392
51390
|
}
|
|
51393
|
-
} else if (
|
|
51394
|
-
setCommentRange2(context, node,
|
|
51391
|
+
} else if (range) {
|
|
51392
|
+
setCommentRange2(context, node, range);
|
|
51395
51393
|
}
|
|
51396
51394
|
return node;
|
|
51397
51395
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -2277,7 +2277,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2277
2277
|
|
|
2278
2278
|
// src/compiler/corePublic.ts
|
|
2279
2279
|
var versionMajorMinor = "5.7";
|
|
2280
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2280
|
+
var version = `${versionMajorMinor}.0-dev.20241024`;
|
|
2281
2281
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2282
2282
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2283
2283
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -49622,31 +49622,29 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
49622
49622
|
return { kind: "node_modules", moduleSpecifiers: nodeModulesSpecifiers, computedWithoutCache: true };
|
|
49623
49623
|
}
|
|
49624
49624
|
}
|
|
49625
|
-
|
|
49626
|
-
|
|
49627
|
-
|
|
49628
|
-
|
|
49629
|
-
|
|
49630
|
-
|
|
49631
|
-
|
|
49632
|
-
|
|
49633
|
-
|
|
49634
|
-
|
|
49635
|
-
|
|
49636
|
-
|
|
49637
|
-
|
|
49638
|
-
|
|
49639
|
-
|
|
49640
|
-
|
|
49641
|
-
|
|
49642
|
-
if (pathContainsNodeModules(local)) {
|
|
49643
|
-
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
49644
|
-
} else {
|
|
49645
|
-
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
49646
|
-
}
|
|
49647
|
-
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
49625
|
+
const local = getLocalModuleSpecifier(
|
|
49626
|
+
modulePath.path,
|
|
49627
|
+
info,
|
|
49628
|
+
compilerOptions,
|
|
49629
|
+
host,
|
|
49630
|
+
options.overrideImportMode || importingSourceFile.impliedNodeFormat,
|
|
49631
|
+
preferences,
|
|
49632
|
+
/*pathsOnly*/
|
|
49633
|
+
modulePath.isRedirect || !!specifier
|
|
49634
|
+
);
|
|
49635
|
+
if (!local || forAutoImport && isExcludedByRegex(local, preferences.excludeRegexes)) {
|
|
49636
|
+
continue;
|
|
49637
|
+
}
|
|
49638
|
+
if (modulePath.isRedirect) {
|
|
49639
|
+
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
|
|
49640
|
+
} else if (pathIsBareSpecifier(local)) {
|
|
49641
|
+
if (pathContainsNodeModules(local)) {
|
|
49648
49642
|
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
49643
|
+
} else {
|
|
49644
|
+
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
49649
49645
|
}
|
|
49646
|
+
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
49647
|
+
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
49650
49648
|
}
|
|
49651
49649
|
}
|
|
49652
49650
|
return (pathsSpecifiers == null ? void 0 : pathsSpecifiers.length) ? { kind: "paths", moduleSpecifiers: pathsSpecifiers, computedWithoutCache: true } : (redirectPathsSpecifiers == null ? void 0 : redirectPathsSpecifiers.length) ? { kind: "redirect", moduleSpecifiers: redirectPathsSpecifiers, computedWithoutCache: true } : (nodeModulesSpecifiers == null ? void 0 : nodeModulesSpecifiers.length) ? { kind: "node_modules", moduleSpecifiers: nodeModulesSpecifiers, computedWithoutCache: true } : { kind: "relative", moduleSpecifiers: relativeSpecifiers ?? emptyArray, computedWithoutCache: true };
|
|
@@ -55942,7 +55940,7 @@ function createTypeChecker(host) {
|
|
|
55942
55940
|
const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
|
|
55943
55941
|
for (const signature of signatures) {
|
|
55944
55942
|
const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 173 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
|
|
55945
|
-
typeElements.push(preserveCommentsOn(methodDeclaration));
|
|
55943
|
+
typeElements.push(preserveCommentsOn(methodDeclaration, signature.declaration || propertySymbol.valueDeclaration));
|
|
55946
55944
|
}
|
|
55947
55945
|
if (signatures.length || !optionalToken) {
|
|
55948
55946
|
return;
|
|
@@ -55977,8 +55975,8 @@ function createTypeChecker(host) {
|
|
|
55977
55975
|
optionalToken,
|
|
55978
55976
|
propertyTypeNode
|
|
55979
55977
|
);
|
|
55980
|
-
typeElements.push(preserveCommentsOn(propertySignature));
|
|
55981
|
-
function preserveCommentsOn(node) {
|
|
55978
|
+
typeElements.push(preserveCommentsOn(propertySignature, propertySymbol.valueDeclaration));
|
|
55979
|
+
function preserveCommentsOn(node, range) {
|
|
55982
55980
|
var _a2;
|
|
55983
55981
|
const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 348 /* JSDocPropertyTag */);
|
|
55984
55982
|
if (jsdocPropertyTag) {
|
|
@@ -55986,8 +55984,8 @@ function createTypeChecker(host) {
|
|
|
55986
55984
|
if (commentText) {
|
|
55987
55985
|
setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
|
|
55988
55986
|
}
|
|
55989
|
-
} else if (
|
|
55990
|
-
setCommentRange2(context, node,
|
|
55987
|
+
} else if (range) {
|
|
55988
|
+
setCommentRange2(context, node, range);
|
|
55991
55989
|
}
|
|
55992
55990
|
return node;
|
|
55993
55991
|
}
|
|
@@ -140496,7 +140494,13 @@ function getDefaultLikeExportNameFromDeclaration(symbol) {
|
|
|
140496
140494
|
if (isExportSpecifier(d) && d.symbol.flags === 2097152 /* Alias */) {
|
|
140497
140495
|
return (_b = tryCast(d.propertyName, isIdentifier)) == null ? void 0 : _b.text;
|
|
140498
140496
|
}
|
|
140499
|
-
|
|
140497
|
+
const name = (_c = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _c.text;
|
|
140498
|
+
if (name) {
|
|
140499
|
+
return name;
|
|
140500
|
+
}
|
|
140501
|
+
if (symbol.parent && !isExternalModuleSymbol(symbol.parent)) {
|
|
140502
|
+
return symbol.parent.getName();
|
|
140503
|
+
}
|
|
140500
140504
|
});
|
|
140501
140505
|
}
|
|
140502
140506
|
function getSymbolParentOrFail(symbol) {
|
|
@@ -159378,7 +159382,7 @@ registerCodeFix({
|
|
|
159378
159382
|
}
|
|
159379
159383
|
});
|
|
159380
159384
|
function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
159381
|
-
var _a;
|
|
159385
|
+
var _a, _b, _c;
|
|
159382
159386
|
const token = getTokenAtPosition(sourceFile, tokenPos);
|
|
159383
159387
|
const parent2 = token.parent;
|
|
159384
159388
|
if (errorCode === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) {
|
|
@@ -159391,7 +159395,7 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
|
159391
159395
|
if (!(param && isParameter(param) && isIdentifier(param.name))) return void 0;
|
|
159392
159396
|
const properties = arrayFrom(checker.getUnmatchedProperties(
|
|
159393
159397
|
checker.getTypeAtLocation(parent2),
|
|
159394
|
-
checker.getParameterType(signature, argIndex),
|
|
159398
|
+
checker.getParameterType(signature, argIndex).getNonNullableType(),
|
|
159395
159399
|
/*requireOptionalProperties*/
|
|
159396
159400
|
false,
|
|
159397
159401
|
/*matchDiscriminantProperties*/
|
|
@@ -159401,7 +159405,7 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
|
159401
159405
|
return { kind: 3 /* ObjectLiteral */, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent2 };
|
|
159402
159406
|
}
|
|
159403
159407
|
if (token.kind === 19 /* OpenBraceToken */ && isObjectLiteralExpression(parent2)) {
|
|
159404
|
-
const targetType = checker.getContextualType(parent2) || checker.getTypeAtLocation(parent2);
|
|
159408
|
+
const targetType = (_a = checker.getContextualType(parent2) || checker.getTypeAtLocation(parent2)) == null ? void 0 : _a.getNonNullableType();
|
|
159405
159409
|
const properties = arrayFrom(checker.getUnmatchedProperties(
|
|
159406
159410
|
checker.getTypeAtLocation(parent2),
|
|
159407
159411
|
targetType,
|
|
@@ -159416,7 +159420,7 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
|
159416
159420
|
}
|
|
159417
159421
|
if (!isMemberName(token)) return void 0;
|
|
159418
159422
|
if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
|
|
159419
|
-
const targetType = checker.getContextualType(token) || checker.getTypeAtLocation(token);
|
|
159423
|
+
const targetType = (_b = checker.getContextualType(token) || checker.getTypeAtLocation(token)) == null ? void 0 : _b.getNonNullableType();
|
|
159420
159424
|
const properties = arrayFrom(checker.getUnmatchedProperties(
|
|
159421
159425
|
checker.getTypeAtLocation(parent2.initializer),
|
|
159422
159426
|
targetType,
|
|
@@ -159435,7 +159439,7 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
|
|
|
159435
159439
|
return { kind: 4 /* JsxAttributes */, token, attributes, parentDeclaration: token.parent };
|
|
159436
159440
|
}
|
|
159437
159441
|
if (isIdentifier(token)) {
|
|
159438
|
-
const type = (
|
|
159442
|
+
const type = (_c = checker.getContextualType(token)) == null ? void 0 : _c.getNonNullableType();
|
|
159439
159443
|
if (type && getObjectFlags(type) & 16 /* Anonymous */) {
|
|
159440
159444
|
const signature = firstOrUndefined(checker.getSignaturesOfType(type, 0 /* Call */));
|
|
159441
159445
|
if (signature === void 0) return void 0;
|
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.7.0-dev.
|
|
5
|
+
"version": "5.7.0-dev.20241024",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"node": "20.1.0",
|
|
117
117
|
"npm": "8.19.4"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "2ac4cb78d6930302eb0a55d07f154a2b0597ae32"
|
|
120
120
|
}
|