typescript 5.3.0-dev.20230810 → 5.3.0-dev.20230811
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 +16 -6
- package/lib/tsserver.js +16 -6
- package/lib/tsserverlibrary.js +16 -6
- package/lib/typescript.js +16 -6
- package/lib/typingsInstaller.js +1 -1
- 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.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230811`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -56536,7 +56536,10 @@ function createTypeChecker(host) {
|
|
|
56536
56536
|
}
|
|
56537
56537
|
}
|
|
56538
56538
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
56539
|
-
const templates = filter(
|
|
56539
|
+
const templates = filter(
|
|
56540
|
+
types,
|
|
56541
|
+
(t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types))
|
|
56542
|
+
);
|
|
56540
56543
|
if (templates.length) {
|
|
56541
56544
|
let i = types.length;
|
|
56542
56545
|
while (i > 0) {
|
|
@@ -56941,15 +56944,19 @@ function createTypeChecker(host) {
|
|
|
56941
56944
|
function getConstituentCountOfTypes(types) {
|
|
56942
56945
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
56943
56946
|
}
|
|
56944
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(
|
|
56945
|
-
|
|
56947
|
+
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
56948
|
+
if (types.length !== 2) {
|
|
56949
|
+
return false;
|
|
56950
|
+
}
|
|
56951
|
+
const [t1, t2] = types;
|
|
56952
|
+
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
56946
56953
|
}
|
|
56947
56954
|
function getTypeFromIntersectionTypeNode(node) {
|
|
56948
56955
|
const links = getNodeLinks(node);
|
|
56949
56956
|
if (!links.resolvedType) {
|
|
56950
56957
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
56951
56958
|
const types = map(node.types, getTypeFromTypeNode);
|
|
56952
|
-
const noSupertypeReduction =
|
|
56959
|
+
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
|
|
56953
56960
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
56954
56961
|
}
|
|
56955
56962
|
return links.resolvedType;
|
|
@@ -63407,6 +63414,9 @@ function createTypeChecker(host) {
|
|
|
63407
63414
|
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
63408
63415
|
return true;
|
|
63409
63416
|
}
|
|
63417
|
+
if (target.flags & 2097152 /* Intersection */) {
|
|
63418
|
+
return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
|
|
63419
|
+
}
|
|
63410
63420
|
if (source.flags & 128 /* StringLiteral */) {
|
|
63411
63421
|
const value = source.value;
|
|
63412
63422
|
return !!(target.flags & 8 /* Number */ && isValidNumberString(
|
|
@@ -63417,7 +63427,7 @@ function createTypeChecker(host) {
|
|
|
63417
63427
|
value,
|
|
63418
63428
|
/*roundTripOnly*/
|
|
63419
63429
|
false
|
|
63420
|
-
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
|
|
63430
|
+
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
|
63421
63431
|
}
|
|
63422
63432
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
63423
63433
|
const texts = source.texts;
|
package/lib/tsserver.js
CHANGED
|
@@ -2331,7 +2331,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2331
2331
|
|
|
2332
2332
|
// src/compiler/corePublic.ts
|
|
2333
2333
|
var versionMajorMinor = "5.3";
|
|
2334
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2334
|
+
var version = `${versionMajorMinor}.0-dev.20230811`;
|
|
2335
2335
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2336
2336
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2337
2337
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -61245,7 +61245,10 @@ function createTypeChecker(host) {
|
|
|
61245
61245
|
}
|
|
61246
61246
|
}
|
|
61247
61247
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
61248
|
-
const templates = filter(
|
|
61248
|
+
const templates = filter(
|
|
61249
|
+
types,
|
|
61250
|
+
(t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types))
|
|
61251
|
+
);
|
|
61249
61252
|
if (templates.length) {
|
|
61250
61253
|
let i = types.length;
|
|
61251
61254
|
while (i > 0) {
|
|
@@ -61650,15 +61653,19 @@ function createTypeChecker(host) {
|
|
|
61650
61653
|
function getConstituentCountOfTypes(types) {
|
|
61651
61654
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
61652
61655
|
}
|
|
61653
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(
|
|
61654
|
-
|
|
61656
|
+
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
61657
|
+
if (types.length !== 2) {
|
|
61658
|
+
return false;
|
|
61659
|
+
}
|
|
61660
|
+
const [t1, t2] = types;
|
|
61661
|
+
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
61655
61662
|
}
|
|
61656
61663
|
function getTypeFromIntersectionTypeNode(node) {
|
|
61657
61664
|
const links = getNodeLinks(node);
|
|
61658
61665
|
if (!links.resolvedType) {
|
|
61659
61666
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
61660
61667
|
const types = map(node.types, getTypeFromTypeNode);
|
|
61661
|
-
const noSupertypeReduction =
|
|
61668
|
+
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
|
|
61662
61669
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
61663
61670
|
}
|
|
61664
61671
|
return links.resolvedType;
|
|
@@ -68116,6 +68123,9 @@ function createTypeChecker(host) {
|
|
|
68116
68123
|
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
68117
68124
|
return true;
|
|
68118
68125
|
}
|
|
68126
|
+
if (target.flags & 2097152 /* Intersection */) {
|
|
68127
|
+
return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
|
|
68128
|
+
}
|
|
68119
68129
|
if (source.flags & 128 /* StringLiteral */) {
|
|
68120
68130
|
const value = source.value;
|
|
68121
68131
|
return !!(target.flags & 8 /* Number */ && isValidNumberString(
|
|
@@ -68126,7 +68136,7 @@ function createTypeChecker(host) {
|
|
|
68126
68136
|
value,
|
|
68127
68137
|
/*roundTripOnly*/
|
|
68128
68138
|
false
|
|
68129
|
-
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
|
|
68139
|
+
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
|
68130
68140
|
}
|
|
68131
68141
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
68132
68142
|
const texts = source.texts;
|
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.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230811`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -59008,7 +59008,10 @@ ${lanes.join("\n")}
|
|
|
59008
59008
|
}
|
|
59009
59009
|
}
|
|
59010
59010
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
59011
|
-
const templates = filter(
|
|
59011
|
+
const templates = filter(
|
|
59012
|
+
types,
|
|
59013
|
+
(t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types))
|
|
59014
|
+
);
|
|
59012
59015
|
if (templates.length) {
|
|
59013
59016
|
let i = types.length;
|
|
59014
59017
|
while (i > 0) {
|
|
@@ -59413,15 +59416,19 @@ ${lanes.join("\n")}
|
|
|
59413
59416
|
function getConstituentCountOfTypes(types) {
|
|
59414
59417
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
59415
59418
|
}
|
|
59416
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(
|
|
59417
|
-
|
|
59419
|
+
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
59420
|
+
if (types.length !== 2) {
|
|
59421
|
+
return false;
|
|
59422
|
+
}
|
|
59423
|
+
const [t1, t2] = types;
|
|
59424
|
+
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
59418
59425
|
}
|
|
59419
59426
|
function getTypeFromIntersectionTypeNode(node) {
|
|
59420
59427
|
const links = getNodeLinks(node);
|
|
59421
59428
|
if (!links.resolvedType) {
|
|
59422
59429
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
59423
59430
|
const types = map(node.types, getTypeFromTypeNode);
|
|
59424
|
-
const noSupertypeReduction =
|
|
59431
|
+
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
|
|
59425
59432
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
59426
59433
|
}
|
|
59427
59434
|
return links.resolvedType;
|
|
@@ -65879,6 +65886,9 @@ ${lanes.join("\n")}
|
|
|
65879
65886
|
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
65880
65887
|
return true;
|
|
65881
65888
|
}
|
|
65889
|
+
if (target.flags & 2097152 /* Intersection */) {
|
|
65890
|
+
return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
|
|
65891
|
+
}
|
|
65882
65892
|
if (source.flags & 128 /* StringLiteral */) {
|
|
65883
65893
|
const value = source.value;
|
|
65884
65894
|
return !!(target.flags & 8 /* Number */ && isValidNumberString(
|
|
@@ -65889,7 +65899,7 @@ ${lanes.join("\n")}
|
|
|
65889
65899
|
value,
|
|
65890
65900
|
/*roundTripOnly*/
|
|
65891
65901
|
false
|
|
65892
|
-
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
|
|
65902
|
+
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
|
65893
65903
|
}
|
|
65894
65904
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
65895
65905
|
const texts = source.texts;
|
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.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230811`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -59008,7 +59008,10 @@ ${lanes.join("\n")}
|
|
|
59008
59008
|
}
|
|
59009
59009
|
}
|
|
59010
59010
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
59011
|
-
const templates = filter(
|
|
59011
|
+
const templates = filter(
|
|
59012
|
+
types,
|
|
59013
|
+
(t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types))
|
|
59014
|
+
);
|
|
59012
59015
|
if (templates.length) {
|
|
59013
59016
|
let i = types.length;
|
|
59014
59017
|
while (i > 0) {
|
|
@@ -59413,15 +59416,19 @@ ${lanes.join("\n")}
|
|
|
59413
59416
|
function getConstituentCountOfTypes(types) {
|
|
59414
59417
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
59415
59418
|
}
|
|
59416
|
-
function areIntersectedTypesAvoidingPrimitiveReduction(
|
|
59417
|
-
|
|
59419
|
+
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
59420
|
+
if (types.length !== 2) {
|
|
59421
|
+
return false;
|
|
59422
|
+
}
|
|
59423
|
+
const [t1, t2] = types;
|
|
59424
|
+
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
59418
59425
|
}
|
|
59419
59426
|
function getTypeFromIntersectionTypeNode(node) {
|
|
59420
59427
|
const links = getNodeLinks(node);
|
|
59421
59428
|
if (!links.resolvedType) {
|
|
59422
59429
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
59423
59430
|
const types = map(node.types, getTypeFromTypeNode);
|
|
59424
|
-
const noSupertypeReduction =
|
|
59431
|
+
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
|
|
59425
59432
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
59426
59433
|
}
|
|
59427
59434
|
return links.resolvedType;
|
|
@@ -65879,6 +65886,9 @@ ${lanes.join("\n")}
|
|
|
65879
65886
|
if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
|
|
65880
65887
|
return true;
|
|
65881
65888
|
}
|
|
65889
|
+
if (target.flags & 2097152 /* Intersection */) {
|
|
65890
|
+
return every(target.types, (t) => t === emptyTypeLiteralType || isValidTypeForTemplateLiteralPlaceholder(source, t));
|
|
65891
|
+
}
|
|
65882
65892
|
if (source.flags & 128 /* StringLiteral */) {
|
|
65883
65893
|
const value = source.value;
|
|
65884
65894
|
return !!(target.flags & 8 /* Number */ && isValidNumberString(
|
|
@@ -65889,7 +65899,7 @@ ${lanes.join("\n")}
|
|
|
65889
65899
|
value,
|
|
65890
65900
|
/*roundTripOnly*/
|
|
65891
65901
|
false
|
|
65892
|
-
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target));
|
|
65902
|
+
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
|
65893
65903
|
}
|
|
65894
65904
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
65895
65905
|
const texts = source.texts;
|
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.3";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20230811`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
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.3.0-dev.
|
|
5
|
+
"version": "5.3.0-dev.20230811",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"node": "20.1.0",
|
|
114
114
|
"npm": "8.19.4"
|
|
115
115
|
},
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "28cd1fbd13b8d09259e7a7086aa258c0221c38ac"
|
|
117
117
|
}
|