@typescript-deploys/pr-build 5.4.0-pr-56780-8 → 5.4.0-pr-56939-8
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 +49 -17
- package/lib/tsserver.js +73 -34
- package/lib/typescript.d.ts +2 -2
- package/lib/typescript.js +71 -34
- package/lib/typingsInstaller.js +20 -2
- 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.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240103`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -33755,7 +33755,25 @@ var IncrementalParser;
|
|
|
33755
33755
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
33756
33756
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
33757
33757
|
function isDeclarationFileName(fileName) {
|
|
33758
|
-
return
|
|
33758
|
+
return getDeclarationFileExtension(fileName) !== void 0;
|
|
33759
|
+
}
|
|
33760
|
+
function getDeclarationFileExtension(fileName) {
|
|
33761
|
+
const standardExtension = getAnyExtensionFromPath(
|
|
33762
|
+
fileName,
|
|
33763
|
+
supportedDeclarationExtensions,
|
|
33764
|
+
/*ignoreCase*/
|
|
33765
|
+
false
|
|
33766
|
+
);
|
|
33767
|
+
if (standardExtension) {
|
|
33768
|
+
return standardExtension;
|
|
33769
|
+
}
|
|
33770
|
+
if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
|
|
33771
|
+
const index = getBaseFileName(fileName).lastIndexOf(".d.");
|
|
33772
|
+
if (index >= 0) {
|
|
33773
|
+
return fileName.substring(index);
|
|
33774
|
+
}
|
|
33775
|
+
}
|
|
33776
|
+
return void 0;
|
|
33759
33777
|
}
|
|
33760
33778
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
33761
33779
|
if (!mode) {
|
|
@@ -50961,7 +50979,7 @@ function createTypeChecker(host) {
|
|
|
50961
50979
|
});
|
|
50962
50980
|
}
|
|
50963
50981
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
50964
|
-
var _a2, _b, _c, _d, _e;
|
|
50982
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
50965
50983
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
50966
50984
|
if (!node)
|
|
50967
50985
|
return Debug.fail();
|
|
@@ -51159,6 +51177,9 @@ function createTypeChecker(host) {
|
|
|
51159
51177
|
}
|
|
51160
51178
|
case 281 /* ExportSpecifier */:
|
|
51161
51179
|
const specifier = node.parent.parent.moduleSpecifier;
|
|
51180
|
+
if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
|
|
51181
|
+
verbatimTargetName = "default" /* Default */;
|
|
51182
|
+
}
|
|
51162
51183
|
serializeExportSpecifier(
|
|
51163
51184
|
unescapeLeadingUnderscores(symbol.escapedName),
|
|
51164
51185
|
specifier ? verbatimTargetName : targetName,
|
|
@@ -52162,7 +52183,7 @@ function createTypeChecker(host) {
|
|
|
52162
52183
|
if (declaration.dotDotDotToken) {
|
|
52163
52184
|
const baseConstraint = mapType(parentType, (t) => t.flags & 58982400 /* InstantiableNonPrimitive */ ? getBaseConstraintOrType(t) : t);
|
|
52164
52185
|
type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
|
|
52165
|
-
} else if (isArrayLikeType(parentType)
|
|
52186
|
+
} else if (isArrayLikeType(parentType)) {
|
|
52166
52187
|
const indexType = getNumberLiteralType(index);
|
|
52167
52188
|
const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
|
|
52168
52189
|
const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType;
|
|
@@ -58209,7 +58230,7 @@ function createTypeChecker(host) {
|
|
|
58209
58230
|
}
|
|
58210
58231
|
}
|
|
58211
58232
|
if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) {
|
|
58212
|
-
if (objectType.flags & 1 /* Any */
|
|
58233
|
+
if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
|
|
58213
58234
|
return objectType;
|
|
58214
58235
|
}
|
|
58215
58236
|
const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
|
|
@@ -64634,6 +64655,9 @@ function createTypeChecker(host) {
|
|
|
64634
64655
|
inferToTemplateLiteralType(source, target);
|
|
64635
64656
|
} else {
|
|
64636
64657
|
source = getReducedType(source);
|
|
64658
|
+
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
64659
|
+
invokeOnce(source, target, inferFromGenericMappedTypes);
|
|
64660
|
+
}
|
|
64637
64661
|
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
64638
64662
|
const apparentSource = getApparentType(source);
|
|
64639
64663
|
if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
|
|
@@ -64897,6 +64921,14 @@ function createTypeChecker(host) {
|
|
|
64897
64921
|
}
|
|
64898
64922
|
}
|
|
64899
64923
|
}
|
|
64924
|
+
function inferFromGenericMappedTypes(source, target) {
|
|
64925
|
+
inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
|
|
64926
|
+
inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
|
|
64927
|
+
const sourceNameType = getNameTypeFromMappedType(source);
|
|
64928
|
+
const targetNameType = getNameTypeFromMappedType(target);
|
|
64929
|
+
if (sourceNameType && targetNameType)
|
|
64930
|
+
inferFromTypes(sourceNameType, targetNameType);
|
|
64931
|
+
}
|
|
64900
64932
|
function inferFromObjectTypes(source, target) {
|
|
64901
64933
|
var _a, _b;
|
|
64902
64934
|
if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
|
|
@@ -64904,12 +64936,7 @@ function createTypeChecker(host) {
|
|
|
64904
64936
|
return;
|
|
64905
64937
|
}
|
|
64906
64938
|
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
64907
|
-
|
|
64908
|
-
inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
|
|
64909
|
-
const sourceNameType = getNameTypeFromMappedType(source);
|
|
64910
|
-
const targetNameType = getNameTypeFromMappedType(target);
|
|
64911
|
-
if (sourceNameType && targetNameType)
|
|
64912
|
-
inferFromTypes(sourceNameType, targetNameType);
|
|
64939
|
+
inferFromGenericMappedTypes(source, target);
|
|
64913
64940
|
}
|
|
64914
64941
|
if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
|
|
64915
64942
|
const constraintType = getConstraintTypeFromMappedType(target);
|
|
@@ -75705,7 +75732,7 @@ function createTypeChecker(host) {
|
|
|
75705
75732
|
const context = getInferenceContext(node);
|
|
75706
75733
|
const returnType = context.signature && getReturnTypeOfSignature(context.signature);
|
|
75707
75734
|
const returnSignature = returnType && getSingleCallOrConstructSignature(returnType);
|
|
75708
|
-
if (returnSignature && !returnSignature.typeParameters && !every(context.inferences, hasInferenceCandidates)) {
|
|
75735
|
+
if (returnSignature && !returnSignature.typeParameters && !every(context.inferences, (info) => hasInferenceCandidates(info) && info.priority === 0 /* None */)) {
|
|
75709
75736
|
const uniqueTypeParameters = getUniqueTypeParameters(context, signature.typeParameters);
|
|
75710
75737
|
const instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters);
|
|
75711
75738
|
const inferences = map(context.inferences, (info) => createInferenceInfo(info.typeParameter));
|
|
@@ -75724,8 +75751,8 @@ function createTypeChecker(host) {
|
|
|
75724
75751
|
applyToReturnTypes(instantiatedSignature, contextualSignature, (source, target) => {
|
|
75725
75752
|
inferTypes(inferences, source, target);
|
|
75726
75753
|
});
|
|
75727
|
-
|
|
75728
|
-
|
|
75754
|
+
const merged = tryInferencesMerge(context.inferences, inferences);
|
|
75755
|
+
if (merged) {
|
|
75729
75756
|
context.inferredTypeParameters = concatenate(context.inferredTypeParameters, uniqueTypeParameters);
|
|
75730
75757
|
return getOrCreateTypeFromSignature(instantiatedSignature);
|
|
75731
75758
|
}
|
|
@@ -75758,12 +75785,17 @@ function createTypeChecker(host) {
|
|
|
75758
75785
|
}
|
|
75759
75786
|
return false;
|
|
75760
75787
|
}
|
|
75761
|
-
function
|
|
75788
|
+
function tryInferencesMerge(target, source) {
|
|
75789
|
+
let merged = false;
|
|
75790
|
+
const areOverlapping = hasOverlappingInferences(target, source);
|
|
75762
75791
|
for (let i = 0; i < target.length; i++) {
|
|
75763
|
-
if (
|
|
75792
|
+
if (areOverlapping ? hasInferenceCandidates(source[i]) && hasInferenceCandidates(target[i]) && source[i].priority < (target[i].priority & ~128 /* ReturnType */) : hasInferenceCandidates(source[i])) {
|
|
75764
75793
|
target[i] = source[i];
|
|
75794
|
+
target[i].priority = 0 /* None */;
|
|
75795
|
+
merged = true;
|
|
75765
75796
|
}
|
|
75766
75797
|
}
|
|
75798
|
+
return merged;
|
|
75767
75799
|
}
|
|
75768
75800
|
function getUniqueTypeParameters(context, typeParameters) {
|
|
75769
75801
|
const result = [];
|
|
@@ -78733,7 +78765,7 @@ function createTypeChecker(host) {
|
|
|
78733
78765
|
const allowAsyncIterables = (use & 2 /* AllowsAsyncIterablesFlag */) !== 0;
|
|
78734
78766
|
if (inputType === neverType) {
|
|
78735
78767
|
reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables);
|
|
78736
|
-
return
|
|
78768
|
+
return void 0;
|
|
78737
78769
|
}
|
|
78738
78770
|
const uplevelIteration = languageVersion >= 2 /* ES2015 */;
|
|
78739
78771
|
const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
|
package/lib/tsserver.js
CHANGED
|
@@ -269,6 +269,7 @@ __export(server_exports, {
|
|
|
269
269
|
changeAnyExtension: () => changeAnyExtension,
|
|
270
270
|
changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
|
|
271
271
|
changeExtension: () => changeExtension,
|
|
272
|
+
changeFullExtension: () => changeFullExtension,
|
|
272
273
|
changesAffectModuleResolution: () => changesAffectModuleResolution,
|
|
273
274
|
changesAffectingProgramStructure: () => changesAffectingProgramStructure,
|
|
274
275
|
childIsDecorated: () => childIsDecorated,
|
|
@@ -708,6 +709,7 @@ __export(server_exports, {
|
|
|
708
709
|
getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
|
|
709
710
|
getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
|
|
710
711
|
getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
|
|
712
|
+
getDeclarationFileExtension: () => getDeclarationFileExtension,
|
|
711
713
|
getDeclarationFromName: () => getDeclarationFromName,
|
|
712
714
|
getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
|
|
713
715
|
getDeclarationOfKind: () => getDeclarationOfKind,
|
|
@@ -2339,7 +2341,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2339
2341
|
|
|
2340
2342
|
// src/compiler/corePublic.ts
|
|
2341
2343
|
var versionMajorMinor = "5.4";
|
|
2342
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2344
|
+
var version = `${versionMajorMinor}.0-insiders.20240103`;
|
|
2343
2345
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2344
2346
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2345
2347
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9107,6 +9109,13 @@ function changeAnyExtension(path, ext, extensions, ignoreCase) {
|
|
|
9107
9109
|
const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
|
|
9108
9110
|
return pathext ? path.slice(0, path.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path;
|
|
9109
9111
|
}
|
|
9112
|
+
function changeFullExtension(path, newExtension) {
|
|
9113
|
+
const declarationExtension = getDeclarationFileExtension(path);
|
|
9114
|
+
if (declarationExtension) {
|
|
9115
|
+
return path.slice(0, path.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
|
|
9116
|
+
}
|
|
9117
|
+
return changeAnyExtension(path, newExtension);
|
|
9118
|
+
}
|
|
9110
9119
|
var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;
|
|
9111
9120
|
function comparePathsWorker(a, b, componentComparer) {
|
|
9112
9121
|
if (a === b)
|
|
@@ -38174,7 +38183,25 @@ var IncrementalParser;
|
|
|
38174
38183
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
38175
38184
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
38176
38185
|
function isDeclarationFileName(fileName) {
|
|
38177
|
-
return
|
|
38186
|
+
return getDeclarationFileExtension(fileName) !== void 0;
|
|
38187
|
+
}
|
|
38188
|
+
function getDeclarationFileExtension(fileName) {
|
|
38189
|
+
const standardExtension = getAnyExtensionFromPath(
|
|
38190
|
+
fileName,
|
|
38191
|
+
supportedDeclarationExtensions,
|
|
38192
|
+
/*ignoreCase*/
|
|
38193
|
+
false
|
|
38194
|
+
);
|
|
38195
|
+
if (standardExtension) {
|
|
38196
|
+
return standardExtension;
|
|
38197
|
+
}
|
|
38198
|
+
if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
|
|
38199
|
+
const index = getBaseFileName(fileName).lastIndexOf(".d.");
|
|
38200
|
+
if (index >= 0) {
|
|
38201
|
+
return fileName.substring(index);
|
|
38202
|
+
}
|
|
38203
|
+
}
|
|
38204
|
+
return void 0;
|
|
38178
38205
|
}
|
|
38179
38206
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
38180
38207
|
if (!mode) {
|
|
@@ -43173,7 +43200,7 @@ function loadEntrypointsFromExportMap(scope, exports2, state, extensions) {
|
|
|
43173
43200
|
/*excludes*/
|
|
43174
43201
|
void 0,
|
|
43175
43202
|
[
|
|
43176
|
-
|
|
43203
|
+
changeFullExtension(replaceFirstStar(target, "**/*"), ".*")
|
|
43177
43204
|
]
|
|
43178
43205
|
).forEach((entry) => {
|
|
43179
43206
|
entrypoints = appendIfUnique(entrypoints, {
|
|
@@ -55680,7 +55707,7 @@ function createTypeChecker(host) {
|
|
|
55680
55707
|
});
|
|
55681
55708
|
}
|
|
55682
55709
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
55683
|
-
var _a2, _b, _c, _d, _e;
|
|
55710
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
55684
55711
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
55685
55712
|
if (!node)
|
|
55686
55713
|
return Debug.fail();
|
|
@@ -55878,6 +55905,9 @@ function createTypeChecker(host) {
|
|
|
55878
55905
|
}
|
|
55879
55906
|
case 281 /* ExportSpecifier */:
|
|
55880
55907
|
const specifier = node.parent.parent.moduleSpecifier;
|
|
55908
|
+
if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
|
|
55909
|
+
verbatimTargetName = "default" /* Default */;
|
|
55910
|
+
}
|
|
55881
55911
|
serializeExportSpecifier(
|
|
55882
55912
|
unescapeLeadingUnderscores(symbol.escapedName),
|
|
55883
55913
|
specifier ? verbatimTargetName : targetName,
|
|
@@ -56881,7 +56911,7 @@ function createTypeChecker(host) {
|
|
|
56881
56911
|
if (declaration.dotDotDotToken) {
|
|
56882
56912
|
const baseConstraint = mapType(parentType, (t) => t.flags & 58982400 /* InstantiableNonPrimitive */ ? getBaseConstraintOrType(t) : t);
|
|
56883
56913
|
type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
|
|
56884
|
-
} else if (isArrayLikeType(parentType)
|
|
56914
|
+
} else if (isArrayLikeType(parentType)) {
|
|
56885
56915
|
const indexType = getNumberLiteralType(index);
|
|
56886
56916
|
const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
|
|
56887
56917
|
const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType;
|
|
@@ -62928,7 +62958,7 @@ function createTypeChecker(host) {
|
|
|
62928
62958
|
}
|
|
62929
62959
|
}
|
|
62930
62960
|
if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) {
|
|
62931
|
-
if (objectType.flags & 1 /* Any */
|
|
62961
|
+
if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
|
|
62932
62962
|
return objectType;
|
|
62933
62963
|
}
|
|
62934
62964
|
const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
|
|
@@ -69353,6 +69383,9 @@ function createTypeChecker(host) {
|
|
|
69353
69383
|
inferToTemplateLiteralType(source, target);
|
|
69354
69384
|
} else {
|
|
69355
69385
|
source = getReducedType(source);
|
|
69386
|
+
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
69387
|
+
invokeOnce(source, target, inferFromGenericMappedTypes);
|
|
69388
|
+
}
|
|
69356
69389
|
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
69357
69390
|
const apparentSource = getApparentType(source);
|
|
69358
69391
|
if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
|
|
@@ -69616,6 +69649,14 @@ function createTypeChecker(host) {
|
|
|
69616
69649
|
}
|
|
69617
69650
|
}
|
|
69618
69651
|
}
|
|
69652
|
+
function inferFromGenericMappedTypes(source, target) {
|
|
69653
|
+
inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
|
|
69654
|
+
inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
|
|
69655
|
+
const sourceNameType = getNameTypeFromMappedType(source);
|
|
69656
|
+
const targetNameType = getNameTypeFromMappedType(target);
|
|
69657
|
+
if (sourceNameType && targetNameType)
|
|
69658
|
+
inferFromTypes(sourceNameType, targetNameType);
|
|
69659
|
+
}
|
|
69619
69660
|
function inferFromObjectTypes(source, target) {
|
|
69620
69661
|
var _a, _b;
|
|
69621
69662
|
if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
|
|
@@ -69623,12 +69664,7 @@ function createTypeChecker(host) {
|
|
|
69623
69664
|
return;
|
|
69624
69665
|
}
|
|
69625
69666
|
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
69626
|
-
|
|
69627
|
-
inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
|
|
69628
|
-
const sourceNameType = getNameTypeFromMappedType(source);
|
|
69629
|
-
const targetNameType = getNameTypeFromMappedType(target);
|
|
69630
|
-
if (sourceNameType && targetNameType)
|
|
69631
|
-
inferFromTypes(sourceNameType, targetNameType);
|
|
69667
|
+
inferFromGenericMappedTypes(source, target);
|
|
69632
69668
|
}
|
|
69633
69669
|
if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
|
|
69634
69670
|
const constraintType = getConstraintTypeFromMappedType(target);
|
|
@@ -80424,7 +80460,7 @@ function createTypeChecker(host) {
|
|
|
80424
80460
|
const context = getInferenceContext(node);
|
|
80425
80461
|
const returnType = context.signature && getReturnTypeOfSignature(context.signature);
|
|
80426
80462
|
const returnSignature = returnType && getSingleCallOrConstructSignature(returnType);
|
|
80427
|
-
if (returnSignature && !returnSignature.typeParameters && !every(context.inferences, hasInferenceCandidates)) {
|
|
80463
|
+
if (returnSignature && !returnSignature.typeParameters && !every(context.inferences, (info) => hasInferenceCandidates(info) && info.priority === 0 /* None */)) {
|
|
80428
80464
|
const uniqueTypeParameters = getUniqueTypeParameters(context, signature.typeParameters);
|
|
80429
80465
|
const instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters);
|
|
80430
80466
|
const inferences = map(context.inferences, (info) => createInferenceInfo(info.typeParameter));
|
|
@@ -80443,8 +80479,8 @@ function createTypeChecker(host) {
|
|
|
80443
80479
|
applyToReturnTypes(instantiatedSignature, contextualSignature, (source, target) => {
|
|
80444
80480
|
inferTypes(inferences, source, target);
|
|
80445
80481
|
});
|
|
80446
|
-
|
|
80447
|
-
|
|
80482
|
+
const merged = tryInferencesMerge(context.inferences, inferences);
|
|
80483
|
+
if (merged) {
|
|
80448
80484
|
context.inferredTypeParameters = concatenate(context.inferredTypeParameters, uniqueTypeParameters);
|
|
80449
80485
|
return getOrCreateTypeFromSignature(instantiatedSignature);
|
|
80450
80486
|
}
|
|
@@ -80477,12 +80513,17 @@ function createTypeChecker(host) {
|
|
|
80477
80513
|
}
|
|
80478
80514
|
return false;
|
|
80479
80515
|
}
|
|
80480
|
-
function
|
|
80516
|
+
function tryInferencesMerge(target, source) {
|
|
80517
|
+
let merged = false;
|
|
80518
|
+
const areOverlapping = hasOverlappingInferences(target, source);
|
|
80481
80519
|
for (let i = 0; i < target.length; i++) {
|
|
80482
|
-
if (
|
|
80520
|
+
if (areOverlapping ? hasInferenceCandidates(source[i]) && hasInferenceCandidates(target[i]) && source[i].priority < (target[i].priority & ~128 /* ReturnType */) : hasInferenceCandidates(source[i])) {
|
|
80483
80521
|
target[i] = source[i];
|
|
80522
|
+
target[i].priority = 0 /* None */;
|
|
80523
|
+
merged = true;
|
|
80484
80524
|
}
|
|
80485
80525
|
}
|
|
80526
|
+
return merged;
|
|
80486
80527
|
}
|
|
80487
80528
|
function getUniqueTypeParameters(context, typeParameters) {
|
|
80488
80529
|
const result = [];
|
|
@@ -83452,7 +83493,7 @@ function createTypeChecker(host) {
|
|
|
83452
83493
|
const allowAsyncIterables = (use & 2 /* AllowsAsyncIterablesFlag */) !== 0;
|
|
83453
83494
|
if (inputType === neverType) {
|
|
83454
83495
|
reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables);
|
|
83455
|
-
return
|
|
83496
|
+
return void 0;
|
|
83456
83497
|
}
|
|
83457
83498
|
const uplevelIteration = languageVersion >= 2 /* ES2015 */;
|
|
83458
83499
|
const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
|
|
@@ -134226,10 +134267,11 @@ function buildLinkParts(link, checker) {
|
|
|
134226
134267
|
}
|
|
134227
134268
|
} else {
|
|
134228
134269
|
const symbol = checker == null ? void 0 : checker.getSymbolAtLocation(link.name);
|
|
134270
|
+
const targetSymbol = symbol && checker ? getSymbolTarget(symbol, checker) : void 0;
|
|
134229
134271
|
const suffix = findLinkNameEnd(link.text);
|
|
134230
134272
|
const name = getTextOfNode(link.name) + link.text.slice(0, suffix);
|
|
134231
134273
|
const text = skipSeparatorFromLinkText(link.text.slice(suffix));
|
|
134232
|
-
const decl = (
|
|
134274
|
+
const decl = (targetSymbol == null ? void 0 : targetSymbol.valueDeclaration) || ((_a = targetSymbol == null ? void 0 : targetSymbol.declarations) == null ? void 0 : _a[0]);
|
|
134233
134275
|
if (decl) {
|
|
134234
134276
|
parts.push(linkNamePart(name, decl));
|
|
134235
134277
|
if (text)
|
|
@@ -153756,21 +153798,14 @@ function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration }
|
|
|
153756
153798
|
const type = checker.getTypeAtLocation(member);
|
|
153757
153799
|
return !!(type && type.flags & 402653316 /* StringLike */);
|
|
153758
153800
|
});
|
|
153801
|
+
const sourceFile = parentDeclaration.getSourceFile();
|
|
153759
153802
|
const enumMember = factory.createEnumMember(token, hasStringInitializer ? factory.createStringLiteral(token.text) : void 0);
|
|
153760
|
-
|
|
153761
|
-
|
|
153762
|
-
parentDeclaration
|
|
153763
|
-
|
|
153764
|
-
|
|
153765
|
-
|
|
153766
|
-
parentDeclaration.name,
|
|
153767
|
-
concatenate(parentDeclaration.members, singleElementArray(enumMember))
|
|
153768
|
-
),
|
|
153769
|
-
{
|
|
153770
|
-
leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll,
|
|
153771
|
-
trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude
|
|
153772
|
-
}
|
|
153773
|
-
);
|
|
153803
|
+
const last2 = lastOrUndefined(parentDeclaration.members);
|
|
153804
|
+
if (last2) {
|
|
153805
|
+
changes.insertNodeInListAfter(sourceFile, last2, enumMember, parentDeclaration.members);
|
|
153806
|
+
} else {
|
|
153807
|
+
changes.insertMemberAtStart(sourceFile, parentDeclaration, enumMember);
|
|
153808
|
+
}
|
|
153774
153809
|
}
|
|
153775
153810
|
function addFunctionDeclaration(changes, context, info) {
|
|
153776
153811
|
const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
|
|
@@ -170298,7 +170333,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
170298
170333
|
const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile);
|
|
170299
170334
|
multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition;
|
|
170300
170335
|
}
|
|
170301
|
-
if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) {
|
|
170336
|
+
if (hasCommentsBeforeLineBreak(sourceFile.text, after.end) || !positionsAreOnSameLine(containingList.pos, containingList.end, sourceFile)) {
|
|
170302
170337
|
multilineList = true;
|
|
170303
170338
|
}
|
|
170304
170339
|
if (multilineList) {
|
|
@@ -173953,6 +173988,7 @@ __export(ts_exports2, {
|
|
|
173953
173988
|
changeAnyExtension: () => changeAnyExtension,
|
|
173954
173989
|
changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
|
|
173955
173990
|
changeExtension: () => changeExtension,
|
|
173991
|
+
changeFullExtension: () => changeFullExtension,
|
|
173956
173992
|
changesAffectModuleResolution: () => changesAffectModuleResolution,
|
|
173957
173993
|
changesAffectingProgramStructure: () => changesAffectingProgramStructure,
|
|
173958
173994
|
childIsDecorated: () => childIsDecorated,
|
|
@@ -174392,6 +174428,7 @@ __export(ts_exports2, {
|
|
|
174392
174428
|
getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
|
|
174393
174429
|
getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
|
|
174394
174430
|
getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
|
|
174431
|
+
getDeclarationFileExtension: () => getDeclarationFileExtension,
|
|
174395
174432
|
getDeclarationFromName: () => getDeclarationFromName,
|
|
174396
174433
|
getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
|
|
174397
174434
|
getDeclarationOfKind: () => getDeclarationOfKind,
|
|
@@ -188752,6 +188789,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188752
188789
|
changeAnyExtension,
|
|
188753
188790
|
changeCompilerHostLikeToUseCache,
|
|
188754
188791
|
changeExtension,
|
|
188792
|
+
changeFullExtension,
|
|
188755
188793
|
changesAffectModuleResolution,
|
|
188756
188794
|
changesAffectingProgramStructure,
|
|
188757
188795
|
childIsDecorated,
|
|
@@ -189191,6 +189229,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
189191
189229
|
getDeclarationEmitExtensionForPath,
|
|
189192
189230
|
getDeclarationEmitOutputFilePath,
|
|
189193
189231
|
getDeclarationEmitOutputFilePathWorker,
|
|
189232
|
+
getDeclarationFileExtension,
|
|
189194
189233
|
getDeclarationFromName,
|
|
189195
189234
|
getDeclarationModifierFlagsFromSymbol,
|
|
189196
189235
|
getDeclarationOfKind,
|
package/lib/typescript.d.ts
CHANGED
|
@@ -9914,13 +9914,13 @@ declare namespace ts {
|
|
|
9914
9914
|
* A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
|
|
9915
9915
|
* `options` parameter.
|
|
9916
9916
|
*
|
|
9917
|
-
* @param fileName The
|
|
9917
|
+
* @param fileName The file name to check the format of (it need not exist on disk)
|
|
9918
9918
|
* @param [packageJsonInfoCache] A cache for package file lookups - it's best to have a cache when this function is called often
|
|
9919
9919
|
* @param host The ModuleResolutionHost which can perform the filesystem lookups for package json data
|
|
9920
9920
|
* @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
|
|
9921
9921
|
* @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
|
|
9922
9922
|
*/
|
|
9923
|
-
function getImpliedNodeFormatForFile(fileName:
|
|
9923
|
+
function getImpliedNodeFormatForFile(fileName: string, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
|
|
9924
9924
|
/**
|
|
9925
9925
|
* Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
|
|
9926
9926
|
* that represent a compilation unit.
|
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.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20240103`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6862,6 +6862,13 @@ ${lanes.join("\n")}
|
|
|
6862
6862
|
const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
|
|
6863
6863
|
return pathext ? path.slice(0, path.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path;
|
|
6864
6864
|
}
|
|
6865
|
+
function changeFullExtension(path, newExtension) {
|
|
6866
|
+
const declarationExtension = getDeclarationFileExtension(path);
|
|
6867
|
+
if (declarationExtension) {
|
|
6868
|
+
return path.slice(0, path.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
|
|
6869
|
+
}
|
|
6870
|
+
return changeAnyExtension(path, newExtension);
|
|
6871
|
+
}
|
|
6865
6872
|
function comparePathsWorker(a, b, componentComparer) {
|
|
6866
6873
|
if (a === b)
|
|
6867
6874
|
return 0 /* EqualTo */;
|
|
@@ -28453,7 +28460,25 @@ ${lanes.join("\n")}
|
|
|
28453
28460
|
return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2);
|
|
28454
28461
|
}
|
|
28455
28462
|
function isDeclarationFileName(fileName) {
|
|
28456
|
-
return
|
|
28463
|
+
return getDeclarationFileExtension(fileName) !== void 0;
|
|
28464
|
+
}
|
|
28465
|
+
function getDeclarationFileExtension(fileName) {
|
|
28466
|
+
const standardExtension = getAnyExtensionFromPath(
|
|
28467
|
+
fileName,
|
|
28468
|
+
supportedDeclarationExtensions,
|
|
28469
|
+
/*ignoreCase*/
|
|
28470
|
+
false
|
|
28471
|
+
);
|
|
28472
|
+
if (standardExtension) {
|
|
28473
|
+
return standardExtension;
|
|
28474
|
+
}
|
|
28475
|
+
if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
|
|
28476
|
+
const index = getBaseFileName(fileName).lastIndexOf(".d.");
|
|
28477
|
+
if (index >= 0) {
|
|
28478
|
+
return fileName.substring(index);
|
|
28479
|
+
}
|
|
28480
|
+
}
|
|
28481
|
+
return void 0;
|
|
28457
28482
|
}
|
|
28458
28483
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
28459
28484
|
if (!mode) {
|
|
@@ -41006,7 +41031,7 @@ ${lanes.join("\n")}
|
|
|
41006
41031
|
/*excludes*/
|
|
41007
41032
|
void 0,
|
|
41008
41033
|
[
|
|
41009
|
-
|
|
41034
|
+
changeFullExtension(replaceFirstStar(target, "**/*"), ".*")
|
|
41010
41035
|
]
|
|
41011
41036
|
).forEach((entry) => {
|
|
41012
41037
|
entrypoints = appendIfUnique(entrypoints, {
|
|
@@ -53436,7 +53461,7 @@ ${lanes.join("\n")}
|
|
|
53436
53461
|
});
|
|
53437
53462
|
}
|
|
53438
53463
|
function serializeAsAlias(symbol, localName, modifierFlags) {
|
|
53439
|
-
var _a2, _b, _c, _d, _e;
|
|
53464
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
53440
53465
|
const node = getDeclarationOfAliasSymbol(symbol);
|
|
53441
53466
|
if (!node)
|
|
53442
53467
|
return Debug.fail();
|
|
@@ -53634,6 +53659,9 @@ ${lanes.join("\n")}
|
|
|
53634
53659
|
}
|
|
53635
53660
|
case 281 /* ExportSpecifier */:
|
|
53636
53661
|
const specifier = node.parent.parent.moduleSpecifier;
|
|
53662
|
+
if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
|
|
53663
|
+
verbatimTargetName = "default" /* Default */;
|
|
53664
|
+
}
|
|
53637
53665
|
serializeExportSpecifier(
|
|
53638
53666
|
unescapeLeadingUnderscores(symbol.escapedName),
|
|
53639
53667
|
specifier ? verbatimTargetName : targetName,
|
|
@@ -54637,7 +54665,7 @@ ${lanes.join("\n")}
|
|
|
54637
54665
|
if (declaration.dotDotDotToken) {
|
|
54638
54666
|
const baseConstraint = mapType(parentType, (t) => t.flags & 58982400 /* InstantiableNonPrimitive */ ? getBaseConstraintOrType(t) : t);
|
|
54639
54667
|
type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
|
|
54640
|
-
} else if (isArrayLikeType(parentType)
|
|
54668
|
+
} else if (isArrayLikeType(parentType)) {
|
|
54641
54669
|
const indexType = getNumberLiteralType(index);
|
|
54642
54670
|
const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
|
|
54643
54671
|
const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType;
|
|
@@ -60684,7 +60712,7 @@ ${lanes.join("\n")}
|
|
|
60684
60712
|
}
|
|
60685
60713
|
}
|
|
60686
60714
|
if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) {
|
|
60687
|
-
if (objectType.flags & 1 /* Any */
|
|
60715
|
+
if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
|
|
60688
60716
|
return objectType;
|
|
60689
60717
|
}
|
|
60690
60718
|
const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
|
|
@@ -67109,6 +67137,9 @@ ${lanes.join("\n")}
|
|
|
67109
67137
|
inferToTemplateLiteralType(source, target);
|
|
67110
67138
|
} else {
|
|
67111
67139
|
source = getReducedType(source);
|
|
67140
|
+
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
67141
|
+
invokeOnce(source, target, inferFromGenericMappedTypes);
|
|
67142
|
+
}
|
|
67112
67143
|
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
67113
67144
|
const apparentSource = getApparentType(source);
|
|
67114
67145
|
if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
|
|
@@ -67372,6 +67403,14 @@ ${lanes.join("\n")}
|
|
|
67372
67403
|
}
|
|
67373
67404
|
}
|
|
67374
67405
|
}
|
|
67406
|
+
function inferFromGenericMappedTypes(source, target) {
|
|
67407
|
+
inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
|
|
67408
|
+
inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
|
|
67409
|
+
const sourceNameType = getNameTypeFromMappedType(source);
|
|
67410
|
+
const targetNameType = getNameTypeFromMappedType(target);
|
|
67411
|
+
if (sourceNameType && targetNameType)
|
|
67412
|
+
inferFromTypes(sourceNameType, targetNameType);
|
|
67413
|
+
}
|
|
67375
67414
|
function inferFromObjectTypes(source, target) {
|
|
67376
67415
|
var _a, _b;
|
|
67377
67416
|
if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
|
|
@@ -67379,12 +67418,7 @@ ${lanes.join("\n")}
|
|
|
67379
67418
|
return;
|
|
67380
67419
|
}
|
|
67381
67420
|
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
67382
|
-
|
|
67383
|
-
inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
|
|
67384
|
-
const sourceNameType = getNameTypeFromMappedType(source);
|
|
67385
|
-
const targetNameType = getNameTypeFromMappedType(target);
|
|
67386
|
-
if (sourceNameType && targetNameType)
|
|
67387
|
-
inferFromTypes(sourceNameType, targetNameType);
|
|
67421
|
+
inferFromGenericMappedTypes(source, target);
|
|
67388
67422
|
}
|
|
67389
67423
|
if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
|
|
67390
67424
|
const constraintType = getConstraintTypeFromMappedType(target);
|
|
@@ -78180,7 +78214,7 @@ ${lanes.join("\n")}
|
|
|
78180
78214
|
const context = getInferenceContext(node);
|
|
78181
78215
|
const returnType = context.signature && getReturnTypeOfSignature(context.signature);
|
|
78182
78216
|
const returnSignature = returnType && getSingleCallOrConstructSignature(returnType);
|
|
78183
|
-
if (returnSignature && !returnSignature.typeParameters && !every(context.inferences, hasInferenceCandidates)) {
|
|
78217
|
+
if (returnSignature && !returnSignature.typeParameters && !every(context.inferences, (info) => hasInferenceCandidates(info) && info.priority === 0 /* None */)) {
|
|
78184
78218
|
const uniqueTypeParameters = getUniqueTypeParameters(context, signature.typeParameters);
|
|
78185
78219
|
const instantiatedSignature = getSignatureInstantiationWithoutFillingInTypeArguments(signature, uniqueTypeParameters);
|
|
78186
78220
|
const inferences = map(context.inferences, (info) => createInferenceInfo(info.typeParameter));
|
|
@@ -78199,8 +78233,8 @@ ${lanes.join("\n")}
|
|
|
78199
78233
|
applyToReturnTypes(instantiatedSignature, contextualSignature, (source, target) => {
|
|
78200
78234
|
inferTypes(inferences, source, target);
|
|
78201
78235
|
});
|
|
78202
|
-
|
|
78203
|
-
|
|
78236
|
+
const merged = tryInferencesMerge(context.inferences, inferences);
|
|
78237
|
+
if (merged) {
|
|
78204
78238
|
context.inferredTypeParameters = concatenate(context.inferredTypeParameters, uniqueTypeParameters);
|
|
78205
78239
|
return getOrCreateTypeFromSignature(instantiatedSignature);
|
|
78206
78240
|
}
|
|
@@ -78233,12 +78267,17 @@ ${lanes.join("\n")}
|
|
|
78233
78267
|
}
|
|
78234
78268
|
return false;
|
|
78235
78269
|
}
|
|
78236
|
-
function
|
|
78270
|
+
function tryInferencesMerge(target, source) {
|
|
78271
|
+
let merged = false;
|
|
78272
|
+
const areOverlapping = hasOverlappingInferences(target, source);
|
|
78237
78273
|
for (let i = 0; i < target.length; i++) {
|
|
78238
|
-
if (
|
|
78274
|
+
if (areOverlapping ? hasInferenceCandidates(source[i]) && hasInferenceCandidates(target[i]) && source[i].priority < (target[i].priority & ~128 /* ReturnType */) : hasInferenceCandidates(source[i])) {
|
|
78239
78275
|
target[i] = source[i];
|
|
78276
|
+
target[i].priority = 0 /* None */;
|
|
78277
|
+
merged = true;
|
|
78240
78278
|
}
|
|
78241
78279
|
}
|
|
78280
|
+
return merged;
|
|
78242
78281
|
}
|
|
78243
78282
|
function getUniqueTypeParameters(context, typeParameters) {
|
|
78244
78283
|
const result = [];
|
|
@@ -81208,7 +81247,7 @@ ${lanes.join("\n")}
|
|
|
81208
81247
|
const allowAsyncIterables = (use & 2 /* AllowsAsyncIterablesFlag */) !== 0;
|
|
81209
81248
|
if (inputType === neverType) {
|
|
81210
81249
|
reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables);
|
|
81211
|
-
return
|
|
81250
|
+
return void 0;
|
|
81212
81251
|
}
|
|
81213
81252
|
const uplevelIteration = languageVersion >= 2 /* ES2015 */;
|
|
81214
81253
|
const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
|
|
@@ -132481,10 +132520,11 @@ ${lanes.join("\n")}
|
|
|
132481
132520
|
}
|
|
132482
132521
|
} else {
|
|
132483
132522
|
const symbol = checker == null ? void 0 : checker.getSymbolAtLocation(link.name);
|
|
132523
|
+
const targetSymbol = symbol && checker ? getSymbolTarget(symbol, checker) : void 0;
|
|
132484
132524
|
const suffix = findLinkNameEnd(link.text);
|
|
132485
132525
|
const name = getTextOfNode(link.name) + link.text.slice(0, suffix);
|
|
132486
132526
|
const text = skipSeparatorFromLinkText(link.text.slice(suffix));
|
|
132487
|
-
const decl = (
|
|
132527
|
+
const decl = (targetSymbol == null ? void 0 : targetSymbol.valueDeclaration) || ((_a = targetSymbol == null ? void 0 : targetSymbol.declarations) == null ? void 0 : _a[0]);
|
|
132488
132528
|
if (decl) {
|
|
132489
132529
|
parts.push(linkNamePart(name, decl));
|
|
132490
132530
|
if (text)
|
|
@@ -152499,21 +152539,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
152499
152539
|
const type = checker.getTypeAtLocation(member);
|
|
152500
152540
|
return !!(type && type.flags & 402653316 /* StringLike */);
|
|
152501
152541
|
});
|
|
152542
|
+
const sourceFile = parentDeclaration.getSourceFile();
|
|
152502
152543
|
const enumMember = factory.createEnumMember(token, hasStringInitializer ? factory.createStringLiteral(token.text) : void 0);
|
|
152503
|
-
|
|
152504
|
-
|
|
152505
|
-
parentDeclaration
|
|
152506
|
-
|
|
152507
|
-
|
|
152508
|
-
|
|
152509
|
-
parentDeclaration.name,
|
|
152510
|
-
concatenate(parentDeclaration.members, singleElementArray(enumMember))
|
|
152511
|
-
),
|
|
152512
|
-
{
|
|
152513
|
-
leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll,
|
|
152514
|
-
trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude
|
|
152515
|
-
}
|
|
152516
|
-
);
|
|
152544
|
+
const last2 = lastOrUndefined(parentDeclaration.members);
|
|
152545
|
+
if (last2) {
|
|
152546
|
+
changes.insertNodeInListAfter(sourceFile, last2, enumMember, parentDeclaration.members);
|
|
152547
|
+
} else {
|
|
152548
|
+
changes.insertMemberAtStart(sourceFile, parentDeclaration, enumMember);
|
|
152549
|
+
}
|
|
152517
152550
|
}
|
|
152518
152551
|
function addFunctionDeclaration(changes, context, info) {
|
|
152519
152552
|
const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
|
|
@@ -170151,7 +170184,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
170151
170184
|
const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile);
|
|
170152
170185
|
multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition;
|
|
170153
170186
|
}
|
|
170154
|
-
if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) {
|
|
170187
|
+
if (hasCommentsBeforeLineBreak(sourceFile.text, after.end) || !positionsAreOnSameLine(containingList.pos, containingList.end, sourceFile)) {
|
|
170155
170188
|
multilineList = true;
|
|
170156
170189
|
}
|
|
170157
170190
|
if (multilineList) {
|
|
@@ -185504,6 +185537,7 @@ ${e.message}`;
|
|
|
185504
185537
|
changeAnyExtension: () => changeAnyExtension,
|
|
185505
185538
|
changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
|
|
185506
185539
|
changeExtension: () => changeExtension,
|
|
185540
|
+
changeFullExtension: () => changeFullExtension,
|
|
185507
185541
|
changesAffectModuleResolution: () => changesAffectModuleResolution,
|
|
185508
185542
|
changesAffectingProgramStructure: () => changesAffectingProgramStructure,
|
|
185509
185543
|
childIsDecorated: () => childIsDecorated,
|
|
@@ -185943,6 +185977,7 @@ ${e.message}`;
|
|
|
185943
185977
|
getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
|
|
185944
185978
|
getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
|
|
185945
185979
|
getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
|
|
185980
|
+
getDeclarationFileExtension: () => getDeclarationFileExtension,
|
|
185946
185981
|
getDeclarationFromName: () => getDeclarationFromName,
|
|
185947
185982
|
getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
|
|
185948
185983
|
getDeclarationOfKind: () => getDeclarationOfKind,
|
|
@@ -187924,6 +187959,7 @@ ${e.message}`;
|
|
|
187924
187959
|
changeAnyExtension: () => changeAnyExtension,
|
|
187925
187960
|
changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
|
|
187926
187961
|
changeExtension: () => changeExtension,
|
|
187962
|
+
changeFullExtension: () => changeFullExtension,
|
|
187927
187963
|
changesAffectModuleResolution: () => changesAffectModuleResolution,
|
|
187928
187964
|
changesAffectingProgramStructure: () => changesAffectingProgramStructure,
|
|
187929
187965
|
childIsDecorated: () => childIsDecorated,
|
|
@@ -188363,6 +188399,7 @@ ${e.message}`;
|
|
|
188363
188399
|
getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
|
|
188364
188400
|
getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
|
|
188365
188401
|
getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
|
|
188402
|
+
getDeclarationFileExtension: () => getDeclarationFileExtension,
|
|
188366
188403
|
getDeclarationFromName: () => getDeclarationFromName,
|
|
188367
188404
|
getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
|
|
188368
188405
|
getDeclarationOfKind: () => getDeclarationOfKind,
|
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.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20240103`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -25616,7 +25616,25 @@ var IncrementalParser;
|
|
|
25616
25616
|
})(InvalidPosition || (InvalidPosition = {}));
|
|
25617
25617
|
})(IncrementalParser || (IncrementalParser = {}));
|
|
25618
25618
|
function isDeclarationFileName(fileName) {
|
|
25619
|
-
return
|
|
25619
|
+
return getDeclarationFileExtension(fileName) !== void 0;
|
|
25620
|
+
}
|
|
25621
|
+
function getDeclarationFileExtension(fileName) {
|
|
25622
|
+
const standardExtension = getAnyExtensionFromPath(
|
|
25623
|
+
fileName,
|
|
25624
|
+
supportedDeclarationExtensions,
|
|
25625
|
+
/*ignoreCase*/
|
|
25626
|
+
false
|
|
25627
|
+
);
|
|
25628
|
+
if (standardExtension) {
|
|
25629
|
+
return standardExtension;
|
|
25630
|
+
}
|
|
25631
|
+
if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
|
|
25632
|
+
const index = getBaseFileName(fileName).lastIndexOf(".d.");
|
|
25633
|
+
if (index >= 0) {
|
|
25634
|
+
return fileName.substring(index);
|
|
25635
|
+
}
|
|
25636
|
+
}
|
|
25637
|
+
return void 0;
|
|
25620
25638
|
}
|
|
25621
25639
|
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
25622
25640
|
if (!mode) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-56939-8",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "04c80422db846a111808f99b29888f1ee1f5a6f7"
|
|
118
118
|
}
|