typescript 4.2.0-insiders.20210210 → 4.2.4
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/lib.es2020.intl.d.ts +2 -235
- package/lib/protocol.d.ts +63 -0
- package/lib/tsc.js +38 -19
- package/lib/tsserver.js +76 -30
- package/lib/tsserverlibrary.d.ts +62 -0
- package/lib/tsserverlibrary.js +76 -30
- package/lib/typescript.js +48 -30
- package/lib/typescriptServices.js +48 -30
- package/lib/typingsInstaller.js +39 -19
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -290,7 +290,7 @@ var ts;
|
|
|
290
290
|
// The following is baselined as a literal template type without intervention
|
|
291
291
|
/** The version of the TypeScript compiler release */
|
|
292
292
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
293
|
-
ts.version =
|
|
293
|
+
ts.version = "4.2.4";
|
|
294
294
|
/* @internal */
|
|
295
295
|
var Comparison;
|
|
296
296
|
(function (Comparison) {
|
|
@@ -7199,13 +7199,13 @@ var ts;
|
|
|
7199
7199
|
}
|
|
7200
7200
|
var activeSession;
|
|
7201
7201
|
var profilePath = "./profile.cpuprofile";
|
|
7202
|
-
var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
|
|
7203
7202
|
var Buffer = require("buffer").Buffer;
|
|
7204
7203
|
var nodeVersion = getNodeMajorVersion();
|
|
7205
7204
|
var isNode4OrLater = nodeVersion >= 4;
|
|
7206
7205
|
var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
7207
7206
|
var platform = _os.platform();
|
|
7208
7207
|
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
7208
|
+
var realpathSync = useCaseSensitiveFileNames ? ((_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync) : _fs.realpathSync;
|
|
7209
7209
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7210
7210
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7211
7211
|
var _c = createSystemWatchFunctions({
|
|
@@ -47177,7 +47177,9 @@ var ts;
|
|
|
47177
47177
|
var result = new Type(checker, flags);
|
|
47178
47178
|
typeCount++;
|
|
47179
47179
|
result.id = typeCount;
|
|
47180
|
-
|
|
47180
|
+
if (ts.tracing) {
|
|
47181
|
+
typeCatalog.push(result);
|
|
47182
|
+
}
|
|
47181
47183
|
return result;
|
|
47182
47184
|
}
|
|
47183
47185
|
function createOriginType(flags) {
|
|
@@ -47238,13 +47240,17 @@ var ts;
|
|
|
47238
47240
|
return result || ts.emptyArray;
|
|
47239
47241
|
}
|
|
47240
47242
|
function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47241
|
-
|
|
47242
|
-
|
|
47243
|
-
|
|
47244
|
-
|
|
47245
|
-
|
|
47246
|
-
|
|
47247
|
-
|
|
47243
|
+
var resolved = type;
|
|
47244
|
+
resolved.members = members;
|
|
47245
|
+
resolved.properties = ts.emptyArray;
|
|
47246
|
+
resolved.callSignatures = callSignatures;
|
|
47247
|
+
resolved.constructSignatures = constructSignatures;
|
|
47248
|
+
resolved.stringIndexInfo = stringIndexInfo;
|
|
47249
|
+
resolved.numberIndexInfo = numberIndexInfo;
|
|
47250
|
+
// This can loop back to getPropertyOfType() which would crash if `callSignatures` & `constructSignatures` are not initialized.
|
|
47251
|
+
if (members !== emptySymbols)
|
|
47252
|
+
resolved.properties = getNamedMembers(members);
|
|
47253
|
+
return resolved;
|
|
47248
47254
|
}
|
|
47249
47255
|
function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47250
47256
|
return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
|
|
@@ -55871,7 +55877,7 @@ var ts;
|
|
|
55871
55877
|
}
|
|
55872
55878
|
return true;
|
|
55873
55879
|
}
|
|
55874
|
-
function removeRedundantLiteralTypes(types, includes) {
|
|
55880
|
+
function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
|
|
55875
55881
|
var i = types.length;
|
|
55876
55882
|
while (i > 0) {
|
|
55877
55883
|
i--;
|
|
@@ -55881,7 +55887,7 @@ var ts;
|
|
|
55881
55887
|
flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
|
|
55882
55888
|
flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
|
|
55883
55889
|
flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
|
|
55884
|
-
flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55890
|
+
reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55885
55891
|
isFreshLiteralType(t) && containsType(types, t.regularType);
|
|
55886
55892
|
if (remove) {
|
|
55887
55893
|
ts.orderedRemoveItemAt(types, i);
|
|
@@ -55913,7 +55919,7 @@ var ts;
|
|
|
55913
55919
|
if (t.flags & 1048576 /* Union */) {
|
|
55914
55920
|
var origin = t.origin;
|
|
55915
55921
|
if (t.aliasSymbol || origin && !(origin.flags & 1048576 /* Union */)) {
|
|
55916
|
-
|
|
55922
|
+
ts.pushIfUnique(namedUnions, t);
|
|
55917
55923
|
}
|
|
55918
55924
|
else if (origin && origin.flags & 1048576 /* Union */) {
|
|
55919
55925
|
addNamedUnions(namedUnions, origin.types);
|
|
@@ -55949,7 +55955,7 @@ var ts;
|
|
|
55949
55955
|
}
|
|
55950
55956
|
if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
|
|
55951
55957
|
if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
55952
|
-
removeRedundantLiteralTypes(typeSet, includes);
|
|
55958
|
+
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
|
|
55953
55959
|
}
|
|
55954
55960
|
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
|
|
55955
55961
|
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
|
|
@@ -63970,7 +63976,16 @@ var ts;
|
|
|
63970
63976
|
var type = getTypeOfDottedName(node.expression, diagnostic);
|
|
63971
63977
|
if (type) {
|
|
63972
63978
|
var name = node.name;
|
|
63973
|
-
var prop =
|
|
63979
|
+
var prop = void 0;
|
|
63980
|
+
if (ts.isPrivateIdentifier(name)) {
|
|
63981
|
+
if (!type.symbol) {
|
|
63982
|
+
return undefined;
|
|
63983
|
+
}
|
|
63984
|
+
prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
|
|
63985
|
+
}
|
|
63986
|
+
else {
|
|
63987
|
+
prop = getPropertyOfType(type, name.escapedText);
|
|
63988
|
+
}
|
|
63974
63989
|
return prop && getExplicitTypeOfSymbol(prop, diagnostic);
|
|
63975
63990
|
}
|
|
63976
63991
|
return undefined;
|
|
@@ -75387,7 +75402,9 @@ var ts;
|
|
|
75387
75402
|
: ts.isPropertyAccessExpression(location) ? location.name
|
|
75388
75403
|
: ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
|
|
75389
75404
|
: undefined;
|
|
75390
|
-
|
|
75405
|
+
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
|
|
75406
|
+
&& ts.isAssertionExpression(ts.skipParentheses(location.expression));
|
|
75407
|
+
if (!testedNode || isPropertyExpressionCast) {
|
|
75391
75408
|
return;
|
|
75392
75409
|
}
|
|
75393
75410
|
var possiblyFalsy = getFalsyFlags(type);
|
|
@@ -77537,6 +77554,7 @@ var ts;
|
|
|
77537
77554
|
return true;
|
|
77538
77555
|
}
|
|
77539
77556
|
function checkAliasSymbol(node) {
|
|
77557
|
+
var _a;
|
|
77540
77558
|
var symbol = getSymbolOfNode(node);
|
|
77541
77559
|
var target = resolveAlias(symbol);
|
|
77542
77560
|
if (target !== unknownSymbol) {
|
|
@@ -77564,7 +77582,7 @@ var ts;
|
|
|
77564
77582
|
&& !(node.flags & 8388608 /* Ambient */)) {
|
|
77565
77583
|
error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
|
|
77566
77584
|
}
|
|
77567
|
-
if (ts.isImportSpecifier(node) &&
|
|
77585
|
+
if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {
|
|
77568
77586
|
addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
|
|
77569
77587
|
}
|
|
77570
77588
|
}
|
|
@@ -111669,10 +111687,11 @@ var ts;
|
|
|
111669
111687
|
var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;
|
|
111670
111688
|
var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);
|
|
111671
111689
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
111690
|
+
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
111672
111691
|
if (!preferSymlinks) {
|
|
111673
111692
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
111674
111693
|
// so we only need to remove them from the realpath filenames.
|
|
111675
|
-
var result_15 = ts.forEach(targets, function (p) { return !ts.containsIgnoredPath(p) && cb(p, referenceRedirect === p); });
|
|
111694
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
111676
111695
|
if (result_15)
|
|
111677
111696
|
return result_15;
|
|
111678
111697
|
}
|
|
@@ -111698,13 +111717,14 @@ var ts;
|
|
|
111698
111717
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
111699
111718
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
111700
111719
|
var result_16 = cb(option, target === referenceRedirect);
|
|
111720
|
+
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
111701
111721
|
if (result_16)
|
|
111702
111722
|
return result_16;
|
|
111703
111723
|
}
|
|
111704
111724
|
});
|
|
111705
111725
|
});
|
|
111706
111726
|
return result || (preferSymlinks
|
|
111707
|
-
? ts.forEach(targets, function (p) { return ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111727
|
+
? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111708
111728
|
: undefined);
|
|
111709
111729
|
}
|
|
111710
111730
|
moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;
|
|
@@ -140154,7 +140174,7 @@ var ts;
|
|
|
140154
140174
|
}
|
|
140155
140175
|
function addFunctionDeclaration(changes, context, info) {
|
|
140156
140176
|
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
140157
|
-
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, info.token, info.modifierFlags, info.parentDeclaration);
|
|
140177
|
+
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, ts.idText(info.token), info.modifierFlags, info.parentDeclaration);
|
|
140158
140178
|
changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration);
|
|
140159
140179
|
}
|
|
140160
140180
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
@@ -148970,7 +148990,7 @@ var ts;
|
|
|
148970
148990
|
};
|
|
148971
148991
|
SignatureObject.prototype.getJsDocTags = function () {
|
|
148972
148992
|
if (this.jsDocTags === undefined) {
|
|
148973
|
-
this.jsDocTags = this.declaration ?
|
|
148993
|
+
this.jsDocTags = this.declaration ? getJsDocTagsOfSignature(this.declaration, this.checker) : [];
|
|
148974
148994
|
}
|
|
148975
148995
|
return this.jsDocTags;
|
|
148976
148996
|
};
|
|
@@ -148984,15 +149004,13 @@ var ts;
|
|
|
148984
149004
|
function hasJSDocInheritDocTag(node) {
|
|
148985
149005
|
return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === "inheritDoc"; });
|
|
148986
149006
|
}
|
|
148987
|
-
function
|
|
148988
|
-
var tags = ts.JsDoc.getJsDocTagsFromDeclarations(
|
|
148989
|
-
if (tags.length === 0 ||
|
|
148990
|
-
|
|
148991
|
-
|
|
148992
|
-
|
|
148993
|
-
|
|
148994
|
-
}
|
|
148995
|
-
});
|
|
149007
|
+
function getJsDocTagsOfSignature(declaration, checker) {
|
|
149008
|
+
var tags = ts.JsDoc.getJsDocTagsFromDeclarations([declaration]);
|
|
149009
|
+
if (tags.length === 0 || hasJSDocInheritDocTag(declaration)) {
|
|
149010
|
+
var inheritedTags = findBaseOfDeclaration(checker, declaration, function (symbol) { var _a; return ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) === 1 ? symbol.getJsDocTags() : undefined; });
|
|
149011
|
+
if (inheritedTags) {
|
|
149012
|
+
tags = __spreadArray(__spreadArray([], inheritedTags), tags);
|
|
149013
|
+
}
|
|
148996
149014
|
}
|
|
148997
149015
|
return tags;
|
|
148998
149016
|
}
|
|
@@ -290,7 +290,7 @@ var ts;
|
|
|
290
290
|
// The following is baselined as a literal template type without intervention
|
|
291
291
|
/** The version of the TypeScript compiler release */
|
|
292
292
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
293
|
-
ts.version =
|
|
293
|
+
ts.version = "4.2.4";
|
|
294
294
|
/* @internal */
|
|
295
295
|
var Comparison;
|
|
296
296
|
(function (Comparison) {
|
|
@@ -7199,13 +7199,13 @@ var ts;
|
|
|
7199
7199
|
}
|
|
7200
7200
|
var activeSession;
|
|
7201
7201
|
var profilePath = "./profile.cpuprofile";
|
|
7202
|
-
var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
|
|
7203
7202
|
var Buffer = require("buffer").Buffer;
|
|
7204
7203
|
var nodeVersion = getNodeMajorVersion();
|
|
7205
7204
|
var isNode4OrLater = nodeVersion >= 4;
|
|
7206
7205
|
var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
7207
7206
|
var platform = _os.platform();
|
|
7208
7207
|
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
7208
|
+
var realpathSync = useCaseSensitiveFileNames ? ((_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync) : _fs.realpathSync;
|
|
7209
7209
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7210
7210
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7211
7211
|
var _c = createSystemWatchFunctions({
|
|
@@ -47177,7 +47177,9 @@ var ts;
|
|
|
47177
47177
|
var result = new Type(checker, flags);
|
|
47178
47178
|
typeCount++;
|
|
47179
47179
|
result.id = typeCount;
|
|
47180
|
-
|
|
47180
|
+
if (ts.tracing) {
|
|
47181
|
+
typeCatalog.push(result);
|
|
47182
|
+
}
|
|
47181
47183
|
return result;
|
|
47182
47184
|
}
|
|
47183
47185
|
function createOriginType(flags) {
|
|
@@ -47238,13 +47240,17 @@ var ts;
|
|
|
47238
47240
|
return result || ts.emptyArray;
|
|
47239
47241
|
}
|
|
47240
47242
|
function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47241
|
-
|
|
47242
|
-
|
|
47243
|
-
|
|
47244
|
-
|
|
47245
|
-
|
|
47246
|
-
|
|
47247
|
-
|
|
47243
|
+
var resolved = type;
|
|
47244
|
+
resolved.members = members;
|
|
47245
|
+
resolved.properties = ts.emptyArray;
|
|
47246
|
+
resolved.callSignatures = callSignatures;
|
|
47247
|
+
resolved.constructSignatures = constructSignatures;
|
|
47248
|
+
resolved.stringIndexInfo = stringIndexInfo;
|
|
47249
|
+
resolved.numberIndexInfo = numberIndexInfo;
|
|
47250
|
+
// This can loop back to getPropertyOfType() which would crash if `callSignatures` & `constructSignatures` are not initialized.
|
|
47251
|
+
if (members !== emptySymbols)
|
|
47252
|
+
resolved.properties = getNamedMembers(members);
|
|
47253
|
+
return resolved;
|
|
47248
47254
|
}
|
|
47249
47255
|
function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47250
47256
|
return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
|
|
@@ -55871,7 +55877,7 @@ var ts;
|
|
|
55871
55877
|
}
|
|
55872
55878
|
return true;
|
|
55873
55879
|
}
|
|
55874
|
-
function removeRedundantLiteralTypes(types, includes) {
|
|
55880
|
+
function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
|
|
55875
55881
|
var i = types.length;
|
|
55876
55882
|
while (i > 0) {
|
|
55877
55883
|
i--;
|
|
@@ -55881,7 +55887,7 @@ var ts;
|
|
|
55881
55887
|
flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
|
|
55882
55888
|
flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
|
|
55883
55889
|
flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
|
|
55884
|
-
flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55890
|
+
reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55885
55891
|
isFreshLiteralType(t) && containsType(types, t.regularType);
|
|
55886
55892
|
if (remove) {
|
|
55887
55893
|
ts.orderedRemoveItemAt(types, i);
|
|
@@ -55913,7 +55919,7 @@ var ts;
|
|
|
55913
55919
|
if (t.flags & 1048576 /* Union */) {
|
|
55914
55920
|
var origin = t.origin;
|
|
55915
55921
|
if (t.aliasSymbol || origin && !(origin.flags & 1048576 /* Union */)) {
|
|
55916
|
-
|
|
55922
|
+
ts.pushIfUnique(namedUnions, t);
|
|
55917
55923
|
}
|
|
55918
55924
|
else if (origin && origin.flags & 1048576 /* Union */) {
|
|
55919
55925
|
addNamedUnions(namedUnions, origin.types);
|
|
@@ -55949,7 +55955,7 @@ var ts;
|
|
|
55949
55955
|
}
|
|
55950
55956
|
if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
|
|
55951
55957
|
if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
55952
|
-
removeRedundantLiteralTypes(typeSet, includes);
|
|
55958
|
+
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
|
|
55953
55959
|
}
|
|
55954
55960
|
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
|
|
55955
55961
|
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
|
|
@@ -63970,7 +63976,16 @@ var ts;
|
|
|
63970
63976
|
var type = getTypeOfDottedName(node.expression, diagnostic);
|
|
63971
63977
|
if (type) {
|
|
63972
63978
|
var name = node.name;
|
|
63973
|
-
var prop =
|
|
63979
|
+
var prop = void 0;
|
|
63980
|
+
if (ts.isPrivateIdentifier(name)) {
|
|
63981
|
+
if (!type.symbol) {
|
|
63982
|
+
return undefined;
|
|
63983
|
+
}
|
|
63984
|
+
prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
|
|
63985
|
+
}
|
|
63986
|
+
else {
|
|
63987
|
+
prop = getPropertyOfType(type, name.escapedText);
|
|
63988
|
+
}
|
|
63974
63989
|
return prop && getExplicitTypeOfSymbol(prop, diagnostic);
|
|
63975
63990
|
}
|
|
63976
63991
|
return undefined;
|
|
@@ -75387,7 +75402,9 @@ var ts;
|
|
|
75387
75402
|
: ts.isPropertyAccessExpression(location) ? location.name
|
|
75388
75403
|
: ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
|
|
75389
75404
|
: undefined;
|
|
75390
|
-
|
|
75405
|
+
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
|
|
75406
|
+
&& ts.isAssertionExpression(ts.skipParentheses(location.expression));
|
|
75407
|
+
if (!testedNode || isPropertyExpressionCast) {
|
|
75391
75408
|
return;
|
|
75392
75409
|
}
|
|
75393
75410
|
var possiblyFalsy = getFalsyFlags(type);
|
|
@@ -77537,6 +77554,7 @@ var ts;
|
|
|
77537
77554
|
return true;
|
|
77538
77555
|
}
|
|
77539
77556
|
function checkAliasSymbol(node) {
|
|
77557
|
+
var _a;
|
|
77540
77558
|
var symbol = getSymbolOfNode(node);
|
|
77541
77559
|
var target = resolveAlias(symbol);
|
|
77542
77560
|
if (target !== unknownSymbol) {
|
|
@@ -77564,7 +77582,7 @@ var ts;
|
|
|
77564
77582
|
&& !(node.flags & 8388608 /* Ambient */)) {
|
|
77565
77583
|
error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
|
|
77566
77584
|
}
|
|
77567
|
-
if (ts.isImportSpecifier(node) &&
|
|
77585
|
+
if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {
|
|
77568
77586
|
addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
|
|
77569
77587
|
}
|
|
77570
77588
|
}
|
|
@@ -111669,10 +111687,11 @@ var ts;
|
|
|
111669
111687
|
var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;
|
|
111670
111688
|
var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);
|
|
111671
111689
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
111690
|
+
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
111672
111691
|
if (!preferSymlinks) {
|
|
111673
111692
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
111674
111693
|
// so we only need to remove them from the realpath filenames.
|
|
111675
|
-
var result_15 = ts.forEach(targets, function (p) { return !ts.containsIgnoredPath(p) && cb(p, referenceRedirect === p); });
|
|
111694
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
111676
111695
|
if (result_15)
|
|
111677
111696
|
return result_15;
|
|
111678
111697
|
}
|
|
@@ -111698,13 +111717,14 @@ var ts;
|
|
|
111698
111717
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
111699
111718
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
111700
111719
|
var result_16 = cb(option, target === referenceRedirect);
|
|
111720
|
+
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
111701
111721
|
if (result_16)
|
|
111702
111722
|
return result_16;
|
|
111703
111723
|
}
|
|
111704
111724
|
});
|
|
111705
111725
|
});
|
|
111706
111726
|
return result || (preferSymlinks
|
|
111707
|
-
? ts.forEach(targets, function (p) { return ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111727
|
+
? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111708
111728
|
: undefined);
|
|
111709
111729
|
}
|
|
111710
111730
|
moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;
|
|
@@ -140154,7 +140174,7 @@ var ts;
|
|
|
140154
140174
|
}
|
|
140155
140175
|
function addFunctionDeclaration(changes, context, info) {
|
|
140156
140176
|
var importAdder = codefix.createImportAdder(context.sourceFile, context.program, context.preferences, context.host);
|
|
140157
|
-
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, info.token, info.modifierFlags, info.parentDeclaration);
|
|
140177
|
+
var functionDeclaration = codefix.createSignatureDeclarationFromCallExpression(251 /* FunctionDeclaration */, context, importAdder, info.call, ts.idText(info.token), info.modifierFlags, info.parentDeclaration);
|
|
140158
140178
|
changes.insertNodeAtEndOfScope(info.sourceFile, info.parentDeclaration, functionDeclaration);
|
|
140159
140179
|
}
|
|
140160
140180
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
@@ -148970,7 +148990,7 @@ var ts;
|
|
|
148970
148990
|
};
|
|
148971
148991
|
SignatureObject.prototype.getJsDocTags = function () {
|
|
148972
148992
|
if (this.jsDocTags === undefined) {
|
|
148973
|
-
this.jsDocTags = this.declaration ?
|
|
148993
|
+
this.jsDocTags = this.declaration ? getJsDocTagsOfSignature(this.declaration, this.checker) : [];
|
|
148974
148994
|
}
|
|
148975
148995
|
return this.jsDocTags;
|
|
148976
148996
|
};
|
|
@@ -148984,15 +149004,13 @@ var ts;
|
|
|
148984
149004
|
function hasJSDocInheritDocTag(node) {
|
|
148985
149005
|
return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === "inheritDoc"; });
|
|
148986
149006
|
}
|
|
148987
|
-
function
|
|
148988
|
-
var tags = ts.JsDoc.getJsDocTagsFromDeclarations(
|
|
148989
|
-
if (tags.length === 0 ||
|
|
148990
|
-
|
|
148991
|
-
|
|
148992
|
-
|
|
148993
|
-
|
|
148994
|
-
}
|
|
148995
|
-
});
|
|
149007
|
+
function getJsDocTagsOfSignature(declaration, checker) {
|
|
149008
|
+
var tags = ts.JsDoc.getJsDocTagsFromDeclarations([declaration]);
|
|
149009
|
+
if (tags.length === 0 || hasJSDocInheritDocTag(declaration)) {
|
|
149010
|
+
var inheritedTags = findBaseOfDeclaration(checker, declaration, function (symbol) { var _a; return ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) === 1 ? symbol.getJsDocTags() : undefined; });
|
|
149011
|
+
if (inheritedTags) {
|
|
149012
|
+
tags = __spreadArray(__spreadArray([], inheritedTags), tags);
|
|
149013
|
+
}
|
|
148996
149014
|
}
|
|
148997
149015
|
return tags;
|
|
148998
149016
|
}
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -85,7 +85,7 @@ var ts;
|
|
|
85
85
|
// The following is baselined as a literal template type without intervention
|
|
86
86
|
/** The version of the TypeScript compiler release */
|
|
87
87
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
88
|
-
ts.version =
|
|
88
|
+
ts.version = "4.2.4";
|
|
89
89
|
/* @internal */
|
|
90
90
|
var Comparison;
|
|
91
91
|
(function (Comparison) {
|
|
@@ -6994,13 +6994,13 @@ var ts;
|
|
|
6994
6994
|
}
|
|
6995
6995
|
var activeSession;
|
|
6996
6996
|
var profilePath = "./profile.cpuprofile";
|
|
6997
|
-
var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
|
|
6998
6997
|
var Buffer = require("buffer").Buffer;
|
|
6999
6998
|
var nodeVersion = getNodeMajorVersion();
|
|
7000
6999
|
var isNode4OrLater = nodeVersion >= 4;
|
|
7001
7000
|
var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
|
|
7002
7001
|
var platform = _os.platform();
|
|
7003
7002
|
var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
|
7003
|
+
var realpathSync = useCaseSensitiveFileNames ? ((_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync) : _fs.realpathSync;
|
|
7004
7004
|
var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
|
7005
7005
|
var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
|
|
7006
7006
|
var _c = createSystemWatchFunctions({
|
|
@@ -46972,7 +46972,9 @@ var ts;
|
|
|
46972
46972
|
var result = new Type(checker, flags);
|
|
46973
46973
|
typeCount++;
|
|
46974
46974
|
result.id = typeCount;
|
|
46975
|
-
|
|
46975
|
+
if (ts.tracing) {
|
|
46976
|
+
typeCatalog.push(result);
|
|
46977
|
+
}
|
|
46976
46978
|
return result;
|
|
46977
46979
|
}
|
|
46978
46980
|
function createOriginType(flags) {
|
|
@@ -47033,13 +47035,17 @@ var ts;
|
|
|
47033
47035
|
return result || ts.emptyArray;
|
|
47034
47036
|
}
|
|
47035
47037
|
function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47036
|
-
|
|
47037
|
-
|
|
47038
|
-
|
|
47039
|
-
|
|
47040
|
-
|
|
47041
|
-
|
|
47042
|
-
|
|
47038
|
+
var resolved = type;
|
|
47039
|
+
resolved.members = members;
|
|
47040
|
+
resolved.properties = ts.emptyArray;
|
|
47041
|
+
resolved.callSignatures = callSignatures;
|
|
47042
|
+
resolved.constructSignatures = constructSignatures;
|
|
47043
|
+
resolved.stringIndexInfo = stringIndexInfo;
|
|
47044
|
+
resolved.numberIndexInfo = numberIndexInfo;
|
|
47045
|
+
// This can loop back to getPropertyOfType() which would crash if `callSignatures` & `constructSignatures` are not initialized.
|
|
47046
|
+
if (members !== emptySymbols)
|
|
47047
|
+
resolved.properties = getNamedMembers(members);
|
|
47048
|
+
return resolved;
|
|
47043
47049
|
}
|
|
47044
47050
|
function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
|
|
47045
47051
|
return setStructuredTypeMembers(createObjectType(16 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
|
|
@@ -55666,7 +55672,7 @@ var ts;
|
|
|
55666
55672
|
}
|
|
55667
55673
|
return true;
|
|
55668
55674
|
}
|
|
55669
|
-
function removeRedundantLiteralTypes(types, includes) {
|
|
55675
|
+
function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
|
|
55670
55676
|
var i = types.length;
|
|
55671
55677
|
while (i > 0) {
|
|
55672
55678
|
i--;
|
|
@@ -55676,7 +55682,7 @@ var ts;
|
|
|
55676
55682
|
flags & 256 /* NumberLiteral */ && includes & 8 /* Number */ ||
|
|
55677
55683
|
flags & 2048 /* BigIntLiteral */ && includes & 64 /* BigInt */ ||
|
|
55678
55684
|
flags & 8192 /* UniqueESSymbol */ && includes & 4096 /* ESSymbol */ ||
|
|
55679
|
-
flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55685
|
+
reduceVoidUndefined && flags & 32768 /* Undefined */ && includes & 16384 /* Void */ ||
|
|
55680
55686
|
isFreshLiteralType(t) && containsType(types, t.regularType);
|
|
55681
55687
|
if (remove) {
|
|
55682
55688
|
ts.orderedRemoveItemAt(types, i);
|
|
@@ -55708,7 +55714,7 @@ var ts;
|
|
|
55708
55714
|
if (t.flags & 1048576 /* Union */) {
|
|
55709
55715
|
var origin = t.origin;
|
|
55710
55716
|
if (t.aliasSymbol || origin && !(origin.flags & 1048576 /* Union */)) {
|
|
55711
|
-
|
|
55717
|
+
ts.pushIfUnique(namedUnions, t);
|
|
55712
55718
|
}
|
|
55713
55719
|
else if (origin && origin.flags & 1048576 /* Union */) {
|
|
55714
55720
|
addNamedUnions(namedUnions, origin.types);
|
|
@@ -55744,7 +55750,7 @@ var ts;
|
|
|
55744
55750
|
}
|
|
55745
55751
|
if (unionReduction & (1 /* Literal */ | 2 /* Subtype */)) {
|
|
55746
55752
|
if (includes & (2944 /* Literal */ | 8192 /* UniqueESSymbol */) || includes & 16384 /* Void */ && includes & 32768 /* Undefined */) {
|
|
55747
|
-
removeRedundantLiteralTypes(typeSet, includes);
|
|
55753
|
+
removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2 /* Subtype */));
|
|
55748
55754
|
}
|
|
55749
55755
|
if (includes & 128 /* StringLiteral */ && includes & 134217728 /* TemplateLiteral */) {
|
|
55750
55756
|
removeStringLiteralsMatchedByTemplateLiterals(typeSet);
|
|
@@ -63765,7 +63771,16 @@ var ts;
|
|
|
63765
63771
|
var type = getTypeOfDottedName(node.expression, diagnostic);
|
|
63766
63772
|
if (type) {
|
|
63767
63773
|
var name = node.name;
|
|
63768
|
-
var prop =
|
|
63774
|
+
var prop = void 0;
|
|
63775
|
+
if (ts.isPrivateIdentifier(name)) {
|
|
63776
|
+
if (!type.symbol) {
|
|
63777
|
+
return undefined;
|
|
63778
|
+
}
|
|
63779
|
+
prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
|
|
63780
|
+
}
|
|
63781
|
+
else {
|
|
63782
|
+
prop = getPropertyOfType(type, name.escapedText);
|
|
63783
|
+
}
|
|
63769
63784
|
return prop && getExplicitTypeOfSymbol(prop, diagnostic);
|
|
63770
63785
|
}
|
|
63771
63786
|
return undefined;
|
|
@@ -75182,7 +75197,9 @@ var ts;
|
|
|
75182
75197
|
: ts.isPropertyAccessExpression(location) ? location.name
|
|
75183
75198
|
: ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
|
|
75184
75199
|
: undefined;
|
|
75185
|
-
|
|
75200
|
+
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
|
|
75201
|
+
&& ts.isAssertionExpression(ts.skipParentheses(location.expression));
|
|
75202
|
+
if (!testedNode || isPropertyExpressionCast) {
|
|
75186
75203
|
return;
|
|
75187
75204
|
}
|
|
75188
75205
|
var possiblyFalsy = getFalsyFlags(type);
|
|
@@ -77332,6 +77349,7 @@ var ts;
|
|
|
77332
77349
|
return true;
|
|
77333
77350
|
}
|
|
77334
77351
|
function checkAliasSymbol(node) {
|
|
77352
|
+
var _a;
|
|
77335
77353
|
var symbol = getSymbolOfNode(node);
|
|
77336
77354
|
var target = resolveAlias(symbol);
|
|
77337
77355
|
if (target !== unknownSymbol) {
|
|
@@ -77359,7 +77377,7 @@ var ts;
|
|
|
77359
77377
|
&& !(node.flags & 8388608 /* Ambient */)) {
|
|
77360
77378
|
error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
|
|
77361
77379
|
}
|
|
77362
|
-
if (ts.isImportSpecifier(node) &&
|
|
77380
|
+
if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {
|
|
77363
77381
|
addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
|
|
77364
77382
|
}
|
|
77365
77383
|
}
|
|
@@ -111464,10 +111482,11 @@ var ts;
|
|
|
111464
111482
|
var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;
|
|
111465
111483
|
var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);
|
|
111466
111484
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
111485
|
+
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
111467
111486
|
if (!preferSymlinks) {
|
|
111468
111487
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
111469
111488
|
// so we only need to remove them from the realpath filenames.
|
|
111470
|
-
var result_15 = ts.forEach(targets, function (p) { return !ts.containsIgnoredPath(p) && cb(p, referenceRedirect === p); });
|
|
111489
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
111471
111490
|
if (result_15)
|
|
111472
111491
|
return result_15;
|
|
111473
111492
|
}
|
|
@@ -111493,13 +111512,14 @@ var ts;
|
|
|
111493
111512
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
111494
111513
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
111495
111514
|
var result_16 = cb(option, target === referenceRedirect);
|
|
111515
|
+
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
111496
111516
|
if (result_16)
|
|
111497
111517
|
return result_16;
|
|
111498
111518
|
}
|
|
111499
111519
|
});
|
|
111500
111520
|
});
|
|
111501
111521
|
return result || (preferSymlinks
|
|
111502
|
-
? ts.forEach(targets, function (p) { return ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111522
|
+
? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
|
|
111503
111523
|
: undefined);
|
|
111504
111524
|
}
|
|
111505
111525
|
moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;
|
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": "4.2.
|
|
5
|
+
"version": "4.2.4",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -128,4 +128,4 @@
|
|
|
128
128
|
"inspector": false
|
|
129
129
|
},
|
|
130
130
|
"dependencies": {}
|
|
131
|
-
}
|
|
131
|
+
}
|