typescript 4.1.2 → 4.1.6
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.es5.d.ts +1 -1
- package/lib/protocol.d.ts +5 -1
- package/lib/tsc.js +28 -15
- package/lib/tsserver.js +44 -16
- package/lib/tsserverlibrary.d.ts +5 -1
- package/lib/tsserverlibrary.js +43 -16
- package/lib/typescript.js +34 -15
- package/lib/typescriptServices.js +34 -15
- package/lib/typingsInstaller.js +34 -15
- package/package.json +1 -1
package/lib/lib.es5.d.ts
CHANGED
|
@@ -1396,7 +1396,7 @@ interface ArrayConstructor {
|
|
|
1396
1396
|
(arrayLength?: number): any[];
|
|
1397
1397
|
<T>(arrayLength: number): T[];
|
|
1398
1398
|
<T>(...items: T[]): T[];
|
|
1399
|
-
isArray
|
|
1399
|
+
isArray(arg: any): arg is any[];
|
|
1400
1400
|
readonly prototype: any[];
|
|
1401
1401
|
}
|
|
1402
1402
|
|
package/lib/protocol.d.ts
CHANGED
|
@@ -2569,7 +2569,9 @@ declare namespace ts.server.protocol {
|
|
|
2569
2569
|
None = "None",
|
|
2570
2570
|
Preserve = "Preserve",
|
|
2571
2571
|
ReactNative = "ReactNative",
|
|
2572
|
-
React = "React"
|
|
2572
|
+
React = "React",
|
|
2573
|
+
ReactJSX = "ReactJSX",
|
|
2574
|
+
ReactJSXDev = "ReactJSXDev"
|
|
2573
2575
|
}
|
|
2574
2576
|
const enum ModuleKind {
|
|
2575
2577
|
None = "None",
|
|
@@ -2579,6 +2581,7 @@ declare namespace ts.server.protocol {
|
|
|
2579
2581
|
System = "System",
|
|
2580
2582
|
ES6 = "ES6",
|
|
2581
2583
|
ES2015 = "ES2015",
|
|
2584
|
+
ES2020 = "ES2020",
|
|
2582
2585
|
ESNext = "ESNext"
|
|
2583
2586
|
}
|
|
2584
2587
|
const enum ModuleResolutionKind {
|
|
@@ -2599,6 +2602,7 @@ declare namespace ts.server.protocol {
|
|
|
2599
2602
|
ES2018 = "ES2018",
|
|
2600
2603
|
ES2019 = "ES2019",
|
|
2601
2604
|
ES2020 = "ES2020",
|
|
2605
|
+
JSON = "JSON",
|
|
2602
2606
|
ESNext = "ESNext"
|
|
2603
2607
|
}
|
|
2604
2608
|
}
|
package/lib/tsc.js
CHANGED
|
@@ -67,7 +67,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
67
67
|
var ts;
|
|
68
68
|
(function (ts) {
|
|
69
69
|
ts.versionMajorMinor = "4.1";
|
|
70
|
-
ts.version = "4.1.
|
|
70
|
+
ts.version = "4.1.6";
|
|
71
71
|
var NativeCollections;
|
|
72
72
|
(function (NativeCollections) {
|
|
73
73
|
function tryGetNativeMap() {
|
|
@@ -4448,8 +4448,8 @@ var ts;
|
|
|
4448
4448
|
},
|
|
4449
4449
|
getFileSize: function (path) {
|
|
4450
4450
|
try {
|
|
4451
|
-
var stat =
|
|
4452
|
-
if (stat.isFile()) {
|
|
4451
|
+
var stat = statSync(path);
|
|
4452
|
+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
|
|
4453
4453
|
return stat.size;
|
|
4454
4454
|
}
|
|
4455
4455
|
}
|
|
@@ -4494,6 +4494,9 @@ var ts;
|
|
|
4494
4494
|
}
|
|
4495
4495
|
};
|
|
4496
4496
|
return nodeSystem;
|
|
4497
|
+
function statSync(path) {
|
|
4498
|
+
return _fs.statSync(path, { throwIfNoEntry: false });
|
|
4499
|
+
}
|
|
4497
4500
|
function enableCPUProfiler(path, cb) {
|
|
4498
4501
|
if (activeSession) {
|
|
4499
4502
|
cb();
|
|
@@ -4539,19 +4542,20 @@ var ts;
|
|
|
4539
4542
|
if (activeSession && activeSession !== "stopping") {
|
|
4540
4543
|
var s_1 = activeSession;
|
|
4541
4544
|
activeSession.post("Profiler.stop", function (err, _a) {
|
|
4545
|
+
var _b;
|
|
4542
4546
|
var profile = _a.profile;
|
|
4543
4547
|
if (!err) {
|
|
4544
4548
|
try {
|
|
4545
|
-
if (
|
|
4549
|
+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
4546
4550
|
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
|
|
4547
4551
|
}
|
|
4548
4552
|
}
|
|
4549
|
-
catch (
|
|
4553
|
+
catch (_c) {
|
|
4550
4554
|
}
|
|
4551
4555
|
try {
|
|
4552
4556
|
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
|
|
4553
4557
|
}
|
|
4554
|
-
catch (
|
|
4558
|
+
catch (_d) {
|
|
4555
4559
|
}
|
|
4556
4560
|
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
|
|
4557
4561
|
}
|
|
@@ -4740,7 +4744,10 @@ var ts;
|
|
|
4740
4744
|
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
|
|
4741
4745
|
var name = ts.combinePaths(path, entry);
|
|
4742
4746
|
try {
|
|
4743
|
-
stat =
|
|
4747
|
+
stat = statSync(name);
|
|
4748
|
+
if (!stat) {
|
|
4749
|
+
continue;
|
|
4750
|
+
}
|
|
4744
4751
|
}
|
|
4745
4752
|
catch (e) {
|
|
4746
4753
|
continue;
|
|
@@ -4771,7 +4778,10 @@ var ts;
|
|
|
4771
4778
|
var originalStackTraceLimit = Error.stackTraceLimit;
|
|
4772
4779
|
Error.stackTraceLimit = 0;
|
|
4773
4780
|
try {
|
|
4774
|
-
var stat =
|
|
4781
|
+
var stat = statSync(path);
|
|
4782
|
+
if (!stat) {
|
|
4783
|
+
return false;
|
|
4784
|
+
}
|
|
4775
4785
|
switch (entryKind) {
|
|
4776
4786
|
case 0: return stat.isFile();
|
|
4777
4787
|
case 1: return stat.isDirectory();
|
|
@@ -4803,8 +4813,9 @@ var ts;
|
|
|
4803
4813
|
}
|
|
4804
4814
|
}
|
|
4805
4815
|
function getModifiedTime(path) {
|
|
4816
|
+
var _a;
|
|
4806
4817
|
try {
|
|
4807
|
-
return
|
|
4818
|
+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
|
|
4808
4819
|
}
|
|
4809
4820
|
catch (e) {
|
|
4810
4821
|
return undefined;
|
|
@@ -37353,7 +37364,7 @@ var ts;
|
|
|
37353
37364
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
37354
37365
|
var name = node.propertyName || node.name;
|
|
37355
37366
|
if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) {
|
|
37356
|
-
return getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText);
|
|
37367
|
+
return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias);
|
|
37357
37368
|
}
|
|
37358
37369
|
markSymbolOfAliasDeclarationIfTypeOnly(node, undefined, resolved, false);
|
|
37359
37370
|
return resolved;
|
|
@@ -52612,6 +52623,7 @@ var ts;
|
|
|
52612
52623
|
return errorType;
|
|
52613
52624
|
}
|
|
52614
52625
|
flowDepth++;
|
|
52626
|
+
var sharedFlow;
|
|
52615
52627
|
while (true) {
|
|
52616
52628
|
var flags = flow.flags;
|
|
52617
52629
|
if (flags & 4096) {
|
|
@@ -52621,6 +52633,7 @@ var ts;
|
|
|
52621
52633
|
return sharedFlowTypes[i];
|
|
52622
52634
|
}
|
|
52623
52635
|
}
|
|
52636
|
+
sharedFlow = flow;
|
|
52624
52637
|
}
|
|
52625
52638
|
var type = void 0;
|
|
52626
52639
|
if (flags & 16) {
|
|
@@ -52680,8 +52693,8 @@ var ts;
|
|
|
52680
52693
|
else {
|
|
52681
52694
|
type = convertAutoToAny(declaredType);
|
|
52682
52695
|
}
|
|
52683
|
-
if (
|
|
52684
|
-
sharedFlowNodes[sharedFlowCount] =
|
|
52696
|
+
if (sharedFlow) {
|
|
52697
|
+
sharedFlowNodes[sharedFlowCount] = sharedFlow;
|
|
52685
52698
|
sharedFlowTypes[sharedFlowCount] = type;
|
|
52686
52699
|
sharedFlowCount++;
|
|
52687
52700
|
}
|
|
@@ -57019,9 +57032,9 @@ var ts;
|
|
|
57019
57032
|
var oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
57020
57033
|
var oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
57021
57034
|
var oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
57022
|
-
var
|
|
57023
|
-
var isOverload =
|
|
57024
|
-
var implDecl = isOverload ? ts.find(
|
|
57035
|
+
var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray;
|
|
57036
|
+
var isOverload = failedSignatureDeclarations.length > 1;
|
|
57037
|
+
var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
|
|
57025
57038
|
if (implDecl) {
|
|
57026
57039
|
var candidate = getSignatureFromDeclaration(implDecl);
|
|
57027
57040
|
var isSingleNonGenericCandidate_1 = !candidate.typeParameters;
|
package/lib/tsserver.js
CHANGED
|
@@ -94,7 +94,7 @@ var ts;
|
|
|
94
94
|
// If changing the text in this section, be sure to test `configurePrerelease` too.
|
|
95
95
|
ts.versionMajorMinor = "4.1";
|
|
96
96
|
/** The version of the TypeScript compiler release */
|
|
97
|
-
ts.version = "4.1.
|
|
97
|
+
ts.version = "4.1.6";
|
|
98
98
|
/* @internal */
|
|
99
99
|
var Comparison;
|
|
100
100
|
(function (Comparison) {
|
|
@@ -7022,8 +7022,8 @@ var ts;
|
|
|
7022
7022
|
},
|
|
7023
7023
|
getFileSize: function (path) {
|
|
7024
7024
|
try {
|
|
7025
|
-
var stat =
|
|
7026
|
-
if (stat.isFile()) {
|
|
7025
|
+
var stat = statSync(path);
|
|
7026
|
+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
|
|
7027
7027
|
return stat.size;
|
|
7028
7028
|
}
|
|
7029
7029
|
}
|
|
@@ -7069,6 +7069,15 @@ var ts;
|
|
|
7069
7069
|
}
|
|
7070
7070
|
};
|
|
7071
7071
|
return nodeSystem;
|
|
7072
|
+
/**
|
|
7073
|
+
* `throwIfNoEntry` was added so recently that it's not in the node types.
|
|
7074
|
+
* This helper encapsulates the mitigating usage of `any`.
|
|
7075
|
+
* See https://github.com/nodejs/node/pull/33716
|
|
7076
|
+
*/
|
|
7077
|
+
function statSync(path) {
|
|
7078
|
+
// throwIfNoEntry will be ignored by older versions of node
|
|
7079
|
+
return _fs.statSync(path, { throwIfNoEntry: false });
|
|
7080
|
+
}
|
|
7072
7081
|
/**
|
|
7073
7082
|
* Uses the builtin inspector APIs to capture a CPU profile
|
|
7074
7083
|
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
|
|
@@ -7123,20 +7132,21 @@ var ts;
|
|
|
7123
7132
|
if (activeSession && activeSession !== "stopping") {
|
|
7124
7133
|
var s_1 = activeSession;
|
|
7125
7134
|
activeSession.post("Profiler.stop", function (err, _a) {
|
|
7135
|
+
var _b;
|
|
7126
7136
|
var profile = _a.profile;
|
|
7127
7137
|
if (!err) {
|
|
7128
7138
|
try {
|
|
7129
|
-
if (
|
|
7139
|
+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
7130
7140
|
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
|
|
7131
7141
|
}
|
|
7132
7142
|
}
|
|
7133
|
-
catch (
|
|
7143
|
+
catch (_c) {
|
|
7134
7144
|
// do nothing and ignore fallible fs operation
|
|
7135
7145
|
}
|
|
7136
7146
|
try {
|
|
7137
7147
|
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
|
|
7138
7148
|
}
|
|
7139
|
-
catch (
|
|
7149
|
+
catch (_d) {
|
|
7140
7150
|
// do nothing and ignore fallible fs operation
|
|
7141
7151
|
}
|
|
7142
7152
|
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
|
|
@@ -7375,7 +7385,10 @@ var ts;
|
|
|
7375
7385
|
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
|
|
7376
7386
|
var name = ts.combinePaths(path, entry);
|
|
7377
7387
|
try {
|
|
7378
|
-
stat =
|
|
7388
|
+
stat = statSync(name);
|
|
7389
|
+
if (!stat) {
|
|
7390
|
+
continue;
|
|
7391
|
+
}
|
|
7379
7392
|
}
|
|
7380
7393
|
catch (e) {
|
|
7381
7394
|
continue;
|
|
@@ -7408,7 +7421,10 @@ var ts;
|
|
|
7408
7421
|
var originalStackTraceLimit = Error.stackTraceLimit;
|
|
7409
7422
|
Error.stackTraceLimit = 0;
|
|
7410
7423
|
try {
|
|
7411
|
-
var stat =
|
|
7424
|
+
var stat = statSync(path);
|
|
7425
|
+
if (!stat) {
|
|
7426
|
+
return false;
|
|
7427
|
+
}
|
|
7412
7428
|
switch (entryKind) {
|
|
7413
7429
|
case 0 /* File */: return stat.isFile();
|
|
7414
7430
|
case 1 /* Directory */: return stat.isDirectory();
|
|
@@ -7440,8 +7456,9 @@ var ts;
|
|
|
7440
7456
|
}
|
|
7441
7457
|
}
|
|
7442
7458
|
function getModifiedTime(path) {
|
|
7459
|
+
var _a;
|
|
7443
7460
|
try {
|
|
7444
|
-
return
|
|
7461
|
+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
|
|
7445
7462
|
}
|
|
7446
7463
|
catch (e) {
|
|
7447
7464
|
return undefined;
|
|
@@ -45694,7 +45711,7 @@ var ts;
|
|
|
45694
45711
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
45695
45712
|
var name = node.propertyName || node.name;
|
|
45696
45713
|
if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) {
|
|
45697
|
-
return getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText);
|
|
45714
|
+
return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias);
|
|
45698
45715
|
}
|
|
45699
45716
|
markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);
|
|
45700
45717
|
return resolved;
|
|
@@ -63123,6 +63140,7 @@ var ts;
|
|
|
63123
63140
|
return errorType;
|
|
63124
63141
|
}
|
|
63125
63142
|
flowDepth++;
|
|
63143
|
+
var sharedFlow;
|
|
63126
63144
|
while (true) {
|
|
63127
63145
|
var flags = flow.flags;
|
|
63128
63146
|
if (flags & 4096 /* Shared */) {
|
|
@@ -63135,6 +63153,7 @@ var ts;
|
|
|
63135
63153
|
return sharedFlowTypes[i];
|
|
63136
63154
|
}
|
|
63137
63155
|
}
|
|
63156
|
+
sharedFlow = flow;
|
|
63138
63157
|
}
|
|
63139
63158
|
var type = void 0;
|
|
63140
63159
|
if (flags & 16 /* Assignment */) {
|
|
@@ -63198,9 +63217,9 @@ var ts;
|
|
|
63198
63217
|
// simply return the non-auto declared type to reduce follow-on errors.
|
|
63199
63218
|
type = convertAutoToAny(declaredType);
|
|
63200
63219
|
}
|
|
63201
|
-
if (
|
|
63220
|
+
if (sharedFlow) {
|
|
63202
63221
|
// Record visited node and the associated type in the cache.
|
|
63203
|
-
sharedFlowNodes[sharedFlowCount] =
|
|
63222
|
+
sharedFlowNodes[sharedFlowCount] = sharedFlow;
|
|
63204
63223
|
sharedFlowTypes[sharedFlowCount] = type;
|
|
63205
63224
|
sharedFlowCount++;
|
|
63206
63225
|
}
|
|
@@ -68367,9 +68386,9 @@ var ts;
|
|
|
68367
68386
|
var oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
68368
68387
|
var oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
68369
68388
|
var oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
68370
|
-
var
|
|
68371
|
-
var isOverload =
|
|
68372
|
-
var implDecl = isOverload ? ts.find(
|
|
68389
|
+
var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray;
|
|
68390
|
+
var isOverload = failedSignatureDeclarations.length > 1;
|
|
68391
|
+
var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
|
|
68373
68392
|
if (implDecl) {
|
|
68374
68393
|
var candidate = getSignatureFromDeclaration(implDecl);
|
|
68375
68394
|
var isSingleNonGenericCandidate_1 = !candidate.typeParameters;
|
|
@@ -149981,6 +150000,8 @@ var ts;
|
|
|
149981
150000
|
JsxEmit["Preserve"] = "Preserve";
|
|
149982
150001
|
JsxEmit["ReactNative"] = "ReactNative";
|
|
149983
150002
|
JsxEmit["React"] = "React";
|
|
150003
|
+
JsxEmit["ReactJSX"] = "ReactJSX";
|
|
150004
|
+
JsxEmit["ReactJSXDev"] = "ReactJSXDev";
|
|
149984
150005
|
})(JsxEmit = protocol.JsxEmit || (protocol.JsxEmit = {}));
|
|
149985
150006
|
var ModuleKind;
|
|
149986
150007
|
(function (ModuleKind) {
|
|
@@ -149991,6 +150012,7 @@ var ts;
|
|
|
149991
150012
|
ModuleKind["System"] = "System";
|
|
149992
150013
|
ModuleKind["ES6"] = "ES6";
|
|
149993
150014
|
ModuleKind["ES2015"] = "ES2015";
|
|
150015
|
+
ModuleKind["ES2020"] = "ES2020";
|
|
149994
150016
|
ModuleKind["ESNext"] = "ESNext";
|
|
149995
150017
|
})(ModuleKind = protocol.ModuleKind || (protocol.ModuleKind = {}));
|
|
149996
150018
|
var ModuleResolutionKind;
|
|
@@ -150014,6 +150036,7 @@ var ts;
|
|
|
150014
150036
|
ScriptTarget["ES2018"] = "ES2018";
|
|
150015
150037
|
ScriptTarget["ES2019"] = "ES2019";
|
|
150016
150038
|
ScriptTarget["ES2020"] = "ES2020";
|
|
150039
|
+
ScriptTarget["JSON"] = "JSON";
|
|
150017
150040
|
ScriptTarget["ESNext"] = "ESNext";
|
|
150018
150041
|
})(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {}));
|
|
150019
150042
|
})(protocol = server.protocol || (server.protocol = {}));
|
|
@@ -151953,6 +151976,10 @@ var ts;
|
|
|
151953
151976
|
Project.prototype.enablePlugin = function (pluginConfigEntry, searchPaths, pluginConfigOverrides) {
|
|
151954
151977
|
var _this = this;
|
|
151955
151978
|
this.projectService.logger.info("Enabling plugin " + pluginConfigEntry.name + " from candidate paths: " + searchPaths.join(","));
|
|
151979
|
+
if (!pluginConfigEntry.name || ts.parsePackageName(pluginConfigEntry.name).rest) {
|
|
151980
|
+
this.projectService.logger.info("Skipped loading plugin " + (pluginConfigEntry.name || JSON.stringify(pluginConfigEntry)) + " because only package name is allowed plugin name");
|
|
151981
|
+
return;
|
|
151982
|
+
}
|
|
151956
151983
|
var log = function (message) { return _this.projectService.logger.info(message); };
|
|
151957
151984
|
var errorLogs;
|
|
151958
151985
|
var logError = function (message) { (errorLogs || (errorLogs = [])).push(message); };
|
|
@@ -157078,7 +157105,7 @@ var ts;
|
|
|
157078
157105
|
};
|
|
157079
157106
|
Session.prototype.getEncodedSemanticClassifications = function (args) {
|
|
157080
157107
|
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
|
|
157081
|
-
return project.getLanguageService().getEncodedSemanticClassifications(file, args);
|
|
157108
|
+
return project.getLanguageService().getEncodedSemanticClassifications(file, args, args.format);
|
|
157082
157109
|
};
|
|
157083
157110
|
Session.prototype.getProject = function (projectFileName) {
|
|
157084
157111
|
return projectFileName === undefined ? undefined : this.projectService.findProject(projectFileName);
|
|
@@ -160599,6 +160626,7 @@ var ts;
|
|
|
160599
160626
|
var nextFileToCheck = 0;
|
|
160600
160627
|
return { getModifiedTime: getModifiedTime, poll: poll, startWatchTimer: startWatchTimer, addFile: addFile, removeFile: removeFile };
|
|
160601
160628
|
function getModifiedTime(fileName) {
|
|
160629
|
+
// Caller guarantees that `fileName` exists, so there'd be no benefit from throwIfNoEntry
|
|
160602
160630
|
return fs.statSync(fileName).mtime;
|
|
160603
160631
|
}
|
|
160604
160632
|
function poll(checkedIndex) {
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -9084,7 +9084,9 @@ declare namespace ts.server.protocol {
|
|
|
9084
9084
|
None = "None",
|
|
9085
9085
|
Preserve = "Preserve",
|
|
9086
9086
|
ReactNative = "ReactNative",
|
|
9087
|
-
React = "React"
|
|
9087
|
+
React = "React",
|
|
9088
|
+
ReactJSX = "ReactJSX",
|
|
9089
|
+
ReactJSXDev = "ReactJSXDev"
|
|
9088
9090
|
}
|
|
9089
9091
|
enum ModuleKind {
|
|
9090
9092
|
None = "None",
|
|
@@ -9094,6 +9096,7 @@ declare namespace ts.server.protocol {
|
|
|
9094
9096
|
System = "System",
|
|
9095
9097
|
ES6 = "ES6",
|
|
9096
9098
|
ES2015 = "ES2015",
|
|
9099
|
+
ES2020 = "ES2020",
|
|
9097
9100
|
ESNext = "ESNext"
|
|
9098
9101
|
}
|
|
9099
9102
|
enum ModuleResolutionKind {
|
|
@@ -9114,6 +9117,7 @@ declare namespace ts.server.protocol {
|
|
|
9114
9117
|
ES2018 = "ES2018",
|
|
9115
9118
|
ES2019 = "ES2019",
|
|
9116
9119
|
ES2020 = "ES2020",
|
|
9120
|
+
JSON = "JSON",
|
|
9117
9121
|
ESNext = "ESNext"
|
|
9118
9122
|
}
|
|
9119
9123
|
}
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -288,7 +288,7 @@ var ts;
|
|
|
288
288
|
// If changing the text in this section, be sure to test `configurePrerelease` too.
|
|
289
289
|
ts.versionMajorMinor = "4.1";
|
|
290
290
|
/** The version of the TypeScript compiler release */
|
|
291
|
-
ts.version = "4.1.
|
|
291
|
+
ts.version = "4.1.6";
|
|
292
292
|
/* @internal */
|
|
293
293
|
var Comparison;
|
|
294
294
|
(function (Comparison) {
|
|
@@ -7216,8 +7216,8 @@ var ts;
|
|
|
7216
7216
|
},
|
|
7217
7217
|
getFileSize: function (path) {
|
|
7218
7218
|
try {
|
|
7219
|
-
var stat =
|
|
7220
|
-
if (stat.isFile()) {
|
|
7219
|
+
var stat = statSync(path);
|
|
7220
|
+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
|
|
7221
7221
|
return stat.size;
|
|
7222
7222
|
}
|
|
7223
7223
|
}
|
|
@@ -7263,6 +7263,15 @@ var ts;
|
|
|
7263
7263
|
}
|
|
7264
7264
|
};
|
|
7265
7265
|
return nodeSystem;
|
|
7266
|
+
/**
|
|
7267
|
+
* `throwIfNoEntry` was added so recently that it's not in the node types.
|
|
7268
|
+
* This helper encapsulates the mitigating usage of `any`.
|
|
7269
|
+
* See https://github.com/nodejs/node/pull/33716
|
|
7270
|
+
*/
|
|
7271
|
+
function statSync(path) {
|
|
7272
|
+
// throwIfNoEntry will be ignored by older versions of node
|
|
7273
|
+
return _fs.statSync(path, { throwIfNoEntry: false });
|
|
7274
|
+
}
|
|
7266
7275
|
/**
|
|
7267
7276
|
* Uses the builtin inspector APIs to capture a CPU profile
|
|
7268
7277
|
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
|
|
@@ -7317,20 +7326,21 @@ var ts;
|
|
|
7317
7326
|
if (activeSession && activeSession !== "stopping") {
|
|
7318
7327
|
var s_1 = activeSession;
|
|
7319
7328
|
activeSession.post("Profiler.stop", function (err, _a) {
|
|
7329
|
+
var _b;
|
|
7320
7330
|
var profile = _a.profile;
|
|
7321
7331
|
if (!err) {
|
|
7322
7332
|
try {
|
|
7323
|
-
if (
|
|
7333
|
+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
7324
7334
|
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
|
|
7325
7335
|
}
|
|
7326
7336
|
}
|
|
7327
|
-
catch (
|
|
7337
|
+
catch (_c) {
|
|
7328
7338
|
// do nothing and ignore fallible fs operation
|
|
7329
7339
|
}
|
|
7330
7340
|
try {
|
|
7331
7341
|
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
|
|
7332
7342
|
}
|
|
7333
|
-
catch (
|
|
7343
|
+
catch (_d) {
|
|
7334
7344
|
// do nothing and ignore fallible fs operation
|
|
7335
7345
|
}
|
|
7336
7346
|
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
|
|
@@ -7569,7 +7579,10 @@ var ts;
|
|
|
7569
7579
|
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
|
|
7570
7580
|
var name = ts.combinePaths(path, entry);
|
|
7571
7581
|
try {
|
|
7572
|
-
stat =
|
|
7582
|
+
stat = statSync(name);
|
|
7583
|
+
if (!stat) {
|
|
7584
|
+
continue;
|
|
7585
|
+
}
|
|
7573
7586
|
}
|
|
7574
7587
|
catch (e) {
|
|
7575
7588
|
continue;
|
|
@@ -7602,7 +7615,10 @@ var ts;
|
|
|
7602
7615
|
var originalStackTraceLimit = Error.stackTraceLimit;
|
|
7603
7616
|
Error.stackTraceLimit = 0;
|
|
7604
7617
|
try {
|
|
7605
|
-
var stat =
|
|
7618
|
+
var stat = statSync(path);
|
|
7619
|
+
if (!stat) {
|
|
7620
|
+
return false;
|
|
7621
|
+
}
|
|
7606
7622
|
switch (entryKind) {
|
|
7607
7623
|
case 0 /* File */: return stat.isFile();
|
|
7608
7624
|
case 1 /* Directory */: return stat.isDirectory();
|
|
@@ -7634,8 +7650,9 @@ var ts;
|
|
|
7634
7650
|
}
|
|
7635
7651
|
}
|
|
7636
7652
|
function getModifiedTime(path) {
|
|
7653
|
+
var _a;
|
|
7637
7654
|
try {
|
|
7638
|
-
return
|
|
7655
|
+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
|
|
7639
7656
|
}
|
|
7640
7657
|
catch (e) {
|
|
7641
7658
|
return undefined;
|
|
@@ -45888,7 +45905,7 @@ var ts;
|
|
|
45888
45905
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
45889
45906
|
var name = node.propertyName || node.name;
|
|
45890
45907
|
if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) {
|
|
45891
|
-
return getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText);
|
|
45908
|
+
return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias);
|
|
45892
45909
|
}
|
|
45893
45910
|
markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);
|
|
45894
45911
|
return resolved;
|
|
@@ -63317,6 +63334,7 @@ var ts;
|
|
|
63317
63334
|
return errorType;
|
|
63318
63335
|
}
|
|
63319
63336
|
flowDepth++;
|
|
63337
|
+
var sharedFlow;
|
|
63320
63338
|
while (true) {
|
|
63321
63339
|
var flags = flow.flags;
|
|
63322
63340
|
if (flags & 4096 /* Shared */) {
|
|
@@ -63329,6 +63347,7 @@ var ts;
|
|
|
63329
63347
|
return sharedFlowTypes[i];
|
|
63330
63348
|
}
|
|
63331
63349
|
}
|
|
63350
|
+
sharedFlow = flow;
|
|
63332
63351
|
}
|
|
63333
63352
|
var type = void 0;
|
|
63334
63353
|
if (flags & 16 /* Assignment */) {
|
|
@@ -63392,9 +63411,9 @@ var ts;
|
|
|
63392
63411
|
// simply return the non-auto declared type to reduce follow-on errors.
|
|
63393
63412
|
type = convertAutoToAny(declaredType);
|
|
63394
63413
|
}
|
|
63395
|
-
if (
|
|
63414
|
+
if (sharedFlow) {
|
|
63396
63415
|
// Record visited node and the associated type in the cache.
|
|
63397
|
-
sharedFlowNodes[sharedFlowCount] =
|
|
63416
|
+
sharedFlowNodes[sharedFlowCount] = sharedFlow;
|
|
63398
63417
|
sharedFlowTypes[sharedFlowCount] = type;
|
|
63399
63418
|
sharedFlowCount++;
|
|
63400
63419
|
}
|
|
@@ -68561,9 +68580,9 @@ var ts;
|
|
|
68561
68580
|
var oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
68562
68581
|
var oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
68563
68582
|
var oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
68564
|
-
var
|
|
68565
|
-
var isOverload =
|
|
68566
|
-
var implDecl = isOverload ? ts.find(
|
|
68583
|
+
var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray;
|
|
68584
|
+
var isOverload = failedSignatureDeclarations.length > 1;
|
|
68585
|
+
var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
|
|
68567
68586
|
if (implDecl) {
|
|
68568
68587
|
var candidate = getSignatureFromDeclaration(implDecl);
|
|
68569
68588
|
var isSingleNonGenericCandidate_1 = !candidate.typeParameters;
|
|
@@ -150175,6 +150194,8 @@ var ts;
|
|
|
150175
150194
|
JsxEmit["Preserve"] = "Preserve";
|
|
150176
150195
|
JsxEmit["ReactNative"] = "ReactNative";
|
|
150177
150196
|
JsxEmit["React"] = "React";
|
|
150197
|
+
JsxEmit["ReactJSX"] = "ReactJSX";
|
|
150198
|
+
JsxEmit["ReactJSXDev"] = "ReactJSXDev";
|
|
150178
150199
|
})(JsxEmit = protocol.JsxEmit || (protocol.JsxEmit = {}));
|
|
150179
150200
|
var ModuleKind;
|
|
150180
150201
|
(function (ModuleKind) {
|
|
@@ -150185,6 +150206,7 @@ var ts;
|
|
|
150185
150206
|
ModuleKind["System"] = "System";
|
|
150186
150207
|
ModuleKind["ES6"] = "ES6";
|
|
150187
150208
|
ModuleKind["ES2015"] = "ES2015";
|
|
150209
|
+
ModuleKind["ES2020"] = "ES2020";
|
|
150188
150210
|
ModuleKind["ESNext"] = "ESNext";
|
|
150189
150211
|
})(ModuleKind = protocol.ModuleKind || (protocol.ModuleKind = {}));
|
|
150190
150212
|
var ModuleResolutionKind;
|
|
@@ -150208,6 +150230,7 @@ var ts;
|
|
|
150208
150230
|
ScriptTarget["ES2018"] = "ES2018";
|
|
150209
150231
|
ScriptTarget["ES2019"] = "ES2019";
|
|
150210
150232
|
ScriptTarget["ES2020"] = "ES2020";
|
|
150233
|
+
ScriptTarget["JSON"] = "JSON";
|
|
150211
150234
|
ScriptTarget["ESNext"] = "ESNext";
|
|
150212
150235
|
})(ScriptTarget = protocol.ScriptTarget || (protocol.ScriptTarget = {}));
|
|
150213
150236
|
})(protocol = server.protocol || (server.protocol = {}));
|
|
@@ -152147,6 +152170,10 @@ var ts;
|
|
|
152147
152170
|
Project.prototype.enablePlugin = function (pluginConfigEntry, searchPaths, pluginConfigOverrides) {
|
|
152148
152171
|
var _this = this;
|
|
152149
152172
|
this.projectService.logger.info("Enabling plugin " + pluginConfigEntry.name + " from candidate paths: " + searchPaths.join(","));
|
|
152173
|
+
if (!pluginConfigEntry.name || ts.parsePackageName(pluginConfigEntry.name).rest) {
|
|
152174
|
+
this.projectService.logger.info("Skipped loading plugin " + (pluginConfigEntry.name || JSON.stringify(pluginConfigEntry)) + " because only package name is allowed plugin name");
|
|
152175
|
+
return;
|
|
152176
|
+
}
|
|
152150
152177
|
var log = function (message) { return _this.projectService.logger.info(message); };
|
|
152151
152178
|
var errorLogs;
|
|
152152
152179
|
var logError = function (message) { (errorLogs || (errorLogs = [])).push(message); };
|
|
@@ -157272,7 +157299,7 @@ var ts;
|
|
|
157272
157299
|
};
|
|
157273
157300
|
Session.prototype.getEncodedSemanticClassifications = function (args) {
|
|
157274
157301
|
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
|
|
157275
|
-
return project.getLanguageService().getEncodedSemanticClassifications(file, args);
|
|
157302
|
+
return project.getLanguageService().getEncodedSemanticClassifications(file, args, args.format);
|
|
157276
157303
|
};
|
|
157277
157304
|
Session.prototype.getProject = function (projectFileName) {
|
|
157278
157305
|
return projectFileName === undefined ? undefined : this.projectService.findProject(projectFileName);
|
package/lib/typescript.js
CHANGED
|
@@ -288,7 +288,7 @@ var ts;
|
|
|
288
288
|
// If changing the text in this section, be sure to test `configurePrerelease` too.
|
|
289
289
|
ts.versionMajorMinor = "4.1";
|
|
290
290
|
/** The version of the TypeScript compiler release */
|
|
291
|
-
ts.version = "4.1.
|
|
291
|
+
ts.version = "4.1.6";
|
|
292
292
|
/* @internal */
|
|
293
293
|
var Comparison;
|
|
294
294
|
(function (Comparison) {
|
|
@@ -7216,8 +7216,8 @@ var ts;
|
|
|
7216
7216
|
},
|
|
7217
7217
|
getFileSize: function (path) {
|
|
7218
7218
|
try {
|
|
7219
|
-
var stat =
|
|
7220
|
-
if (stat.isFile()) {
|
|
7219
|
+
var stat = statSync(path);
|
|
7220
|
+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
|
|
7221
7221
|
return stat.size;
|
|
7222
7222
|
}
|
|
7223
7223
|
}
|
|
@@ -7263,6 +7263,15 @@ var ts;
|
|
|
7263
7263
|
}
|
|
7264
7264
|
};
|
|
7265
7265
|
return nodeSystem;
|
|
7266
|
+
/**
|
|
7267
|
+
* `throwIfNoEntry` was added so recently that it's not in the node types.
|
|
7268
|
+
* This helper encapsulates the mitigating usage of `any`.
|
|
7269
|
+
* See https://github.com/nodejs/node/pull/33716
|
|
7270
|
+
*/
|
|
7271
|
+
function statSync(path) {
|
|
7272
|
+
// throwIfNoEntry will be ignored by older versions of node
|
|
7273
|
+
return _fs.statSync(path, { throwIfNoEntry: false });
|
|
7274
|
+
}
|
|
7266
7275
|
/**
|
|
7267
7276
|
* Uses the builtin inspector APIs to capture a CPU profile
|
|
7268
7277
|
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
|
|
@@ -7317,20 +7326,21 @@ var ts;
|
|
|
7317
7326
|
if (activeSession && activeSession !== "stopping") {
|
|
7318
7327
|
var s_1 = activeSession;
|
|
7319
7328
|
activeSession.post("Profiler.stop", function (err, _a) {
|
|
7329
|
+
var _b;
|
|
7320
7330
|
var profile = _a.profile;
|
|
7321
7331
|
if (!err) {
|
|
7322
7332
|
try {
|
|
7323
|
-
if (
|
|
7333
|
+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
7324
7334
|
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
|
|
7325
7335
|
}
|
|
7326
7336
|
}
|
|
7327
|
-
catch (
|
|
7337
|
+
catch (_c) {
|
|
7328
7338
|
// do nothing and ignore fallible fs operation
|
|
7329
7339
|
}
|
|
7330
7340
|
try {
|
|
7331
7341
|
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
|
|
7332
7342
|
}
|
|
7333
|
-
catch (
|
|
7343
|
+
catch (_d) {
|
|
7334
7344
|
// do nothing and ignore fallible fs operation
|
|
7335
7345
|
}
|
|
7336
7346
|
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
|
|
@@ -7569,7 +7579,10 @@ var ts;
|
|
|
7569
7579
|
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
|
|
7570
7580
|
var name = ts.combinePaths(path, entry);
|
|
7571
7581
|
try {
|
|
7572
|
-
stat =
|
|
7582
|
+
stat = statSync(name);
|
|
7583
|
+
if (!stat) {
|
|
7584
|
+
continue;
|
|
7585
|
+
}
|
|
7573
7586
|
}
|
|
7574
7587
|
catch (e) {
|
|
7575
7588
|
continue;
|
|
@@ -7602,7 +7615,10 @@ var ts;
|
|
|
7602
7615
|
var originalStackTraceLimit = Error.stackTraceLimit;
|
|
7603
7616
|
Error.stackTraceLimit = 0;
|
|
7604
7617
|
try {
|
|
7605
|
-
var stat =
|
|
7618
|
+
var stat = statSync(path);
|
|
7619
|
+
if (!stat) {
|
|
7620
|
+
return false;
|
|
7621
|
+
}
|
|
7606
7622
|
switch (entryKind) {
|
|
7607
7623
|
case 0 /* File */: return stat.isFile();
|
|
7608
7624
|
case 1 /* Directory */: return stat.isDirectory();
|
|
@@ -7634,8 +7650,9 @@ var ts;
|
|
|
7634
7650
|
}
|
|
7635
7651
|
}
|
|
7636
7652
|
function getModifiedTime(path) {
|
|
7653
|
+
var _a;
|
|
7637
7654
|
try {
|
|
7638
|
-
return
|
|
7655
|
+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
|
|
7639
7656
|
}
|
|
7640
7657
|
catch (e) {
|
|
7641
7658
|
return undefined;
|
|
@@ -45888,7 +45905,7 @@ var ts;
|
|
|
45888
45905
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
45889
45906
|
var name = node.propertyName || node.name;
|
|
45890
45907
|
if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) {
|
|
45891
|
-
return getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText);
|
|
45908
|
+
return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias);
|
|
45892
45909
|
}
|
|
45893
45910
|
markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);
|
|
45894
45911
|
return resolved;
|
|
@@ -63317,6 +63334,7 @@ var ts;
|
|
|
63317
63334
|
return errorType;
|
|
63318
63335
|
}
|
|
63319
63336
|
flowDepth++;
|
|
63337
|
+
var sharedFlow;
|
|
63320
63338
|
while (true) {
|
|
63321
63339
|
var flags = flow.flags;
|
|
63322
63340
|
if (flags & 4096 /* Shared */) {
|
|
@@ -63329,6 +63347,7 @@ var ts;
|
|
|
63329
63347
|
return sharedFlowTypes[i];
|
|
63330
63348
|
}
|
|
63331
63349
|
}
|
|
63350
|
+
sharedFlow = flow;
|
|
63332
63351
|
}
|
|
63333
63352
|
var type = void 0;
|
|
63334
63353
|
if (flags & 16 /* Assignment */) {
|
|
@@ -63392,9 +63411,9 @@ var ts;
|
|
|
63392
63411
|
// simply return the non-auto declared type to reduce follow-on errors.
|
|
63393
63412
|
type = convertAutoToAny(declaredType);
|
|
63394
63413
|
}
|
|
63395
|
-
if (
|
|
63414
|
+
if (sharedFlow) {
|
|
63396
63415
|
// Record visited node and the associated type in the cache.
|
|
63397
|
-
sharedFlowNodes[sharedFlowCount] =
|
|
63416
|
+
sharedFlowNodes[sharedFlowCount] = sharedFlow;
|
|
63398
63417
|
sharedFlowTypes[sharedFlowCount] = type;
|
|
63399
63418
|
sharedFlowCount++;
|
|
63400
63419
|
}
|
|
@@ -68561,9 +68580,9 @@ var ts;
|
|
|
68561
68580
|
var oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
68562
68581
|
var oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
68563
68582
|
var oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
68564
|
-
var
|
|
68565
|
-
var isOverload =
|
|
68566
|
-
var implDecl = isOverload ? ts.find(
|
|
68583
|
+
var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray;
|
|
68584
|
+
var isOverload = failedSignatureDeclarations.length > 1;
|
|
68585
|
+
var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
|
|
68567
68586
|
if (implDecl) {
|
|
68568
68587
|
var candidate = getSignatureFromDeclaration(implDecl);
|
|
68569
68588
|
var isSingleNonGenericCandidate_1 = !candidate.typeParameters;
|
|
@@ -288,7 +288,7 @@ var ts;
|
|
|
288
288
|
// If changing the text in this section, be sure to test `configurePrerelease` too.
|
|
289
289
|
ts.versionMajorMinor = "4.1";
|
|
290
290
|
/** The version of the TypeScript compiler release */
|
|
291
|
-
ts.version = "4.1.
|
|
291
|
+
ts.version = "4.1.6";
|
|
292
292
|
/* @internal */
|
|
293
293
|
var Comparison;
|
|
294
294
|
(function (Comparison) {
|
|
@@ -7216,8 +7216,8 @@ var ts;
|
|
|
7216
7216
|
},
|
|
7217
7217
|
getFileSize: function (path) {
|
|
7218
7218
|
try {
|
|
7219
|
-
var stat =
|
|
7220
|
-
if (stat.isFile()) {
|
|
7219
|
+
var stat = statSync(path);
|
|
7220
|
+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
|
|
7221
7221
|
return stat.size;
|
|
7222
7222
|
}
|
|
7223
7223
|
}
|
|
@@ -7263,6 +7263,15 @@ var ts;
|
|
|
7263
7263
|
}
|
|
7264
7264
|
};
|
|
7265
7265
|
return nodeSystem;
|
|
7266
|
+
/**
|
|
7267
|
+
* `throwIfNoEntry` was added so recently that it's not in the node types.
|
|
7268
|
+
* This helper encapsulates the mitigating usage of `any`.
|
|
7269
|
+
* See https://github.com/nodejs/node/pull/33716
|
|
7270
|
+
*/
|
|
7271
|
+
function statSync(path) {
|
|
7272
|
+
// throwIfNoEntry will be ignored by older versions of node
|
|
7273
|
+
return _fs.statSync(path, { throwIfNoEntry: false });
|
|
7274
|
+
}
|
|
7266
7275
|
/**
|
|
7267
7276
|
* Uses the builtin inspector APIs to capture a CPU profile
|
|
7268
7277
|
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
|
|
@@ -7317,20 +7326,21 @@ var ts;
|
|
|
7317
7326
|
if (activeSession && activeSession !== "stopping") {
|
|
7318
7327
|
var s_1 = activeSession;
|
|
7319
7328
|
activeSession.post("Profiler.stop", function (err, _a) {
|
|
7329
|
+
var _b;
|
|
7320
7330
|
var profile = _a.profile;
|
|
7321
7331
|
if (!err) {
|
|
7322
7332
|
try {
|
|
7323
|
-
if (
|
|
7333
|
+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
7324
7334
|
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
|
|
7325
7335
|
}
|
|
7326
7336
|
}
|
|
7327
|
-
catch (
|
|
7337
|
+
catch (_c) {
|
|
7328
7338
|
// do nothing and ignore fallible fs operation
|
|
7329
7339
|
}
|
|
7330
7340
|
try {
|
|
7331
7341
|
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
|
|
7332
7342
|
}
|
|
7333
|
-
catch (
|
|
7343
|
+
catch (_d) {
|
|
7334
7344
|
// do nothing and ignore fallible fs operation
|
|
7335
7345
|
}
|
|
7336
7346
|
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
|
|
@@ -7569,7 +7579,10 @@ var ts;
|
|
|
7569
7579
|
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
|
|
7570
7580
|
var name = ts.combinePaths(path, entry);
|
|
7571
7581
|
try {
|
|
7572
|
-
stat =
|
|
7582
|
+
stat = statSync(name);
|
|
7583
|
+
if (!stat) {
|
|
7584
|
+
continue;
|
|
7585
|
+
}
|
|
7573
7586
|
}
|
|
7574
7587
|
catch (e) {
|
|
7575
7588
|
continue;
|
|
@@ -7602,7 +7615,10 @@ var ts;
|
|
|
7602
7615
|
var originalStackTraceLimit = Error.stackTraceLimit;
|
|
7603
7616
|
Error.stackTraceLimit = 0;
|
|
7604
7617
|
try {
|
|
7605
|
-
var stat =
|
|
7618
|
+
var stat = statSync(path);
|
|
7619
|
+
if (!stat) {
|
|
7620
|
+
return false;
|
|
7621
|
+
}
|
|
7606
7622
|
switch (entryKind) {
|
|
7607
7623
|
case 0 /* File */: return stat.isFile();
|
|
7608
7624
|
case 1 /* Directory */: return stat.isDirectory();
|
|
@@ -7634,8 +7650,9 @@ var ts;
|
|
|
7634
7650
|
}
|
|
7635
7651
|
}
|
|
7636
7652
|
function getModifiedTime(path) {
|
|
7653
|
+
var _a;
|
|
7637
7654
|
try {
|
|
7638
|
-
return
|
|
7655
|
+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
|
|
7639
7656
|
}
|
|
7640
7657
|
catch (e) {
|
|
7641
7658
|
return undefined;
|
|
@@ -45888,7 +45905,7 @@ var ts;
|
|
|
45888
45905
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
45889
45906
|
var name = node.propertyName || node.name;
|
|
45890
45907
|
if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) {
|
|
45891
|
-
return getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText);
|
|
45908
|
+
return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias);
|
|
45892
45909
|
}
|
|
45893
45910
|
markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);
|
|
45894
45911
|
return resolved;
|
|
@@ -63317,6 +63334,7 @@ var ts;
|
|
|
63317
63334
|
return errorType;
|
|
63318
63335
|
}
|
|
63319
63336
|
flowDepth++;
|
|
63337
|
+
var sharedFlow;
|
|
63320
63338
|
while (true) {
|
|
63321
63339
|
var flags = flow.flags;
|
|
63322
63340
|
if (flags & 4096 /* Shared */) {
|
|
@@ -63329,6 +63347,7 @@ var ts;
|
|
|
63329
63347
|
return sharedFlowTypes[i];
|
|
63330
63348
|
}
|
|
63331
63349
|
}
|
|
63350
|
+
sharedFlow = flow;
|
|
63332
63351
|
}
|
|
63333
63352
|
var type = void 0;
|
|
63334
63353
|
if (flags & 16 /* Assignment */) {
|
|
@@ -63392,9 +63411,9 @@ var ts;
|
|
|
63392
63411
|
// simply return the non-auto declared type to reduce follow-on errors.
|
|
63393
63412
|
type = convertAutoToAny(declaredType);
|
|
63394
63413
|
}
|
|
63395
|
-
if (
|
|
63414
|
+
if (sharedFlow) {
|
|
63396
63415
|
// Record visited node and the associated type in the cache.
|
|
63397
|
-
sharedFlowNodes[sharedFlowCount] =
|
|
63416
|
+
sharedFlowNodes[sharedFlowCount] = sharedFlow;
|
|
63398
63417
|
sharedFlowTypes[sharedFlowCount] = type;
|
|
63399
63418
|
sharedFlowCount++;
|
|
63400
63419
|
}
|
|
@@ -68561,9 +68580,9 @@ var ts;
|
|
|
68561
68580
|
var oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
68562
68581
|
var oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
68563
68582
|
var oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
68564
|
-
var
|
|
68565
|
-
var isOverload =
|
|
68566
|
-
var implDecl = isOverload ? ts.find(
|
|
68583
|
+
var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray;
|
|
68584
|
+
var isOverload = failedSignatureDeclarations.length > 1;
|
|
68585
|
+
var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
|
|
68567
68586
|
if (implDecl) {
|
|
68568
68587
|
var candidate = getSignatureFromDeclaration(implDecl);
|
|
68569
68588
|
var isSingleNonGenericCandidate_1 = !candidate.typeParameters;
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -83,7 +83,7 @@ var ts;
|
|
|
83
83
|
// If changing the text in this section, be sure to test `configurePrerelease` too.
|
|
84
84
|
ts.versionMajorMinor = "4.1";
|
|
85
85
|
/** The version of the TypeScript compiler release */
|
|
86
|
-
ts.version = "4.1.
|
|
86
|
+
ts.version = "4.1.6";
|
|
87
87
|
/* @internal */
|
|
88
88
|
var Comparison;
|
|
89
89
|
(function (Comparison) {
|
|
@@ -7011,8 +7011,8 @@ var ts;
|
|
|
7011
7011
|
},
|
|
7012
7012
|
getFileSize: function (path) {
|
|
7013
7013
|
try {
|
|
7014
|
-
var stat =
|
|
7015
|
-
if (stat.isFile()) {
|
|
7014
|
+
var stat = statSync(path);
|
|
7015
|
+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
|
|
7016
7016
|
return stat.size;
|
|
7017
7017
|
}
|
|
7018
7018
|
}
|
|
@@ -7058,6 +7058,15 @@ var ts;
|
|
|
7058
7058
|
}
|
|
7059
7059
|
};
|
|
7060
7060
|
return nodeSystem;
|
|
7061
|
+
/**
|
|
7062
|
+
* `throwIfNoEntry` was added so recently that it's not in the node types.
|
|
7063
|
+
* This helper encapsulates the mitigating usage of `any`.
|
|
7064
|
+
* See https://github.com/nodejs/node/pull/33716
|
|
7065
|
+
*/
|
|
7066
|
+
function statSync(path) {
|
|
7067
|
+
// throwIfNoEntry will be ignored by older versions of node
|
|
7068
|
+
return _fs.statSync(path, { throwIfNoEntry: false });
|
|
7069
|
+
}
|
|
7061
7070
|
/**
|
|
7062
7071
|
* Uses the builtin inspector APIs to capture a CPU profile
|
|
7063
7072
|
* See https://nodejs.org/api/inspector.html#inspector_example_usage for details
|
|
@@ -7112,20 +7121,21 @@ var ts;
|
|
|
7112
7121
|
if (activeSession && activeSession !== "stopping") {
|
|
7113
7122
|
var s_1 = activeSession;
|
|
7114
7123
|
activeSession.post("Profiler.stop", function (err, _a) {
|
|
7124
|
+
var _b;
|
|
7115
7125
|
var profile = _a.profile;
|
|
7116
7126
|
if (!err) {
|
|
7117
7127
|
try {
|
|
7118
|
-
if (
|
|
7128
|
+
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
7119
7129
|
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
|
|
7120
7130
|
}
|
|
7121
7131
|
}
|
|
7122
|
-
catch (
|
|
7132
|
+
catch (_c) {
|
|
7123
7133
|
// do nothing and ignore fallible fs operation
|
|
7124
7134
|
}
|
|
7125
7135
|
try {
|
|
7126
7136
|
_fs.mkdirSync(_path.dirname(profilePath), { recursive: true });
|
|
7127
7137
|
}
|
|
7128
|
-
catch (
|
|
7138
|
+
catch (_d) {
|
|
7129
7139
|
// do nothing and ignore fallible fs operation
|
|
7130
7140
|
}
|
|
7131
7141
|
_fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile)));
|
|
@@ -7364,7 +7374,10 @@ var ts;
|
|
|
7364
7374
|
if (typeof dirent === "string" || dirent.isSymbolicLink()) {
|
|
7365
7375
|
var name = ts.combinePaths(path, entry);
|
|
7366
7376
|
try {
|
|
7367
|
-
stat =
|
|
7377
|
+
stat = statSync(name);
|
|
7378
|
+
if (!stat) {
|
|
7379
|
+
continue;
|
|
7380
|
+
}
|
|
7368
7381
|
}
|
|
7369
7382
|
catch (e) {
|
|
7370
7383
|
continue;
|
|
@@ -7397,7 +7410,10 @@ var ts;
|
|
|
7397
7410
|
var originalStackTraceLimit = Error.stackTraceLimit;
|
|
7398
7411
|
Error.stackTraceLimit = 0;
|
|
7399
7412
|
try {
|
|
7400
|
-
var stat =
|
|
7413
|
+
var stat = statSync(path);
|
|
7414
|
+
if (!stat) {
|
|
7415
|
+
return false;
|
|
7416
|
+
}
|
|
7401
7417
|
switch (entryKind) {
|
|
7402
7418
|
case 0 /* File */: return stat.isFile();
|
|
7403
7419
|
case 1 /* Directory */: return stat.isDirectory();
|
|
@@ -7429,8 +7445,9 @@ var ts;
|
|
|
7429
7445
|
}
|
|
7430
7446
|
}
|
|
7431
7447
|
function getModifiedTime(path) {
|
|
7448
|
+
var _a;
|
|
7432
7449
|
try {
|
|
7433
|
-
return
|
|
7450
|
+
return (_a = statSync(path)) === null || _a === void 0 ? void 0 : _a.mtime;
|
|
7434
7451
|
}
|
|
7435
7452
|
catch (e) {
|
|
7436
7453
|
return undefined;
|
|
@@ -45683,7 +45700,7 @@ var ts;
|
|
|
45683
45700
|
var resolved = getExternalModuleMember(root, commonJSPropertyAccess || node, dontResolveAlias);
|
|
45684
45701
|
var name = node.propertyName || node.name;
|
|
45685
45702
|
if (commonJSPropertyAccess && resolved && ts.isIdentifier(name)) {
|
|
45686
|
-
return getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText);
|
|
45703
|
+
return resolveSymbol(getPropertyOfType(getTypeOfSymbol(resolved), name.escapedText), dontResolveAlias);
|
|
45687
45704
|
}
|
|
45688
45705
|
markSymbolOfAliasDeclarationIfTypeOnly(node, /*immediateTarget*/ undefined, resolved, /*overwriteEmpty*/ false);
|
|
45689
45706
|
return resolved;
|
|
@@ -63112,6 +63129,7 @@ var ts;
|
|
|
63112
63129
|
return errorType;
|
|
63113
63130
|
}
|
|
63114
63131
|
flowDepth++;
|
|
63132
|
+
var sharedFlow;
|
|
63115
63133
|
while (true) {
|
|
63116
63134
|
var flags = flow.flags;
|
|
63117
63135
|
if (flags & 4096 /* Shared */) {
|
|
@@ -63124,6 +63142,7 @@ var ts;
|
|
|
63124
63142
|
return sharedFlowTypes[i];
|
|
63125
63143
|
}
|
|
63126
63144
|
}
|
|
63145
|
+
sharedFlow = flow;
|
|
63127
63146
|
}
|
|
63128
63147
|
var type = void 0;
|
|
63129
63148
|
if (flags & 16 /* Assignment */) {
|
|
@@ -63187,9 +63206,9 @@ var ts;
|
|
|
63187
63206
|
// simply return the non-auto declared type to reduce follow-on errors.
|
|
63188
63207
|
type = convertAutoToAny(declaredType);
|
|
63189
63208
|
}
|
|
63190
|
-
if (
|
|
63209
|
+
if (sharedFlow) {
|
|
63191
63210
|
// Record visited node and the associated type in the cache.
|
|
63192
|
-
sharedFlowNodes[sharedFlowCount] =
|
|
63211
|
+
sharedFlowNodes[sharedFlowCount] = sharedFlow;
|
|
63193
63212
|
sharedFlowTypes[sharedFlowCount] = type;
|
|
63194
63213
|
sharedFlowCount++;
|
|
63195
63214
|
}
|
|
@@ -68356,9 +68375,9 @@ var ts;
|
|
|
68356
68375
|
var oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
68357
68376
|
var oldCandidateForArgumentArityError = candidateForArgumentArityError;
|
|
68358
68377
|
var oldCandidateForTypeArgumentError = candidateForTypeArgumentError;
|
|
68359
|
-
var
|
|
68360
|
-
var isOverload =
|
|
68361
|
-
var implDecl = isOverload ? ts.find(
|
|
68378
|
+
var failedSignatureDeclarations = ((_b = (_a = failed.declaration) === null || _a === void 0 ? void 0 : _a.symbol) === null || _b === void 0 ? void 0 : _b.declarations) || ts.emptyArray;
|
|
68379
|
+
var isOverload = failedSignatureDeclarations.length > 1;
|
|
68380
|
+
var implDecl = isOverload ? ts.find(failedSignatureDeclarations, function (d) { return ts.isFunctionLikeDeclaration(d) && ts.nodeIsPresent(d.body); }) : undefined;
|
|
68362
68381
|
if (implDecl) {
|
|
68363
68382
|
var candidate = getSignatureFromDeclaration(implDecl);
|
|
68364
68383
|
var isSingleNonGenericCandidate_1 = !candidate.typeParameters;
|
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.1.
|
|
5
|
+
"version": "4.1.6",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|