typescript 4.5.1-rc → 4.5.5
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/cancellationToken.js +1 -1
- package/lib/lib.es5.d.ts +1 -1
- package/lib/tsc.js +370 -338
- package/lib/tsserver.js +720 -674
- package/lib/tsserverlibrary.js +696 -650
- package/lib/typescript.js +605 -559
- package/lib/typescriptServices.js +605 -559
- package/lib/typingsInstaller.js +448 -410
- package/package.json +2 -2
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version =
|
|
92
|
+
ts.version = "4.5.5";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -130,7 +130,7 @@ var ts;
|
|
|
130
130
|
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
|
|
131
131
|
if (constructor)
|
|
132
132
|
return constructor;
|
|
133
|
-
throw new Error("TypeScript requires an environment that provides a compatible native "
|
|
133
|
+
throw new Error("TypeScript requires an environment that provides a compatible native ".concat(name, " implementation."));
|
|
134
134
|
}
|
|
135
135
|
})(ts || (ts = {}));
|
|
136
136
|
/* @internal */
|
|
@@ -1493,7 +1493,7 @@ var ts;
|
|
|
1493
1493
|
function cast(value, test) {
|
|
1494
1494
|
if (value !== undefined && test(value))
|
|
1495
1495
|
return value;
|
|
1496
|
-
return ts.Debug.fail("Invalid cast. The supplied value "
|
|
1496
|
+
return ts.Debug.fail("Invalid cast. The supplied value ".concat(value, " did not pass the test '").concat(ts.Debug.getFunctionName(test), "'."));
|
|
1497
1497
|
}
|
|
1498
1498
|
ts.cast = cast;
|
|
1499
1499
|
/** Does nothing. */
|
|
@@ -1584,7 +1584,7 @@ var ts;
|
|
|
1584
1584
|
function memoizeOne(callback) {
|
|
1585
1585
|
var map = new ts.Map();
|
|
1586
1586
|
return function (arg) {
|
|
1587
|
-
var key = typeof arg
|
|
1587
|
+
var key = "".concat(typeof arg, ":").concat(arg);
|
|
1588
1588
|
var value = map.get(key);
|
|
1589
1589
|
if (value === undefined && !map.has(key)) {
|
|
1590
1590
|
value = callback(arg);
|
|
@@ -2034,7 +2034,7 @@ var ts;
|
|
|
2034
2034
|
ts.createGetCanonicalFileName = createGetCanonicalFileName;
|
|
2035
2035
|
function patternText(_a) {
|
|
2036
2036
|
var prefix = _a.prefix, suffix = _a.suffix;
|
|
2037
|
-
return prefix
|
|
2037
|
+
return "".concat(prefix, "*").concat(suffix);
|
|
2038
2038
|
}
|
|
2039
2039
|
ts.patternText = patternText;
|
|
2040
2040
|
/**
|
|
@@ -2347,7 +2347,7 @@ var ts;
|
|
|
2347
2347
|
}
|
|
2348
2348
|
function fail(message, stackCrawlMark) {
|
|
2349
2349
|
debugger;
|
|
2350
|
-
var e = new Error(message ? "Debug Failure. "
|
|
2350
|
+
var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");
|
|
2351
2351
|
if (Error.captureStackTrace) {
|
|
2352
2352
|
Error.captureStackTrace(e, stackCrawlMark || fail);
|
|
2353
2353
|
}
|
|
@@ -2355,12 +2355,12 @@ var ts;
|
|
|
2355
2355
|
}
|
|
2356
2356
|
Debug.fail = fail;
|
|
2357
2357
|
function failBadSyntaxKind(node, message, stackCrawlMark) {
|
|
2358
|
-
return fail((message || "Unexpected node."
|
|
2358
|
+
return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind);
|
|
2359
2359
|
}
|
|
2360
2360
|
Debug.failBadSyntaxKind = failBadSyntaxKind;
|
|
2361
2361
|
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
|
|
2362
2362
|
if (!expression) {
|
|
2363
|
-
message = message ? "False expression: "
|
|
2363
|
+
message = message ? "False expression: ".concat(message) : "False expression.";
|
|
2364
2364
|
if (verboseDebugInfo) {
|
|
2365
2365
|
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
|
|
2366
2366
|
}
|
|
@@ -2370,26 +2370,26 @@ var ts;
|
|
|
2370
2370
|
Debug.assert = assert;
|
|
2371
2371
|
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
|
|
2372
2372
|
if (a !== b) {
|
|
2373
|
-
var message = msg ? msg2 ? msg
|
|
2374
|
-
fail("Expected "
|
|
2373
|
+
var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
|
|
2374
|
+
fail("Expected ".concat(a, " === ").concat(b, ". ").concat(message), stackCrawlMark || assertEqual);
|
|
2375
2375
|
}
|
|
2376
2376
|
}
|
|
2377
2377
|
Debug.assertEqual = assertEqual;
|
|
2378
2378
|
function assertLessThan(a, b, msg, stackCrawlMark) {
|
|
2379
2379
|
if (a >= b) {
|
|
2380
|
-
fail("Expected "
|
|
2380
|
+
fail("Expected ".concat(a, " < ").concat(b, ". ").concat(msg || ""), stackCrawlMark || assertLessThan);
|
|
2381
2381
|
}
|
|
2382
2382
|
}
|
|
2383
2383
|
Debug.assertLessThan = assertLessThan;
|
|
2384
2384
|
function assertLessThanOrEqual(a, b, stackCrawlMark) {
|
|
2385
2385
|
if (a > b) {
|
|
2386
|
-
fail("Expected "
|
|
2386
|
+
fail("Expected ".concat(a, " <= ").concat(b), stackCrawlMark || assertLessThanOrEqual);
|
|
2387
2387
|
}
|
|
2388
2388
|
}
|
|
2389
2389
|
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
|
|
2390
2390
|
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
|
|
2391
2391
|
if (a < b) {
|
|
2392
|
-
fail("Expected "
|
|
2392
|
+
fail("Expected ".concat(a, " >= ").concat(b), stackCrawlMark || assertGreaterThanOrEqual);
|
|
2393
2393
|
}
|
|
2394
2394
|
}
|
|
2395
2395
|
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
|
|
@@ -2430,42 +2430,42 @@ var ts;
|
|
|
2430
2430
|
function assertNever(member, message, stackCrawlMark) {
|
|
2431
2431
|
if (message === void 0) { message = "Illegal value:"; }
|
|
2432
2432
|
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
|
|
2433
|
-
return fail(message
|
|
2433
|
+
return fail("".concat(message, " ").concat(detail), stackCrawlMark || assertNever);
|
|
2434
2434
|
}
|
|
2435
2435
|
Debug.assertNever = assertNever;
|
|
2436
2436
|
function assertEachNode(nodes, test, message, stackCrawlMark) {
|
|
2437
2437
|
if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) {
|
|
2438
|
-
assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '"
|
|
2438
|
+
assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '".concat(getFunctionName(test), "'."); }, stackCrawlMark || assertEachNode);
|
|
2439
2439
|
}
|
|
2440
2440
|
}
|
|
2441
2441
|
Debug.assertEachNode = assertEachNode;
|
|
2442
2442
|
function assertNode(node, test, message, stackCrawlMark) {
|
|
2443
2443
|
if (shouldAssertFunction(1 /* Normal */, "assertNode")) {
|
|
2444
|
-
assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node "
|
|
2444
|
+
assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(getFunctionName(test), "'."); }, stackCrawlMark || assertNode);
|
|
2445
2445
|
}
|
|
2446
2446
|
}
|
|
2447
2447
|
Debug.assertNode = assertNode;
|
|
2448
2448
|
function assertNotNode(node, test, message, stackCrawlMark) {
|
|
2449
2449
|
if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) {
|
|
2450
|
-
assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node "
|
|
2450
|
+
assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " should not have passed test '").concat(getFunctionName(test), "'."); }, stackCrawlMark || assertNotNode);
|
|
2451
2451
|
}
|
|
2452
2452
|
}
|
|
2453
2453
|
Debug.assertNotNode = assertNotNode;
|
|
2454
2454
|
function assertOptionalNode(node, test, message, stackCrawlMark) {
|
|
2455
2455
|
if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) {
|
|
2456
|
-
assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node "
|
|
2456
|
+
assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(getFunctionName(test), "'."); }, stackCrawlMark || assertOptionalNode);
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
2459
|
Debug.assertOptionalNode = assertOptionalNode;
|
|
2460
2460
|
function assertOptionalToken(node, kind, message, stackCrawlMark) {
|
|
2461
2461
|
if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) {
|
|
2462
|
-
assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node "
|
|
2462
|
+
assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " was not a '").concat(formatSyntaxKind(kind), "' token."); }, stackCrawlMark || assertOptionalToken);
|
|
2463
2463
|
}
|
|
2464
2464
|
}
|
|
2465
2465
|
Debug.assertOptionalToken = assertOptionalToken;
|
|
2466
2466
|
function assertMissingNode(node, message, stackCrawlMark) {
|
|
2467
2467
|
if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) {
|
|
2468
|
-
assert(node === undefined, message || "Unexpected node.", function () { return "Node "
|
|
2468
|
+
assert(node === undefined, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); }, stackCrawlMark || assertMissingNode);
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
2471
|
Debug.assertMissingNode = assertMissingNode;
|
|
@@ -2486,7 +2486,7 @@ var ts;
|
|
|
2486
2486
|
}
|
|
2487
2487
|
Debug.getFunctionName = getFunctionName;
|
|
2488
2488
|
function formatSymbol(symbol) {
|
|
2489
|
-
return "{ name: "
|
|
2489
|
+
return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");
|
|
2490
2490
|
}
|
|
2491
2491
|
Debug.formatSymbol = formatSymbol;
|
|
2492
2492
|
/**
|
|
@@ -2507,7 +2507,7 @@ var ts;
|
|
|
2507
2507
|
break;
|
|
2508
2508
|
}
|
|
2509
2509
|
if (enumValue !== 0 && enumValue & value) {
|
|
2510
|
-
result = ""
|
|
2510
|
+
result = "".concat(result).concat(result ? "|" : "").concat(enumName);
|
|
2511
2511
|
remainingFlags &= ~enumValue;
|
|
2512
2512
|
}
|
|
2513
2513
|
}
|
|
@@ -2617,7 +2617,7 @@ var ts;
|
|
|
2617
2617
|
this.flags & 1 /* Unreachable */ ? "FlowUnreachable" :
|
|
2618
2618
|
"UnknownFlow";
|
|
2619
2619
|
var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);
|
|
2620
|
-
return ""
|
|
2620
|
+
return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : "");
|
|
2621
2621
|
}
|
|
2622
2622
|
},
|
|
2623
2623
|
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },
|
|
@@ -2656,7 +2656,7 @@ var ts;
|
|
|
2656
2656
|
// We don't care, this is debug code that's only enabled with a debugger attached -
|
|
2657
2657
|
// we're just taking note of it for anyone checking regex performance in the future.
|
|
2658
2658
|
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
|
|
2659
|
-
return "NodeArray "
|
|
2659
|
+
return "NodeArray ".concat(defaultValue);
|
|
2660
2660
|
}
|
|
2661
2661
|
}
|
|
2662
2662
|
});
|
|
@@ -2711,7 +2711,7 @@ var ts;
|
|
|
2711
2711
|
var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" :
|
|
2712
2712
|
"Symbol";
|
|
2713
2713
|
var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;
|
|
2714
|
-
return symbolHeader
|
|
2714
|
+
return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : "");
|
|
2715
2715
|
}
|
|
2716
2716
|
},
|
|
2717
2717
|
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
|
|
@@ -2721,11 +2721,11 @@ var ts;
|
|
|
2721
2721
|
__tsDebuggerDisplay: {
|
|
2722
2722
|
value: function () {
|
|
2723
2723
|
var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" :
|
|
2724
|
-
this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType "
|
|
2725
|
-
this.flags & 2048 /* BigIntLiteral */ ? "LiteralType "
|
|
2724
|
+
this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType ".concat(JSON.stringify(this.value)) :
|
|
2725
|
+
this.flags & 2048 /* BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") :
|
|
2726
2726
|
this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" :
|
|
2727
2727
|
this.flags & 32 /* Enum */ ? "EnumType" :
|
|
2728
|
-
this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType "
|
|
2728
|
+
this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType ".concat(this.intrinsicName) :
|
|
2729
2729
|
this.flags & 1048576 /* Union */ ? "UnionType" :
|
|
2730
2730
|
this.flags & 2097152 /* Intersection */ ? "IntersectionType" :
|
|
2731
2731
|
this.flags & 4194304 /* Index */ ? "IndexType" :
|
|
@@ -2744,7 +2744,7 @@ var ts;
|
|
|
2744
2744
|
"ObjectType" :
|
|
2745
2745
|
"Type";
|
|
2746
2746
|
var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
|
|
2747
|
-
return ""
|
|
2747
|
+
return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : "");
|
|
2748
2748
|
}
|
|
2749
2749
|
},
|
|
2750
2750
|
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
|
|
@@ -2780,11 +2780,11 @@ var ts;
|
|
|
2780
2780
|
__tsDebuggerDisplay: {
|
|
2781
2781
|
value: function () {
|
|
2782
2782
|
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
|
|
2783
|
-
ts.isIdentifier(this) ? "Identifier '"
|
|
2784
|
-
ts.isPrivateIdentifier(this) ? "PrivateIdentifier '"
|
|
2785
|
-
ts.isStringLiteral(this) ? "StringLiteral "
|
|
2786
|
-
ts.isNumericLiteral(this) ? "NumericLiteral "
|
|
2787
|
-
ts.isBigIntLiteral(this) ? "BigIntLiteral "
|
|
2783
|
+
ts.isIdentifier(this) ? "Identifier '".concat(ts.idText(this), "'") :
|
|
2784
|
+
ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
|
|
2785
|
+
ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
|
|
2786
|
+
ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
|
|
2787
|
+
ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") :
|
|
2788
2788
|
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
|
|
2789
2789
|
ts.isParameter(this) ? "ParameterDeclaration" :
|
|
2790
2790
|
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
|
|
@@ -2816,7 +2816,7 @@ var ts;
|
|
|
2816
2816
|
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
|
|
2817
2817
|
ts.isImportTypeNode(this) ? "ImportTypeNode" :
|
|
2818
2818
|
formatSyntaxKind(this.kind);
|
|
2819
|
-
return ""
|
|
2819
|
+
return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : "");
|
|
2820
2820
|
}
|
|
2821
2821
|
},
|
|
2822
2822
|
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
|
|
@@ -2863,10 +2863,10 @@ var ts;
|
|
|
2863
2863
|
Debug.enableDebugInfo = enableDebugInfo;
|
|
2864
2864
|
function formatDeprecationMessage(name, error, errorAfter, since, message) {
|
|
2865
2865
|
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
|
|
2866
|
-
deprecationMessage += "'"
|
|
2867
|
-
deprecationMessage += since ? "has been deprecated since v"
|
|
2868
|
-
deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v"
|
|
2869
|
-
deprecationMessage += message ? " "
|
|
2866
|
+
deprecationMessage += "'".concat(name, "' ");
|
|
2867
|
+
deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
|
|
2868
|
+
deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
|
|
2869
|
+
deprecationMessage += message ? " ".concat(ts.formatStringFromArgs(message, [name], 0)) : "";
|
|
2870
2870
|
return deprecationMessage;
|
|
2871
2871
|
}
|
|
2872
2872
|
function createErrorDeprecation(name, errorAfter, since, message) {
|
|
@@ -2997,11 +2997,11 @@ var ts;
|
|
|
2997
2997
|
}
|
|
2998
2998
|
};
|
|
2999
2999
|
Version.prototype.toString = function () {
|
|
3000
|
-
var result = this.major
|
|
3000
|
+
var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
|
|
3001
3001
|
if (ts.some(this.prerelease))
|
|
3002
|
-
result += "-"
|
|
3002
|
+
result += "-".concat(this.prerelease.join("."));
|
|
3003
3003
|
if (ts.some(this.build))
|
|
3004
|
-
result += "+"
|
|
3004
|
+
result += "+".concat(this.build.join("."));
|
|
3005
3005
|
return result;
|
|
3006
3006
|
};
|
|
3007
3007
|
Version.zero = new Version(0, 0, 0);
|
|
@@ -3268,7 +3268,7 @@ var ts;
|
|
|
3268
3268
|
return ts.map(comparators, formatComparator).join(" ");
|
|
3269
3269
|
}
|
|
3270
3270
|
function formatComparator(comparator) {
|
|
3271
|
-
return ""
|
|
3271
|
+
return "".concat(comparator.operator).concat(comparator.operand);
|
|
3272
3272
|
}
|
|
3273
3273
|
})(ts || (ts = {}));
|
|
3274
3274
|
/*@internal*/
|
|
@@ -3566,7 +3566,7 @@ var ts;
|
|
|
3566
3566
|
fs = require("fs");
|
|
3567
3567
|
}
|
|
3568
3568
|
catch (e) {
|
|
3569
|
-
throw new Error("tracing requires having fs\n(original error: "
|
|
3569
|
+
throw new Error("tracing requires having fs\n(original error: ".concat(e.message || e, ")"));
|
|
3570
3570
|
}
|
|
3571
3571
|
}
|
|
3572
3572
|
mode = tracingMode;
|
|
@@ -3578,11 +3578,11 @@ var ts;
|
|
|
3578
3578
|
if (!fs.existsSync(traceDir)) {
|
|
3579
3579
|
fs.mkdirSync(traceDir, { recursive: true });
|
|
3580
3580
|
}
|
|
3581
|
-
var countPart = mode === "build" ? "."
|
|
3582
|
-
: mode === "server" ? "."
|
|
3581
|
+
var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount)
|
|
3582
|
+
: mode === "server" ? ".".concat(process.pid)
|
|
3583
3583
|
: "";
|
|
3584
|
-
var tracePath = ts.combinePaths(traceDir, "trace"
|
|
3585
|
-
var typesPath = ts.combinePaths(traceDir, "types"
|
|
3584
|
+
var tracePath = ts.combinePaths(traceDir, "trace".concat(countPart, ".json"));
|
|
3585
|
+
var typesPath = ts.combinePaths(traceDir, "types".concat(countPart, ".json"));
|
|
3586
3586
|
legend.push({
|
|
3587
3587
|
configFilePath: configFilePath,
|
|
3588
3588
|
tracePath: tracePath,
|
|
@@ -3672,7 +3672,7 @@ var ts;
|
|
|
3672
3672
|
}
|
|
3673
3673
|
// test if [time,endTime) straddles a sampling point
|
|
3674
3674
|
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
|
|
3675
|
-
writeEvent("X", phase, name, args, "\"dur\":"
|
|
3675
|
+
writeEvent("X", phase, name, args, "\"dur\":".concat(endTime - time), time);
|
|
3676
3676
|
}
|
|
3677
3677
|
}
|
|
3678
3678
|
function writeEvent(eventType, phase, name, args, extras, time) {
|
|
@@ -3681,11 +3681,11 @@ var ts;
|
|
|
3681
3681
|
if (mode === "server" && phase === "checkTypes" /* CheckTypes */)
|
|
3682
3682
|
return;
|
|
3683
3683
|
ts.performance.mark("beginTracing");
|
|
3684
|
-
fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\""
|
|
3684
|
+
fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
|
|
3685
3685
|
if (extras)
|
|
3686
|
-
fs.writeSync(traceFd, ","
|
|
3686
|
+
fs.writeSync(traceFd, ",".concat(extras));
|
|
3687
3687
|
if (args)
|
|
3688
|
-
fs.writeSync(traceFd, ",\"args\":"
|
|
3688
|
+
fs.writeSync(traceFd, ",\"args\":".concat(JSON.stringify(args)));
|
|
3689
3689
|
fs.writeSync(traceFd, "}");
|
|
3690
3690
|
ts.performance.mark("endTracing");
|
|
3691
3691
|
ts.performance.measure("Tracing", "beginTracing", "endTracing");
|
|
@@ -4862,8 +4862,6 @@ var ts;
|
|
|
4862
4862
|
// 'Narrowable' types are types where narrowing actually narrows.
|
|
4863
4863
|
// This *should* be every type other than null, undefined, void, and never
|
|
4864
4864
|
TypeFlags[TypeFlags["Narrowable"] = 536624127] = "Narrowable";
|
|
4865
|
-
/* @internal */
|
|
4866
|
-
TypeFlags[TypeFlags["NotPrimitiveUnion"] = 468598819] = "NotPrimitiveUnion";
|
|
4867
4865
|
// The following flags are aggregated during union and intersection type construction
|
|
4868
4866
|
/* @internal */
|
|
4869
4867
|
TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask";
|
|
@@ -4876,6 +4874,10 @@ var ts;
|
|
|
4876
4874
|
TypeFlags[TypeFlags["IncludesWildcard"] = 8388608] = "IncludesWildcard";
|
|
4877
4875
|
/* @internal */
|
|
4878
4876
|
TypeFlags[TypeFlags["IncludesEmptyObject"] = 16777216] = "IncludesEmptyObject";
|
|
4877
|
+
/* @internal */
|
|
4878
|
+
TypeFlags[TypeFlags["IncludesInstantiable"] = 33554432] = "IncludesInstantiable";
|
|
4879
|
+
/* @internal */
|
|
4880
|
+
TypeFlags[TypeFlags["NotPrimitiveUnion"] = 36323363] = "NotPrimitiveUnion";
|
|
4879
4881
|
})(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {}));
|
|
4880
4882
|
// Types included in TypeFlags.ObjectFlagsType have an objectFlags property. Some ObjectFlags
|
|
4881
4883
|
// are specific to certain types and reuse the same bit position. Those ObjectFlags require a check
|
|
@@ -6490,7 +6492,7 @@ var ts;
|
|
|
6490
6492
|
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
|
|
6491
6493
|
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
|
|
6492
6494
|
function getLevel(envVar, level) {
|
|
6493
|
-
return system.getEnvironmentVariable(envVar
|
|
6495
|
+
return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
|
|
6494
6496
|
}
|
|
6495
6497
|
function getCustomLevels(baseVariable) {
|
|
6496
6498
|
var customLevels;
|
|
@@ -6955,7 +6957,7 @@ var ts;
|
|
|
6955
6957
|
}
|
|
6956
6958
|
function onTimerToUpdateChildWatches() {
|
|
6957
6959
|
timerToUpdateChildWatches = undefined;
|
|
6958
|
-
ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: "
|
|
6960
|
+
ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
|
|
6959
6961
|
var start = ts.timestamp();
|
|
6960
6962
|
var invokeMap = new ts.Map();
|
|
6961
6963
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -6968,7 +6970,7 @@ var ts;
|
|
|
6968
6970
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
6969
6971
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
6970
6972
|
}
|
|
6971
|
-
ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: "
|
|
6973
|
+
ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
|
|
6972
6974
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
6973
6975
|
var existing = invokeMap.get(rootDirName);
|
|
6974
6976
|
if (existing) {
|
|
@@ -6984,7 +6986,7 @@ var ts;
|
|
|
6984
6986
|
}
|
|
6985
6987
|
});
|
|
6986
6988
|
var elapsed = ts.timestamp() - start;
|
|
6987
|
-
ts.sysLog("sysLog:: Elapsed:: "
|
|
6989
|
+
ts.sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
|
|
6988
6990
|
}
|
|
6989
6991
|
function removeChildWatches(parentWatcher) {
|
|
6990
6992
|
if (!parentWatcher)
|
|
@@ -7444,7 +7446,7 @@ var ts;
|
|
|
7444
7446
|
var remappedPaths = new ts.Map();
|
|
7445
7447
|
var normalizedDir = ts.normalizeSlashes(__dirname);
|
|
7446
7448
|
// Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
|
|
7447
|
-
var fileUrlRoot = "file://"
|
|
7449
|
+
var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
|
|
7448
7450
|
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
|
|
7449
7451
|
var node = _a[_i];
|
|
7450
7452
|
if (node.callFrame.url) {
|
|
@@ -7453,7 +7455,7 @@ var ts;
|
|
|
7453
7455
|
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
|
|
7454
7456
|
}
|
|
7455
7457
|
else if (!nativePattern.test(url)) {
|
|
7456
|
-
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external"
|
|
7458
|
+
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
|
|
7457
7459
|
externalFileCounter++;
|
|
7458
7460
|
}
|
|
7459
7461
|
}
|
|
@@ -7469,7 +7471,7 @@ var ts;
|
|
|
7469
7471
|
if (!err) {
|
|
7470
7472
|
try {
|
|
7471
7473
|
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
7472
|
-
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-")
|
|
7474
|
+
profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
|
|
7473
7475
|
}
|
|
7474
7476
|
}
|
|
7475
7477
|
catch (_c) {
|
|
@@ -7571,7 +7573,7 @@ var ts;
|
|
|
7571
7573
|
* @param createWatcher
|
|
7572
7574
|
*/
|
|
7573
7575
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
7574
|
-
ts.sysLog("sysLog:: "
|
|
7576
|
+
ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
|
|
7575
7577
|
// Call the callback for current directory
|
|
7576
7578
|
callback("rename", "");
|
|
7577
7579
|
// If watcher is not closed, update it
|
|
@@ -7596,7 +7598,7 @@ var ts;
|
|
|
7596
7598
|
}
|
|
7597
7599
|
}
|
|
7598
7600
|
if (hitSystemWatcherLimit) {
|
|
7599
|
-
ts.sysLog("sysLog:: "
|
|
7601
|
+
ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
|
|
7600
7602
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7601
7603
|
}
|
|
7602
7604
|
try {
|
|
@@ -7612,7 +7614,7 @@ var ts;
|
|
|
7612
7614
|
// Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
|
|
7613
7615
|
// so instead of throwing error, use fs.watchFile
|
|
7614
7616
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
7615
|
-
ts.sysLog("sysLog:: "
|
|
7617
|
+
ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
|
|
7616
7618
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7617
7619
|
}
|
|
7618
7620
|
}
|
|
@@ -7750,7 +7752,7 @@ var ts;
|
|
|
7750
7752
|
}
|
|
7751
7753
|
}
|
|
7752
7754
|
function readDirectory(path, extensions, excludes, includes, depth) {
|
|
7753
|
-
return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath
|
|
7755
|
+
return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
|
|
7754
7756
|
}
|
|
7755
7757
|
function fileSystemEntryExists(path, entryKind) {
|
|
7756
7758
|
// Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
|
|
@@ -9914,7 +9916,7 @@ var ts;
|
|
|
9914
9916
|
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
|
|
9915
9917
|
}
|
|
9916
9918
|
else {
|
|
9917
|
-
ts.Debug.fail("Bad line number. Line: "
|
|
9919
|
+
ts.Debug.fail("Bad line number. Line: ".concat(line, ", lineStarts.length: ").concat(lineStarts.length, " , line map is correct? ").concat(debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
|
|
9918
9920
|
}
|
|
9919
9921
|
}
|
|
9920
9922
|
var res = lineStarts[line] + character;
|
|
@@ -12794,7 +12796,7 @@ var ts;
|
|
|
12794
12796
|
return typeof comment === "string" ? comment
|
|
12795
12797
|
: comment === null || comment === void 0 ? void 0 : comment.map(function (c) {
|
|
12796
12798
|
// TODO: Other kinds here
|
|
12797
|
-
return c.kind === 319 /* JSDocText */ ? c.text : "{@link "
|
|
12799
|
+
return c.kind === 319 /* JSDocText */ ? c.text : "{@link ".concat(c.name ? ts.entityNameToString(c.name) + " " : "").concat(c.text, "}");
|
|
12798
12800
|
}).join("");
|
|
12799
12801
|
}
|
|
12800
12802
|
ts.getTextOfJSDocComment = getTextOfJSDocComment;
|
|
@@ -14064,8 +14066,8 @@ var ts;
|
|
|
14064
14066
|
}
|
|
14065
14067
|
function packageIdToString(_a) {
|
|
14066
14068
|
var name = _a.name, subModuleName = _a.subModuleName, version = _a.version;
|
|
14067
|
-
var fullName = subModuleName ? name
|
|
14068
|
-
return fullName
|
|
14069
|
+
var fullName = subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
|
|
14070
|
+
return "".concat(fullName, "@").concat(version);
|
|
14069
14071
|
}
|
|
14070
14072
|
ts.packageIdToString = packageIdToString;
|
|
14071
14073
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -14144,7 +14146,7 @@ var ts;
|
|
|
14144
14146
|
function nodePosToString(node) {
|
|
14145
14147
|
var file = getSourceFileOfNode(node);
|
|
14146
14148
|
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
|
|
14147
|
-
return file.fileName
|
|
14149
|
+
return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
|
|
14148
14150
|
}
|
|
14149
14151
|
ts.nodePosToString = nodePosToString;
|
|
14150
14152
|
function getEndLinePosition(line, sourceFile) {
|
|
@@ -14283,7 +14285,7 @@ var ts;
|
|
|
14283
14285
|
ts.isPinnedComment = isPinnedComment;
|
|
14284
14286
|
function createCommentDirectivesMap(sourceFile, commentDirectives) {
|
|
14285
14287
|
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
|
|
14286
|
-
""
|
|
14288
|
+
"".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
|
|
14287
14289
|
commentDirective,
|
|
14288
14290
|
]); }));
|
|
14289
14291
|
var usedLines = new ts.Map();
|
|
@@ -14300,10 +14302,10 @@ var ts;
|
|
|
14300
14302
|
});
|
|
14301
14303
|
}
|
|
14302
14304
|
function markUsed(line) {
|
|
14303
|
-
if (!directivesByLine.has(""
|
|
14305
|
+
if (!directivesByLine.has("".concat(line))) {
|
|
14304
14306
|
return false;
|
|
14305
14307
|
}
|
|
14306
|
-
usedLines.set(""
|
|
14308
|
+
usedLines.set("".concat(line), true);
|
|
14307
14309
|
return true;
|
|
14308
14310
|
}
|
|
14309
14311
|
}
|
|
@@ -14518,7 +14520,7 @@ var ts;
|
|
|
14518
14520
|
}
|
|
14519
14521
|
return node.text;
|
|
14520
14522
|
}
|
|
14521
|
-
return ts.Debug.fail("Literal kind '"
|
|
14523
|
+
return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
|
|
14522
14524
|
}
|
|
14523
14525
|
ts.getLiteralText = getLiteralText;
|
|
14524
14526
|
function canUseOriginalText(node, flags) {
|
|
@@ -15826,7 +15828,7 @@ var ts;
|
|
|
15826
15828
|
}
|
|
15827
15829
|
ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
|
|
15828
15830
|
function getExternalModuleRequireArgument(node) {
|
|
15829
|
-
return
|
|
15831
|
+
return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
|
|
15830
15832
|
}
|
|
15831
15833
|
ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;
|
|
15832
15834
|
function isInternalModuleImportEqualsDeclaration(node) {
|
|
@@ -15884,17 +15886,29 @@ var ts;
|
|
|
15884
15886
|
* Returns true if the node is a VariableDeclaration initialized to a require call (see `isRequireCall`).
|
|
15885
15887
|
* This function does not test if the node is in a JavaScript file or not.
|
|
15886
15888
|
*/
|
|
15887
|
-
function
|
|
15889
|
+
function isVariableDeclarationInitializedToRequire(node) {
|
|
15890
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, /*allowAccessedRequire*/ false);
|
|
15891
|
+
}
|
|
15892
|
+
ts.isVariableDeclarationInitializedToRequire = isVariableDeclarationInitializedToRequire;
|
|
15893
|
+
/**
|
|
15894
|
+
* Like {@link isVariableDeclarationInitializedToRequire} but allows things like `require("...").foo.bar` or `require("...")["baz"]`.
|
|
15895
|
+
*/
|
|
15896
|
+
function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
|
|
15897
|
+
return isVariableDeclarationInitializedWithRequireHelper(node, /*allowAccessedRequire*/ true);
|
|
15898
|
+
}
|
|
15899
|
+
ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
|
|
15900
|
+
function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
|
|
15888
15901
|
if (node.kind === 202 /* BindingElement */) {
|
|
15889
15902
|
node = node.parent.parent;
|
|
15890
15903
|
}
|
|
15891
|
-
return ts.isVariableDeclaration(node) &&
|
|
15904
|
+
return ts.isVariableDeclaration(node) &&
|
|
15905
|
+
!!node.initializer &&
|
|
15906
|
+
isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, /*requireStringLiteralLikeArgument*/ true);
|
|
15892
15907
|
}
|
|
15893
|
-
ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
|
|
15894
15908
|
function isRequireVariableStatement(node) {
|
|
15895
15909
|
return ts.isVariableStatement(node)
|
|
15896
15910
|
&& node.declarationList.declarations.length > 0
|
|
15897
|
-
&& ts.every(node.declarationList.declarations, function (decl) { return
|
|
15911
|
+
&& ts.every(node.declarationList.declarations, function (decl) { return isVariableDeclarationInitializedToRequire(decl); });
|
|
15898
15912
|
}
|
|
15899
15913
|
ts.isRequireVariableStatement = isRequireVariableStatement;
|
|
15900
15914
|
function isSingleOrDoubleQuote(charCode) {
|
|
@@ -17049,11 +17063,11 @@ var ts;
|
|
|
17049
17063
|
}
|
|
17050
17064
|
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
|
|
17051
17065
|
function getPropertyNameForUniqueESSymbol(symbol) {
|
|
17052
|
-
return "__@"
|
|
17066
|
+
return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
|
|
17053
17067
|
}
|
|
17054
17068
|
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
|
|
17055
17069
|
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
|
|
17056
|
-
return "__#"
|
|
17070
|
+
return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
|
|
17057
17071
|
}
|
|
17058
17072
|
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
|
|
17059
17073
|
function isKnownSymbol(symbol) {
|
|
@@ -19746,7 +19760,7 @@ var ts;
|
|
|
19746
19760
|
}
|
|
19747
19761
|
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
|
|
19748
19762
|
function getJSXRuntimeImport(base, options) {
|
|
19749
|
-
return base ? base
|
|
19763
|
+
return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
|
|
19750
19764
|
}
|
|
19751
19765
|
ts.getJSXRuntimeImport = getJSXRuntimeImport;
|
|
19752
19766
|
function hasZeroOrOneAsteriskCharacter(str) {
|
|
@@ -19863,7 +19877,7 @@ var ts;
|
|
|
19863
19877
|
}
|
|
19864
19878
|
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
|
|
19865
19879
|
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
|
|
19866
|
-
var implicitExcludePathRegexPattern = "(?!("
|
|
19880
|
+
var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
|
|
19867
19881
|
var filesMatcher = {
|
|
19868
19882
|
/**
|
|
19869
19883
|
* Matches any single directory segment unless it is the last segment and a .min.js file
|
|
@@ -19876,7 +19890,7 @@ var ts;
|
|
|
19876
19890
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
19877
19891
|
* files or directories, does not match subdirectories that start with a . character
|
|
19878
19892
|
*/
|
|
19879
|
-
doubleAsteriskRegexFragment: "(/"
|
|
19893
|
+
doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
|
|
19880
19894
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
|
|
19881
19895
|
};
|
|
19882
19896
|
var directoriesMatcher = {
|
|
@@ -19885,7 +19899,7 @@ var ts;
|
|
|
19885
19899
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
19886
19900
|
* files or directories, does not match subdirectories that start with a . character
|
|
19887
19901
|
*/
|
|
19888
|
-
doubleAsteriskRegexFragment: "(/"
|
|
19902
|
+
doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
|
|
19889
19903
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
|
|
19890
19904
|
};
|
|
19891
19905
|
var excludeMatcher = {
|
|
@@ -19903,10 +19917,10 @@ var ts;
|
|
|
19903
19917
|
if (!patterns || !patterns.length) {
|
|
19904
19918
|
return undefined;
|
|
19905
19919
|
}
|
|
19906
|
-
var pattern = patterns.map(function (pattern) { return "("
|
|
19920
|
+
var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
|
|
19907
19921
|
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
|
|
19908
19922
|
var terminator = usage === "exclude" ? "($|/)" : "$";
|
|
19909
|
-
return "^("
|
|
19923
|
+
return "^(".concat(pattern, ")").concat(terminator);
|
|
19910
19924
|
}
|
|
19911
19925
|
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
|
|
19912
19926
|
function getRegularExpressionsForWildcards(specs, basePath, usage) {
|
|
@@ -19928,7 +19942,7 @@ var ts;
|
|
|
19928
19942
|
ts.isImplicitGlob = isImplicitGlob;
|
|
19929
19943
|
function getPatternFromSpec(spec, basePath, usage) {
|
|
19930
19944
|
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
|
|
19931
|
-
return pattern && "^("
|
|
19945
|
+
return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
|
|
19932
19946
|
}
|
|
19933
19947
|
ts.getPatternFromSpec = getPatternFromSpec;
|
|
19934
19948
|
function getSubPatternFromSpec(spec, basePath, usage, _a) {
|
|
@@ -20006,11 +20020,11 @@ var ts;
|
|
|
20006
20020
|
currentDirectory = ts.normalizePath(currentDirectory);
|
|
20007
20021
|
var absolutePath = ts.combinePaths(currentDirectory, path);
|
|
20008
20022
|
return {
|
|
20009
|
-
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^"
|
|
20023
|
+
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
|
|
20010
20024
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
20011
20025
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
20012
20026
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
20013
|
-
basePaths: getBasePaths(
|
|
20027
|
+
basePaths: getBasePaths(path, includes, useCaseSensitiveFileNames)
|
|
20014
20028
|
};
|
|
20015
20029
|
}
|
|
20016
20030
|
ts.getFileMatcherPatterns = getFileMatcherPatterns;
|
|
@@ -20019,7 +20033,7 @@ var ts;
|
|
|
20019
20033
|
}
|
|
20020
20034
|
ts.getRegexFromPattern = getRegexFromPattern;
|
|
20021
20035
|
/** @param path directory of the tsconfig.json */
|
|
20022
|
-
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath
|
|
20036
|
+
function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) {
|
|
20023
20037
|
path = ts.normalizePath(path);
|
|
20024
20038
|
currentDirectory = ts.normalizePath(currentDirectory);
|
|
20025
20039
|
var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory);
|
|
@@ -20032,20 +20046,18 @@ var ts;
|
|
|
20032
20046
|
var visited = new ts.Map();
|
|
20033
20047
|
var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
20034
20048
|
for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
|
|
20035
|
-
var
|
|
20036
|
-
|
|
20037
|
-
visitDirectory(absoluteBasePath, depth);
|
|
20038
|
-
}
|
|
20049
|
+
var basePath = _a[_i];
|
|
20050
|
+
visitDirectory(basePath, ts.combinePaths(currentDirectory, basePath), depth);
|
|
20039
20051
|
}
|
|
20040
20052
|
return ts.flatten(results);
|
|
20041
|
-
function visitDirectory(absolutePath, depth) {
|
|
20053
|
+
function visitDirectory(path, absolutePath, depth) {
|
|
20042
20054
|
var canonicalPath = toCanonical(realpath(absolutePath));
|
|
20043
20055
|
if (visited.has(canonicalPath))
|
|
20044
20056
|
return;
|
|
20045
20057
|
visited.set(canonicalPath, true);
|
|
20046
|
-
var _a = getFileSystemEntries(
|
|
20058
|
+
var _a = getFileSystemEntries(path), files = _a.files, directories = _a.directories;
|
|
20047
20059
|
var _loop_1 = function (current) {
|
|
20048
|
-
var name = ts.combinePaths(
|
|
20060
|
+
var name = ts.combinePaths(path, current);
|
|
20049
20061
|
var absoluteName = ts.combinePaths(absolutePath, current);
|
|
20050
20062
|
if (extensions && !ts.fileExtensionIsOneOf(name, extensions))
|
|
20051
20063
|
return "continue";
|
|
@@ -20073,10 +20085,11 @@ var ts;
|
|
|
20073
20085
|
}
|
|
20074
20086
|
for (var _c = 0, _d = ts.sort(directories, ts.compareStringsCaseSensitive); _c < _d.length; _c++) {
|
|
20075
20087
|
var current = _d[_c];
|
|
20088
|
+
var name = ts.combinePaths(path, current);
|
|
20076
20089
|
var absoluteName = ts.combinePaths(absolutePath, current);
|
|
20077
20090
|
if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) &&
|
|
20078
20091
|
(!excludeRegex || !excludeRegex.test(absoluteName))) {
|
|
20079
|
-
visitDirectory(absoluteName, depth);
|
|
20092
|
+
visitDirectory(name, absoluteName, depth);
|
|
20080
20093
|
}
|
|
20081
20094
|
}
|
|
20082
20095
|
}
|
|
@@ -20084,11 +20097,10 @@ var ts;
|
|
|
20084
20097
|
ts.matchFiles = matchFiles;
|
|
20085
20098
|
/**
|
|
20086
20099
|
* Computes the unique non-wildcard base paths amongst the provided include patterns.
|
|
20087
|
-
* @returns Absolute directory paths
|
|
20088
20100
|
*/
|
|
20089
|
-
function getBasePaths(
|
|
20101
|
+
function getBasePaths(path, includes, useCaseSensitiveFileNames) {
|
|
20090
20102
|
// Storage for our results in the form of literal paths (e.g. the paths as written by the user).
|
|
20091
|
-
var basePaths = [
|
|
20103
|
+
var basePaths = [path];
|
|
20092
20104
|
if (includes) {
|
|
20093
20105
|
// Storage for literal base paths amongst the include patterns.
|
|
20094
20106
|
var includeBasePaths = [];
|
|
@@ -20096,14 +20108,14 @@ var ts;
|
|
|
20096
20108
|
var include = includes_1[_i];
|
|
20097
20109
|
// We also need to check the relative paths by converting them to absolute and normalizing
|
|
20098
20110
|
// in case they escape the base path (e.g "..\somedirectory")
|
|
20099
|
-
var
|
|
20111
|
+
var absolute = ts.isRootedDiskPath(include) ? include : ts.normalizePath(ts.combinePaths(path, include));
|
|
20100
20112
|
// Append the literal and canonical candidate base paths.
|
|
20101
|
-
includeBasePaths.push(getIncludeBasePath(
|
|
20113
|
+
includeBasePaths.push(getIncludeBasePath(absolute));
|
|
20102
20114
|
}
|
|
20103
20115
|
// Sort the offsets array using either the literal or canonical path representations.
|
|
20104
20116
|
includeBasePaths.sort(ts.getStringComparer(!useCaseSensitiveFileNames));
|
|
20105
20117
|
var _loop_2 = function (includeBasePath) {
|
|
20106
|
-
if (ts.every(basePaths, function (basePath) { return !ts.containsPath(basePath, includeBasePath,
|
|
20118
|
+
if (ts.every(basePaths, function (basePath) { return !ts.containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) {
|
|
20107
20119
|
basePaths.push(includeBasePath);
|
|
20108
20120
|
}
|
|
20109
20121
|
};
|
|
@@ -20289,7 +20301,7 @@ var ts;
|
|
|
20289
20301
|
*/
|
|
20290
20302
|
function extensionFromPath(path) {
|
|
20291
20303
|
var ext = tryGetExtensionFromPath(path);
|
|
20292
|
-
return ext !== undefined ? ext : ts.Debug.fail("File "
|
|
20304
|
+
return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
|
|
20293
20305
|
}
|
|
20294
20306
|
ts.extensionFromPath = extensionFromPath;
|
|
20295
20307
|
function isAnySupportedFileExtension(path) {
|
|
@@ -26278,7 +26290,7 @@ var ts;
|
|
|
26278
26290
|
case 326 /* JSDocAugmentsTag */: return "augments";
|
|
26279
26291
|
case 327 /* JSDocImplementsTag */: return "implements";
|
|
26280
26292
|
default:
|
|
26281
|
-
return ts.Debug.fail("Unsupported kind: "
|
|
26293
|
+
return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
|
|
26282
26294
|
}
|
|
26283
26295
|
}
|
|
26284
26296
|
var rawTextScanner;
|
|
@@ -26606,7 +26618,7 @@ var ts;
|
|
|
26606
26618
|
};
|
|
26607
26619
|
var definedTextGetter_1 = function (path) {
|
|
26608
26620
|
var result = textGetter_1(path);
|
|
26609
|
-
return result !== undefined ? result : "/* Input file "
|
|
26621
|
+
return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
|
|
26610
26622
|
};
|
|
26611
26623
|
var buildInfo_1;
|
|
26612
26624
|
var getAndCacheBuildInfo_1 = function (getText) {
|
|
@@ -31144,7 +31156,7 @@ var ts;
|
|
|
31144
31156
|
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
|
|
31145
31157
|
var keyword = viableKeywordSuggestions_1[_i];
|
|
31146
31158
|
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
|
|
31147
|
-
return keyword
|
|
31159
|
+
return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
|
|
31148
31160
|
}
|
|
31149
31161
|
}
|
|
31150
31162
|
return undefined;
|
|
@@ -37908,7 +37920,7 @@ var ts;
|
|
|
37908
37920
|
if (namedArgRegExCache.has(name)) {
|
|
37909
37921
|
return namedArgRegExCache.get(name);
|
|
37910
37922
|
}
|
|
37911
|
-
var result = new RegExp("(\\s"
|
|
37923
|
+
var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
|
|
37912
37924
|
namedArgRegExCache.set(name, result);
|
|
37913
37925
|
return result;
|
|
37914
37926
|
}
|
|
@@ -39370,8 +39382,8 @@ var ts;
|
|
|
39370
39382
|
}
|
|
39371
39383
|
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
|
|
39372
39384
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
39373
|
-
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'"
|
|
39374
|
-
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--"
|
|
39385
|
+
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
|
|
39386
|
+
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
|
|
39375
39387
|
}
|
|
39376
39388
|
/* @internal */
|
|
39377
39389
|
function parseCustomTypeOption(opt, value, errors) {
|
|
@@ -40165,10 +40177,10 @@ var ts;
|
|
|
40165
40177
|
var newValue = compilerOptionsMap.get(cmd.name);
|
|
40166
40178
|
var defaultValue = getDefaultValueForOption(cmd);
|
|
40167
40179
|
if (newValue !== defaultValue) {
|
|
40168
|
-
result.push(""
|
|
40180
|
+
result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
|
|
40169
40181
|
}
|
|
40170
40182
|
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
|
|
40171
|
-
result.push(""
|
|
40183
|
+
result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
|
|
40172
40184
|
}
|
|
40173
40185
|
});
|
|
40174
40186
|
return result.join(newLine) + newLine;
|
|
@@ -40219,19 +40231,19 @@ var ts;
|
|
|
40219
40231
|
if (entries.length !== 0) {
|
|
40220
40232
|
entries.push({ value: "" });
|
|
40221
40233
|
}
|
|
40222
|
-
entries.push({ value: "/* "
|
|
40234
|
+
entries.push({ value: "/* ".concat(category, " */") });
|
|
40223
40235
|
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
40224
40236
|
var option = options_1[_i];
|
|
40225
40237
|
var optionName = void 0;
|
|
40226
40238
|
if (compilerOptionsMap.has(option.name)) {
|
|
40227
|
-
optionName = "\""
|
|
40239
|
+
optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
|
|
40228
40240
|
}
|
|
40229
40241
|
else {
|
|
40230
|
-
optionName = "// \""
|
|
40242
|
+
optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
|
|
40231
40243
|
}
|
|
40232
40244
|
entries.push({
|
|
40233
40245
|
value: optionName,
|
|
40234
|
-
description: "/* "
|
|
40246
|
+
description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
|
|
40235
40247
|
});
|
|
40236
40248
|
marginLength = Math.max(optionName.length, marginLength);
|
|
40237
40249
|
}
|
|
@@ -40240,25 +40252,25 @@ var ts;
|
|
|
40240
40252
|
var tab = makePadding(2);
|
|
40241
40253
|
var result = [];
|
|
40242
40254
|
result.push("{");
|
|
40243
|
-
result.push(tab
|
|
40244
|
-
result.push(""
|
|
40255
|
+
result.push("".concat(tab, "\"compilerOptions\": {"));
|
|
40256
|
+
result.push("".concat(tab).concat(tab, "/* ").concat(ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file), " */"));
|
|
40245
40257
|
result.push("");
|
|
40246
40258
|
// Print out each row, aligning all the descriptions on the same column.
|
|
40247
40259
|
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
|
|
40248
40260
|
var entry = entries_2[_a];
|
|
40249
40261
|
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
|
|
40250
|
-
result.push(value && ""
|
|
40262
|
+
result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
|
|
40251
40263
|
}
|
|
40252
40264
|
if (fileNames.length) {
|
|
40253
|
-
result.push(tab
|
|
40254
|
-
result.push(tab
|
|
40265
|
+
result.push("".concat(tab, "},"));
|
|
40266
|
+
result.push("".concat(tab, "\"files\": ["));
|
|
40255
40267
|
for (var i = 0; i < fileNames.length; i++) {
|
|
40256
|
-
result.push(""
|
|
40268
|
+
result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
|
|
40257
40269
|
}
|
|
40258
|
-
result.push(tab
|
|
40270
|
+
result.push("".concat(tab, "]"));
|
|
40259
40271
|
}
|
|
40260
40272
|
else {
|
|
40261
|
-
result.push(tab
|
|
40273
|
+
result.push("".concat(tab, "}"));
|
|
40262
40274
|
}
|
|
40263
40275
|
result.push("}");
|
|
40264
40276
|
return result.join(newLine) + newLine;
|
|
@@ -40656,7 +40668,7 @@ var ts;
|
|
|
40656
40668
|
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
|
|
40657
40669
|
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
|
|
40658
40670
|
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
|
|
40659
|
-
extendedConfigPath = extendedConfigPath
|
|
40671
|
+
extendedConfigPath = "".concat(extendedConfigPath, ".json");
|
|
40660
40672
|
if (!host.fileExists(extendedConfigPath)) {
|
|
40661
40673
|
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
|
|
40662
40674
|
return undefined;
|
|
@@ -40901,7 +40913,7 @@ var ts;
|
|
|
40901
40913
|
// Valid only if *.json specified
|
|
40902
40914
|
if (!jsonOnlyIncludeRegexes) {
|
|
40903
40915
|
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
|
|
40904
|
-
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^"
|
|
40916
|
+
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
|
|
40905
40917
|
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
|
|
40906
40918
|
}
|
|
40907
40919
|
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
|
|
@@ -41337,7 +41349,7 @@ var ts;
|
|
|
41337
41349
|
var bestVersionKey = result.version, bestVersionPaths = result.paths;
|
|
41338
41350
|
if (typeof bestVersionPaths !== "object") {
|
|
41339
41351
|
if (state.traceEnabled) {
|
|
41340
|
-
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['"
|
|
41352
|
+
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
|
|
41341
41353
|
}
|
|
41342
41354
|
return;
|
|
41343
41355
|
}
|
|
@@ -41448,7 +41460,10 @@ var ts;
|
|
|
41448
41460
|
}
|
|
41449
41461
|
}
|
|
41450
41462
|
var failedLookupLocations = [];
|
|
41451
|
-
var
|
|
41463
|
+
var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
|
|
41464
|
+
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
41465
|
+
NodeResolutionFeatures.None;
|
|
41466
|
+
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
|
|
41452
41467
|
var resolved = primaryLookup();
|
|
41453
41468
|
var primary = true;
|
|
41454
41469
|
if (!resolved) {
|
|
@@ -41715,7 +41730,7 @@ var ts;
|
|
|
41715
41730
|
};
|
|
41716
41731
|
return cache;
|
|
41717
41732
|
function getUnderlyingCacheKey(specifier, mode) {
|
|
41718
|
-
var result = mode === undefined ? specifier : mode
|
|
41733
|
+
var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
|
|
41719
41734
|
memoizedReverseKeys.set(result, [specifier, mode]);
|
|
41720
41735
|
return result;
|
|
41721
41736
|
}
|
|
@@ -41746,7 +41761,7 @@ var ts;
|
|
|
41746
41761
|
}
|
|
41747
41762
|
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
|
|
41748
41763
|
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
|
|
41749
|
-
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode
|
|
41764
|
+
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
|
|
41750
41765
|
}
|
|
41751
41766
|
function createPerModuleNameCache() {
|
|
41752
41767
|
var directoryPathMap = new ts.Map();
|
|
@@ -41893,10 +41908,10 @@ var ts;
|
|
|
41893
41908
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
41894
41909
|
break;
|
|
41895
41910
|
default:
|
|
41896
|
-
return ts.Debug.fail("Unexpected moduleResolution: "
|
|
41911
|
+
return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
|
|
41897
41912
|
}
|
|
41898
41913
|
if (result && result.resolvedModule)
|
|
41899
|
-
ts.perfLogger.logInfoEvent("Module \""
|
|
41914
|
+
ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
|
|
41900
41915
|
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
41901
41916
|
if (perFolderCache) {
|
|
41902
41917
|
perFolderCache.set(moduleName, resolutionMode, result);
|
|
@@ -42099,7 +42114,7 @@ var ts;
|
|
|
42099
42114
|
function resolveJSModule(moduleName, initialDir, host) {
|
|
42100
42115
|
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
|
|
42101
42116
|
if (!resolvedModule) {
|
|
42102
|
-
throw new Error("Could not resolve JS module '"
|
|
42117
|
+
throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
|
|
42103
42118
|
}
|
|
42104
42119
|
return resolvedModule.resolvedFileName;
|
|
42105
42120
|
}
|
|
@@ -42123,13 +42138,15 @@ var ts;
|
|
|
42123
42138
|
// not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
|
|
42124
42139
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
42125
42140
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
42141
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
|
|
42142
|
+
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
42126
42143
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
42127
42144
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
42128
42145
|
function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42129
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42146
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42130
42147
|
}
|
|
42131
42148
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42132
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42149
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42133
42150
|
}
|
|
42134
42151
|
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42135
42152
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
@@ -42212,7 +42229,7 @@ var ts;
|
|
|
42212
42229
|
if (traceEnabled) {
|
|
42213
42230
|
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
|
|
42214
42231
|
}
|
|
42215
|
-
ts.Debug.assert(host.fileExists(real), path
|
|
42232
|
+
ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
|
|
42216
42233
|
return real;
|
|
42217
42234
|
}
|
|
42218
42235
|
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
@@ -42598,7 +42615,7 @@ var ts;
|
|
|
42598
42615
|
return undefined;
|
|
42599
42616
|
}
|
|
42600
42617
|
var trailingParts = parts.slice(nameParts.length);
|
|
42601
|
-
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "."
|
|
42618
|
+
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
|
|
42602
42619
|
}
|
|
42603
42620
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
42604
42621
|
if (!scope.packageJsonContent.exports) {
|
|
@@ -42926,7 +42943,7 @@ var ts;
|
|
|
42926
42943
|
}
|
|
42927
42944
|
/* @internal */
|
|
42928
42945
|
function getTypesPackageName(packageName) {
|
|
42929
|
-
return "@types/"
|
|
42946
|
+
return "@types/".concat(mangleScopedPackageName(packageName));
|
|
42930
42947
|
}
|
|
42931
42948
|
ts.getTypesPackageName = getTypesPackageName;
|
|
42932
42949
|
/* @internal */
|
|
@@ -43327,7 +43344,7 @@ var ts;
|
|
|
43327
43344
|
if (name) {
|
|
43328
43345
|
if (ts.isAmbientModule(node)) {
|
|
43329
43346
|
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
|
|
43330
|
-
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\""
|
|
43347
|
+
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
|
|
43331
43348
|
}
|
|
43332
43349
|
if (name.kind === 161 /* ComputedPropertyName */) {
|
|
43333
43350
|
var nameExpression = name.expression;
|
|
@@ -43384,7 +43401,7 @@ var ts;
|
|
|
43384
43401
|
case 163 /* Parameter */:
|
|
43385
43402
|
// Parameters with names are handled at the top of this function. Parameters
|
|
43386
43403
|
// without names can only come from JSDocFunctionTypes.
|
|
43387
|
-
ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: "
|
|
43404
|
+
ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: ".concat(ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind, ", expected JSDocFunctionType"); });
|
|
43388
43405
|
var functionType = node.parent;
|
|
43389
43406
|
var index = functionType.parameters.indexOf(node);
|
|
43390
43407
|
return "arg" + index;
|
|
@@ -43496,7 +43513,7 @@ var ts;
|
|
|
43496
43513
|
var relatedInformation_1 = [];
|
|
43497
43514
|
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
|
|
43498
43515
|
// export type T; - may have meant export type { T }?
|
|
43499
|
-
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { "
|
|
43516
|
+
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
|
|
43500
43517
|
}
|
|
43501
43518
|
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
|
|
43502
43519
|
ts.forEach(symbol.declarations, function (declaration, index) {
|
|
@@ -45569,7 +45586,7 @@ var ts;
|
|
|
45569
45586
|
}
|
|
45570
45587
|
}
|
|
45571
45588
|
function bindSourceFileAsExternalModule() {
|
|
45572
|
-
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\""
|
|
45589
|
+
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
|
|
45573
45590
|
}
|
|
45574
45591
|
function bindExportAssignment(node) {
|
|
45575
45592
|
if (!container.symbol || !container.symbol.exports) {
|
|
@@ -46048,7 +46065,7 @@ var ts;
|
|
|
46048
46065
|
checkStrictModeEvalOrArguments(node, node.name);
|
|
46049
46066
|
}
|
|
46050
46067
|
if (!ts.isBindingPattern(node.name)) {
|
|
46051
|
-
if (ts.isInJSFile(node) && ts.
|
|
46068
|
+
if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node)) {
|
|
46052
46069
|
declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */);
|
|
46053
46070
|
}
|
|
46054
46071
|
else if (ts.isBlockOrCatchScoped(node)) {
|
|
@@ -47658,7 +47675,7 @@ var ts;
|
|
|
47658
47675
|
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
|
|
47659
47676
|
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
|
|
47660
47677
|
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
|
|
47661
|
-
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path
|
|
47678
|
+
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
|
|
47662
47679
|
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
|
|
47663
47680
|
});
|
|
47664
47681
|
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
|
|
@@ -48092,11 +48109,12 @@ var ts;
|
|
|
48092
48109
|
*
|
|
48093
48110
|
* @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters.
|
|
48094
48111
|
*/
|
|
48095
|
-
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) {
|
|
48112
|
+
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) {
|
|
48096
48113
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
48097
|
-
|
|
48114
|
+
if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; }
|
|
48115
|
+
return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol);
|
|
48098
48116
|
}
|
|
48099
|
-
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) {
|
|
48117
|
+
function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) {
|
|
48100
48118
|
var _a, _b, _c;
|
|
48101
48119
|
var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location
|
|
48102
48120
|
var result;
|
|
@@ -48413,7 +48431,7 @@ var ts;
|
|
|
48413
48431
|
}
|
|
48414
48432
|
}
|
|
48415
48433
|
if (!result) {
|
|
48416
|
-
if (nameNotFoundMessage) {
|
|
48434
|
+
if (nameNotFoundMessage && produceDiagnostics) {
|
|
48417
48435
|
if (!errorLocation ||
|
|
48418
48436
|
!checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217
|
|
48419
48437
|
!checkAndReportErrorForExtendingInterface(errorLocation) &&
|
|
@@ -48423,7 +48441,7 @@ var ts;
|
|
|
48423
48441
|
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
|
|
48424
48442
|
!checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
|
|
48425
48443
|
var suggestion = void 0;
|
|
48426
|
-
if (suggestionCount < maximumSuggestionCount) {
|
|
48444
|
+
if (getSpellingSuggestions && suggestionCount < maximumSuggestionCount) {
|
|
48427
48445
|
suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning);
|
|
48428
48446
|
var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration);
|
|
48429
48447
|
if (isGlobalScopeAugmentationDeclaration) {
|
|
@@ -48459,7 +48477,7 @@ var ts;
|
|
|
48459
48477
|
return undefined;
|
|
48460
48478
|
}
|
|
48461
48479
|
// Perform extra checks only if error reporting was requested
|
|
48462
|
-
if (nameNotFoundMessage) {
|
|
48480
|
+
if (nameNotFoundMessage && produceDiagnostics) {
|
|
48463
48481
|
if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields)) {
|
|
48464
48482
|
// We have a match, but the reference occurred within a property initializer and the identifier also binds
|
|
48465
48483
|
// to a local variable in the constructor where the code will be emitted. Note that this is actually allowed
|
|
@@ -48826,7 +48844,7 @@ var ts;
|
|
|
48826
48844
|
&& isAliasableOrJsExpression(node.parent.right)
|
|
48827
48845
|
|| node.kind === 295 /* ShorthandPropertyAssignment */
|
|
48828
48846
|
|| node.kind === 294 /* PropertyAssignment */ && isAliasableOrJsExpression(node.initializer)
|
|
48829
|
-
|| ts.
|
|
48847
|
+
|| ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
|
|
48830
48848
|
}
|
|
48831
48849
|
function isAliasableOrJsExpression(e) {
|
|
48832
48850
|
return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
|
|
@@ -49797,7 +49815,7 @@ var ts;
|
|
|
49797
49815
|
if (!sigs || !sigs.length) {
|
|
49798
49816
|
sigs = getSignaturesOfStructuredType(type, 1 /* Construct */);
|
|
49799
49817
|
}
|
|
49800
|
-
if ((sigs && sigs.length) || getPropertyOfType(type, "default" /* Default */)) {
|
|
49818
|
+
if ((sigs && sigs.length) || getPropertyOfType(type, "default" /* Default */, /*skipObjectFunctionPropertyAugment*/ true)) {
|
|
49801
49819
|
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
49802
49820
|
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
49803
49821
|
}
|
|
@@ -50297,7 +50315,7 @@ var ts;
|
|
|
50297
50315
|
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
|
|
50298
50316
|
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
|
|
50299
50317
|
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
|
|
50300
|
-
var key = (useOnlyExternalAliasing ? 0 : 1
|
|
50318
|
+
var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
|
|
50301
50319
|
if (cache.has(key)) {
|
|
50302
50320
|
return cache.get(key);
|
|
50303
50321
|
}
|
|
@@ -51145,7 +51163,7 @@ var ts;
|
|
|
51145
51163
|
context.symbolDepth = new ts.Map();
|
|
51146
51164
|
}
|
|
51147
51165
|
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
|
51148
|
-
var key = getTypeId(type)
|
|
51166
|
+
var key = "".concat(getTypeId(type), "|").concat(context.flags);
|
|
51149
51167
|
if (links) {
|
|
51150
51168
|
links.serializedTypes || (links.serializedTypes = new ts.Map());
|
|
51151
51169
|
}
|
|
@@ -51414,7 +51432,7 @@ var ts;
|
|
|
51414
51432
|
}
|
|
51415
51433
|
}
|
|
51416
51434
|
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
|
|
51417
|
-
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... "
|
|
51435
|
+
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
|
|
51418
51436
|
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
|
|
51419
51437
|
break;
|
|
51420
51438
|
}
|
|
@@ -51529,7 +51547,7 @@ var ts;
|
|
|
51529
51547
|
else if (types.length > 2) {
|
|
51530
51548
|
return [
|
|
51531
51549
|
typeToTypeNodeHelper(types[0], context),
|
|
51532
|
-
ts.factory.createTypeReferenceNode("... "
|
|
51550
|
+
ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
|
|
51533
51551
|
typeToTypeNodeHelper(types[types.length - 1], context)
|
|
51534
51552
|
];
|
|
51535
51553
|
}
|
|
@@ -51543,7 +51561,7 @@ var ts;
|
|
|
51543
51561
|
var type = types_2[_i];
|
|
51544
51562
|
i++;
|
|
51545
51563
|
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
|
|
51546
|
-
result_5.push(ts.factory.createTypeReferenceNode("... "
|
|
51564
|
+
result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
|
|
51547
51565
|
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
|
|
51548
51566
|
if (typeNode_1) {
|
|
51549
51567
|
result_5.push(typeNode_1);
|
|
@@ -52051,7 +52069,7 @@ var ts;
|
|
|
52051
52069
|
var text = rawtext;
|
|
52052
52070
|
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
|
|
52053
52071
|
i++;
|
|
52054
|
-
text = rawtext
|
|
52072
|
+
text = "".concat(rawtext, "_").concat(i);
|
|
52055
52073
|
}
|
|
52056
52074
|
if (text !== rawtext) {
|
|
52057
52075
|
result = ts.factory.createIdentifier(text, result.typeArguments);
|
|
@@ -52377,7 +52395,7 @@ var ts;
|
|
|
52377
52395
|
function getNameForJSDocFunctionParameter(p, index) {
|
|
52378
52396
|
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
|
|
52379
52397
|
: getEffectiveDotDotDotForParameter(p) ? "args"
|
|
52380
|
-
: "arg"
|
|
52398
|
+
: "arg".concat(index);
|
|
52381
52399
|
}
|
|
52382
52400
|
function rewriteModuleSpecifier(parent, lit) {
|
|
52383
52401
|
if (bundled) {
|
|
@@ -53462,7 +53480,7 @@ var ts;
|
|
|
53462
53480
|
return results_1;
|
|
53463
53481
|
}
|
|
53464
53482
|
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
|
|
53465
|
-
return ts.Debug.fail("Unhandled class member kind! "
|
|
53483
|
+
return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
|
|
53466
53484
|
};
|
|
53467
53485
|
}
|
|
53468
53486
|
function serializePropertySymbolForInterface(p, baseType) {
|
|
@@ -53537,7 +53555,7 @@ var ts;
|
|
|
53537
53555
|
if (ref) {
|
|
53538
53556
|
return ref;
|
|
53539
53557
|
}
|
|
53540
|
-
var tempName = getUnusedName(rootName
|
|
53558
|
+
var tempName = getUnusedName("".concat(rootName, "_base"));
|
|
53541
53559
|
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
|
|
53542
53560
|
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
|
|
53543
53561
|
], 2 /* Const */));
|
|
@@ -53584,7 +53602,7 @@ var ts;
|
|
|
53584
53602
|
var original = input;
|
|
53585
53603
|
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
|
|
53586
53604
|
i++;
|
|
53587
|
-
input = original
|
|
53605
|
+
input = "".concat(original, "_").concat(i);
|
|
53588
53606
|
}
|
|
53589
53607
|
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
|
|
53590
53608
|
if (id) {
|
|
@@ -53692,15 +53710,15 @@ var ts;
|
|
|
53692
53710
|
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
|
|
53693
53711
|
var name = "" + nameType.value;
|
|
53694
53712
|
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
|
|
53695
|
-
return "\""
|
|
53713
|
+
return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
|
|
53696
53714
|
}
|
|
53697
53715
|
if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
53698
|
-
return "["
|
|
53716
|
+
return "[".concat(name, "]");
|
|
53699
53717
|
}
|
|
53700
53718
|
return name;
|
|
53701
53719
|
}
|
|
53702
53720
|
if (nameType.flags & 8192 /* UniqueESSymbol */) {
|
|
53703
|
-
return "["
|
|
53721
|
+
return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
|
|
53704
53722
|
}
|
|
53705
53723
|
}
|
|
53706
53724
|
}
|
|
@@ -56474,7 +56492,7 @@ var ts;
|
|
|
56474
56492
|
!leftName ? rightName :
|
|
56475
56493
|
!rightName ? leftName :
|
|
56476
56494
|
undefined;
|
|
56477
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
56495
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
|
|
56478
56496
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
56479
56497
|
params[i] = paramSymbol;
|
|
56480
56498
|
}
|
|
@@ -58393,7 +58411,7 @@ var ts;
|
|
|
58393
58411
|
return result;
|
|
58394
58412
|
}
|
|
58395
58413
|
function getAliasId(aliasSymbol, aliasTypeArguments) {
|
|
58396
|
-
return aliasSymbol ? "@"
|
|
58414
|
+
return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
|
|
58397
58415
|
}
|
|
58398
58416
|
// This function is used to propagate certain flags when creating new object type references and union types.
|
|
58399
58417
|
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
|
|
@@ -58579,7 +58597,7 @@ var ts;
|
|
|
58579
58597
|
return undefined;
|
|
58580
58598
|
}
|
|
58581
58599
|
function getSymbolPath(symbol) {
|
|
58582
|
-
return symbol.parent ? getSymbolPath(symbol.parent)
|
|
58600
|
+
return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
|
|
58583
58601
|
}
|
|
58584
58602
|
function getUnresolvedSymbolForEntityName(name) {
|
|
58585
58603
|
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
|
|
@@ -58590,7 +58608,7 @@ var ts;
|
|
|
58590
58608
|
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
|
|
58591
58609
|
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
|
|
58592
58610
|
undefined;
|
|
58593
|
-
var path = parentSymbol ? getSymbolPath(parentSymbol)
|
|
58611
|
+
var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
|
|
58594
58612
|
var result = unresolvedSymbols.get(path);
|
|
58595
58613
|
if (!result) {
|
|
58596
58614
|
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
|
|
@@ -58663,7 +58681,7 @@ var ts;
|
|
|
58663
58681
|
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
|
|
58664
58682
|
return baseType;
|
|
58665
58683
|
}
|
|
58666
|
-
var id = getTypeId(baseType)
|
|
58684
|
+
var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
|
|
58667
58685
|
var cached = substitutionTypes.get(id);
|
|
58668
58686
|
if (cached) {
|
|
58669
58687
|
return cached;
|
|
@@ -58864,7 +58882,7 @@ var ts;
|
|
|
58864
58882
|
}
|
|
58865
58883
|
function getGlobalSymbol(name, meaning, diagnostic) {
|
|
58866
58884
|
// Don't track references for global symbols anyway, so value if `isReference` is arbitrary
|
|
58867
|
-
return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false);
|
|
58885
|
+
return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false);
|
|
58868
58886
|
}
|
|
58869
58887
|
function getGlobalType(name, arity, reportErrors) {
|
|
58870
58888
|
var symbol = getGlobalTypeSymbol(name, reportErrors);
|
|
@@ -59324,6 +59342,8 @@ var ts;
|
|
|
59324
59342
|
// We ignore 'never' types in unions
|
|
59325
59343
|
if (!(flags & 131072 /* Never */)) {
|
|
59326
59344
|
includes |= flags & 205258751 /* IncludesMask */;
|
|
59345
|
+
if (flags & 465829888 /* Instantiable */)
|
|
59346
|
+
includes |= 33554432 /* IncludesInstantiable */;
|
|
59327
59347
|
if (type === wildcardType)
|
|
59328
59348
|
includes |= 8388608 /* IncludesWildcard */;
|
|
59329
59349
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
@@ -59537,7 +59557,7 @@ var ts;
|
|
|
59537
59557
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
59538
59558
|
}
|
|
59539
59559
|
}
|
|
59540
|
-
var objectFlags = (includes &
|
|
59560
|
+
var objectFlags = (includes & 36323363 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) |
|
|
59541
59561
|
(includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
|
|
59542
59562
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
59543
59563
|
}
|
|
@@ -59585,9 +59605,9 @@ var ts;
|
|
|
59585
59605
|
return types[0];
|
|
59586
59606
|
}
|
|
59587
59607
|
var typeKey = !origin ? getTypeListId(types) :
|
|
59588
|
-
origin.flags & 1048576 /* Union */ ? "|"
|
|
59589
|
-
origin.flags & 2097152 /* Intersection */ ? "&"
|
|
59590
|
-
"#"
|
|
59608
|
+
origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
|
|
59609
|
+
origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
|
|
59610
|
+
"#".concat(origin.type.id, "|").concat(getTypeListId(types)); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
|
|
59591
59611
|
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
59592
59612
|
var type = unionTypes.get(id);
|
|
59593
59613
|
if (!type) {
|
|
@@ -60109,7 +60129,7 @@ var ts;
|
|
|
60109
60129
|
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
|
|
60110
60130
|
return stringType;
|
|
60111
60131
|
}
|
|
60112
|
-
var id = getTypeListId(newTypes)
|
|
60132
|
+
var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
|
|
60113
60133
|
var type = templateLiteralTypes.get(id);
|
|
60114
60134
|
if (!type) {
|
|
60115
60135
|
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
|
|
@@ -60169,7 +60189,7 @@ var ts;
|
|
|
60169
60189
|
return str;
|
|
60170
60190
|
}
|
|
60171
60191
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
60172
|
-
var id = getSymbolId(symbol)
|
|
60192
|
+
var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
|
|
60173
60193
|
var result = stringMappingTypes.get(id);
|
|
60174
60194
|
if (!result) {
|
|
60175
60195
|
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
|
|
@@ -61189,7 +61209,7 @@ var ts;
|
|
|
61189
61209
|
function createUniqueESSymbolType(symbol) {
|
|
61190
61210
|
var type = createType(8192 /* UniqueESSymbol */);
|
|
61191
61211
|
type.symbol = symbol;
|
|
61192
|
-
type.escapedName = "__@"
|
|
61212
|
+
type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
|
|
61193
61213
|
return type;
|
|
61194
61214
|
}
|
|
61195
61215
|
function getESSymbolLikeTypeForNode(node) {
|
|
@@ -62732,7 +62752,7 @@ var ts;
|
|
|
62732
62752
|
return true;
|
|
62733
62753
|
}
|
|
62734
62754
|
if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
|
|
62735
|
-
var related = relation.get(getRelationKey(source, target, 0 /* None */, relation));
|
|
62755
|
+
var related = relation.get(getRelationKey(source, target, 0 /* None */, relation, /*ignoreConstraints*/ false));
|
|
62736
62756
|
if (related !== undefined) {
|
|
62737
62757
|
return !!(related & 1 /* Succeeded */);
|
|
62738
62758
|
}
|
|
@@ -62878,24 +62898,24 @@ var ts;
|
|
|
62878
62898
|
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
|
|
62879
62899
|
// Parenthesize a `new` if there is one
|
|
62880
62900
|
if (path.indexOf("new ") === 0) {
|
|
62881
|
-
path = "("
|
|
62901
|
+
path = "(".concat(path, ")");
|
|
62882
62902
|
}
|
|
62883
62903
|
var str = "" + args[0];
|
|
62884
62904
|
// If leading, just print back the arg (irrespective of if it's a valid identifier)
|
|
62885
62905
|
if (path.length === 0) {
|
|
62886
|
-
path = ""
|
|
62906
|
+
path = "".concat(str);
|
|
62887
62907
|
}
|
|
62888
62908
|
// Otherwise write a dotted name if possible
|
|
62889
62909
|
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
|
|
62890
|
-
path = path
|
|
62910
|
+
path = "".concat(path, ".").concat(str);
|
|
62891
62911
|
}
|
|
62892
62912
|
// Failing that, check if the name is already a computed name
|
|
62893
62913
|
else if (str[0] === "[" && str[str.length - 1] === "]") {
|
|
62894
|
-
path = ""
|
|
62914
|
+
path = "".concat(path).concat(str);
|
|
62895
62915
|
}
|
|
62896
62916
|
// And finally write out a computed name as a last resort
|
|
62897
62917
|
else {
|
|
62898
|
-
path = path
|
|
62918
|
+
path = "".concat(path, "[").concat(str, "]");
|
|
62899
62919
|
}
|
|
62900
62920
|
break;
|
|
62901
62921
|
}
|
|
@@ -62924,7 +62944,7 @@ var ts;
|
|
|
62924
62944
|
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
|
|
62925
62945
|
? ""
|
|
62926
62946
|
: "...";
|
|
62927
|
-
path = ""
|
|
62947
|
+
path = "".concat(prefix).concat(path, "(").concat(params, ")");
|
|
62928
62948
|
}
|
|
62929
62949
|
break;
|
|
62930
62950
|
}
|
|
@@ -62937,7 +62957,7 @@ var ts;
|
|
|
62937
62957
|
break;
|
|
62938
62958
|
}
|
|
62939
62959
|
default:
|
|
62940
|
-
return ts.Debug.fail("Unhandled Diagnostic: "
|
|
62960
|
+
return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
|
|
62941
62961
|
}
|
|
62942
62962
|
}
|
|
62943
62963
|
if (path) {
|
|
@@ -63581,7 +63601,8 @@ var ts;
|
|
|
63581
63601
|
if (overflow) {
|
|
63582
63602
|
return 0 /* False */;
|
|
63583
63603
|
}
|
|
63584
|
-
var
|
|
63604
|
+
var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0);
|
|
63605
|
+
var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false);
|
|
63585
63606
|
var entry = relation.get(id);
|
|
63586
63607
|
if (entry !== undefined) {
|
|
63587
63608
|
if (reportErrors && entry & 2 /* Failed */ && !(entry & 4 /* Reported */)) {
|
|
@@ -63608,16 +63629,13 @@ var ts;
|
|
|
63608
63629
|
targetStack = [];
|
|
63609
63630
|
}
|
|
63610
63631
|
else {
|
|
63611
|
-
//
|
|
63612
|
-
//
|
|
63613
|
-
//
|
|
63614
|
-
var broadestEquivalentId = id.
|
|
63615
|
-
var index = ts.length(id.slice(0, offset).match(/[-=]/g) || undefined);
|
|
63616
|
-
return "=" + index;
|
|
63617
|
-
}); }).join(",");
|
|
63632
|
+
// A key that starts with "*" is an indication that we have type references that reference constrained
|
|
63633
|
+
// type parameters. For such keys we also check against the key we would have gotten if all type parameters
|
|
63634
|
+
// were unconstrained.
|
|
63635
|
+
var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, /*ignoreConstraints*/ true) : undefined;
|
|
63618
63636
|
for (var i = 0; i < maybeCount; i++) {
|
|
63619
63637
|
// If source and target are already being compared, consider them related with assumptions
|
|
63620
|
-
if (id === maybeKeys[i] || broadestEquivalentId === maybeKeys[i]) {
|
|
63638
|
+
if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
|
|
63621
63639
|
return 3 /* Maybe */;
|
|
63622
63640
|
}
|
|
63623
63641
|
}
|
|
@@ -63912,7 +63930,7 @@ var ts;
|
|
|
63912
63930
|
originalErrorInfo = undefined;
|
|
63913
63931
|
}
|
|
63914
63932
|
}
|
|
63915
|
-
else if (isGenericMappedType(target)) {
|
|
63933
|
+
else if (isGenericMappedType(target) && relation !== identityRelation) {
|
|
63916
63934
|
// Check if source type `S` is related to target type `{ [P in Q]: T }` or `{ [P in Q as R]: T}`.
|
|
63917
63935
|
var keysRemapped = !!target.declaration.nameType;
|
|
63918
63936
|
var templateType = getTemplateTypeFromMappedType(target);
|
|
@@ -65124,48 +65142,56 @@ var ts;
|
|
|
65124
65142
|
function isTypeReferenceWithGenericArguments(type) {
|
|
65125
65143
|
return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return !!(t.flags & 262144 /* TypeParameter */) || isTypeReferenceWithGenericArguments(t); });
|
|
65126
65144
|
}
|
|
65127
|
-
|
|
65128
|
-
|
|
65129
|
-
|
|
65130
|
-
|
|
65131
|
-
|
|
65132
|
-
|
|
65133
|
-
|
|
65134
|
-
|
|
65135
|
-
|
|
65136
|
-
if (
|
|
65137
|
-
|
|
65138
|
-
|
|
65139
|
-
|
|
65140
|
-
|
|
65145
|
+
function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) {
|
|
65146
|
+
var typeParameters = [];
|
|
65147
|
+
var constraintMarker = "";
|
|
65148
|
+
var sourceId = getTypeReferenceId(source, 0);
|
|
65149
|
+
var targetId = getTypeReferenceId(target, 0);
|
|
65150
|
+
return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
|
|
65151
|
+
// getTypeReferenceId(A<T, number, U>) returns "111=0-12=1"
|
|
65152
|
+
// where A.id=111 and number.id=12
|
|
65153
|
+
function getTypeReferenceId(type, depth) {
|
|
65154
|
+
if (depth === void 0) { depth = 0; }
|
|
65155
|
+
var result = "" + type.target.id;
|
|
65156
|
+
for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) {
|
|
65157
|
+
var t = _a[_i];
|
|
65158
|
+
if (t.flags & 262144 /* TypeParameter */) {
|
|
65159
|
+
if (ignoreConstraints || isUnconstrainedTypeParameter(t)) {
|
|
65160
|
+
var index = typeParameters.indexOf(t);
|
|
65161
|
+
if (index < 0) {
|
|
65162
|
+
index = typeParameters.length;
|
|
65163
|
+
typeParameters.push(t);
|
|
65164
|
+
}
|
|
65165
|
+
result += "=" + index;
|
|
65166
|
+
continue;
|
|
65167
|
+
}
|
|
65168
|
+
// We mark type references that reference constrained type parameters such that we know to obtain
|
|
65169
|
+
// and look for a "broadest equivalent key" in the cache.
|
|
65170
|
+
constraintMarker = "*";
|
|
65171
|
+
}
|
|
65172
|
+
else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) {
|
|
65173
|
+
result += "<" + getTypeReferenceId(t, depth + 1) + ">";
|
|
65174
|
+
continue;
|
|
65141
65175
|
}
|
|
65142
|
-
result += "=" + index;
|
|
65143
|
-
}
|
|
65144
|
-
else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) {
|
|
65145
|
-
result += "<" + getTypeReferenceId(t, typeParameters, depth + 1) + ">";
|
|
65146
|
-
}
|
|
65147
|
-
else {
|
|
65148
65176
|
result += "-" + t.id;
|
|
65149
65177
|
}
|
|
65178
|
+
return result;
|
|
65150
65179
|
}
|
|
65151
|
-
return result;
|
|
65152
65180
|
}
|
|
65153
65181
|
/**
|
|
65154
65182
|
* To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters.
|
|
65155
65183
|
* For other cases, the types ids are used.
|
|
65156
65184
|
*/
|
|
65157
|
-
function getRelationKey(source, target, intersectionState, relation) {
|
|
65185
|
+
function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) {
|
|
65158
65186
|
if (relation === identityRelation && source.id > target.id) {
|
|
65159
65187
|
var temp = source;
|
|
65160
65188
|
source = target;
|
|
65161
65189
|
target = temp;
|
|
65162
65190
|
}
|
|
65163
65191
|
var postFix = intersectionState ? ":" + intersectionState : "";
|
|
65164
|
-
|
|
65165
|
-
|
|
65166
|
-
|
|
65167
|
-
}
|
|
65168
|
-
return source.id + "," + target.id + postFix;
|
|
65192
|
+
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
|
|
65193
|
+
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
|
|
65194
|
+
"".concat(source.id, ",").concat(target.id).concat(postFix);
|
|
65169
65195
|
}
|
|
65170
65196
|
// Invoke the callback for each underlying property symbol of the given symbol and return the first
|
|
65171
65197
|
// value that isn't undefined.
|
|
@@ -65213,28 +65239,35 @@ var ts;
|
|
|
65213
65239
|
!hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass;
|
|
65214
65240
|
}
|
|
65215
65241
|
// Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons
|
|
65216
|
-
// for
|
|
65242
|
+
// for maxDepth or more occurrences or instantiations of the type have been recorded on the given stack. It is possible,
|
|
65217
65243
|
// though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely
|
|
65218
|
-
// expanding. Effectively, we will generate a false positive when two types are structurally equal to at least
|
|
65244
|
+
// expanding. Effectively, we will generate a false positive when two types are structurally equal to at least maxDepth
|
|
65219
65245
|
// levels, but unequal at some level beyond that.
|
|
65220
|
-
// In addition, this will also detect when an indexed access has been chained off of
|
|
65221
|
-
// the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding
|
|
65222
|
-
// for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`).
|
|
65223
|
-
// It also detects when a recursive type reference has expanded
|
|
65246
|
+
// In addition, this will also detect when an indexed access has been chained off of maxDepth more times (which is
|
|
65247
|
+
// essentially the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding
|
|
65248
|
+
// false positives for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`).
|
|
65249
|
+
// It also detects when a recursive type reference has expanded maxDepth or more times, e.g. if the true branch of
|
|
65224
65250
|
// `type A<T> = null extends T ? [A<NonNullable<T>>] : [T]`
|
|
65225
|
-
// has expanded into `[A<NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<T>>>>>>]
|
|
65226
|
-
//
|
|
65251
|
+
// has expanded into `[A<NonNullable<NonNullable<NonNullable<NonNullable<NonNullable<T>>>>>>]`. In such cases we need
|
|
65252
|
+
// to terminate the expansion, and we do so here.
|
|
65227
65253
|
function isDeeplyNestedType(type, stack, depth, maxDepth) {
|
|
65228
|
-
if (maxDepth === void 0) { maxDepth =
|
|
65254
|
+
if (maxDepth === void 0) { maxDepth = 3; }
|
|
65229
65255
|
if (depth >= maxDepth) {
|
|
65230
65256
|
var identity_1 = getRecursionIdentity(type);
|
|
65231
65257
|
var count = 0;
|
|
65258
|
+
var lastTypeId = 0;
|
|
65232
65259
|
for (var i = 0; i < depth; i++) {
|
|
65233
|
-
|
|
65234
|
-
|
|
65235
|
-
|
|
65236
|
-
|
|
65260
|
+
var t = stack[i];
|
|
65261
|
+
if (getRecursionIdentity(t) === identity_1) {
|
|
65262
|
+
// We only count occurrences with a higher type id than the previous occurrence, since higher
|
|
65263
|
+
// type ids are an indicator of newer instantiations caused by recursion.
|
|
65264
|
+
if (t.id >= lastTypeId) {
|
|
65265
|
+
count++;
|
|
65266
|
+
if (count >= maxDepth) {
|
|
65267
|
+
return true;
|
|
65268
|
+
}
|
|
65237
65269
|
}
|
|
65270
|
+
lastTypeId = t.id;
|
|
65238
65271
|
}
|
|
65239
65272
|
}
|
|
65240
65273
|
}
|
|
@@ -65973,7 +66006,8 @@ var ts;
|
|
|
65973
66006
|
(resolveName(param, param.name.escapedText, 788968 /* Type */, undefined, param.name.escapedText, /*isUse*/ true) ||
|
|
65974
66007
|
param.name.originalKeywordKind && ts.isTypeNodeKind(param.name.originalKeywordKind))) {
|
|
65975
66008
|
var newName = "arg" + param.parent.parameters.indexOf(param);
|
|
65976
|
-
|
|
66009
|
+
var typeName = ts.declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
|
|
66010
|
+
errorOrSuggestion(noImplicitAny, declaration, ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
|
|
65977
66011
|
return;
|
|
65978
66012
|
}
|
|
65979
66013
|
diagnostic = declaration.dotDotDotToken ?
|
|
@@ -67276,11 +67310,11 @@ var ts;
|
|
|
67276
67310
|
case 79 /* Identifier */:
|
|
67277
67311
|
if (!ts.isThisInTypeQuery(node)) {
|
|
67278
67312
|
var symbol = getResolvedSymbol(node);
|
|
67279
|
-
return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1"
|
|
67313
|
+
return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
|
|
67280
67314
|
}
|
|
67281
67315
|
// falls through
|
|
67282
67316
|
case 108 /* ThisKeyword */:
|
|
67283
|
-
return "0|"
|
|
67317
|
+
return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
|
|
67284
67318
|
case 229 /* NonNullExpression */:
|
|
67285
67319
|
case 211 /* ParenthesizedExpression */:
|
|
67286
67320
|
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
|
|
@@ -71042,7 +71076,7 @@ var ts;
|
|
|
71042
71076
|
!leftName ? rightName :
|
|
71043
71077
|
!rightName ? leftName :
|
|
71044
71078
|
undefined;
|
|
71045
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
71079
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
|
|
71046
71080
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
71047
71081
|
params[i] = paramSymbol;
|
|
71048
71082
|
}
|
|
@@ -72823,7 +72857,7 @@ var ts;
|
|
|
72823
72857
|
}
|
|
72824
72858
|
function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) {
|
|
72825
72859
|
ts.Debug.assert(outerName !== undefined, "outername should always be defined");
|
|
72826
|
-
var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) {
|
|
72860
|
+
var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ true, function (symbols, name, meaning) {
|
|
72827
72861
|
ts.Debug.assertEqual(outerName, name, "name should equal outerName");
|
|
72828
72862
|
var symbol = getSymbol(symbols, name, meaning);
|
|
72829
72863
|
// Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function
|
|
@@ -78346,7 +78380,9 @@ var ts;
|
|
|
78346
78380
|
var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType);
|
|
78347
78381
|
if (!typeReferenceNode)
|
|
78348
78382
|
return undefined;
|
|
78349
|
-
var typeParameters = getTypeParametersForTypeReference(typeReferenceNode);
|
|
78383
|
+
var typeParameters = getTypeParametersForTypeReference(typeReferenceNode);
|
|
78384
|
+
if (!typeParameters)
|
|
78385
|
+
return undefined;
|
|
78350
78386
|
var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]);
|
|
78351
78387
|
return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters)));
|
|
78352
78388
|
}
|
|
@@ -80211,7 +80247,7 @@ var ts;
|
|
|
80211
80247
|
}
|
|
80212
80248
|
// For a commonjs `const x = require`, validate the alias and exit
|
|
80213
80249
|
var symbol = getSymbolOfNode(node);
|
|
80214
|
-
if (symbol.flags & 2097152 /* Alias */ && ts.
|
|
80250
|
+
if (symbol.flags & 2097152 /* Alias */ && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
|
|
80215
80251
|
checkAliasSymbol(node);
|
|
80216
80252
|
return;
|
|
80217
80253
|
}
|
|
@@ -80953,7 +80989,7 @@ var ts;
|
|
|
80953
80989
|
function getPropertyNameForKnownSymbolName(symbolName) {
|
|
80954
80990
|
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
|
|
80955
80991
|
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
|
|
80956
|
-
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@"
|
|
80992
|
+
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
|
|
80957
80993
|
}
|
|
80958
80994
|
/**
|
|
80959
80995
|
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
|
|
@@ -87925,7 +87961,7 @@ var ts;
|
|
|
87925
87961
|
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
|
|
87926
87962
|
value === 62 ? 43 /* plus */ :
|
|
87927
87963
|
value === 63 ? 47 /* slash */ :
|
|
87928
|
-
ts.Debug.fail(value
|
|
87964
|
+
ts.Debug.fail("".concat(value, ": not a base64 value"));
|
|
87929
87965
|
}
|
|
87930
87966
|
function base64FormatDecode(ch) {
|
|
87931
87967
|
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
|
|
@@ -88000,7 +88036,7 @@ var ts;
|
|
|
88000
88036
|
var mappings = ts.arrayFrom(decoder, processMapping);
|
|
88001
88037
|
if (decoder.error !== undefined) {
|
|
88002
88038
|
if (host.log) {
|
|
88003
|
-
host.log("Encountered error while decoding sourcemap: "
|
|
88039
|
+
host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
|
|
88004
88040
|
}
|
|
88005
88041
|
decodedMappings = ts.emptyArray;
|
|
88006
88042
|
}
|
|
@@ -91666,7 +91702,7 @@ var ts;
|
|
|
91666
91702
|
var propertyName = ts.isPropertyAccessExpression(originalNode)
|
|
91667
91703
|
? ts.declarationNameToString(originalNode.name)
|
|
91668
91704
|
: ts.getTextOfNode(originalNode.argumentExpression);
|
|
91669
|
-
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " "
|
|
91705
|
+
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
|
|
91670
91706
|
}
|
|
91671
91707
|
return substitute;
|
|
91672
91708
|
}
|
|
@@ -93058,8 +93094,8 @@ var ts;
|
|
|
93058
93094
|
}
|
|
93059
93095
|
function createHoistedVariableForClass(name, node) {
|
|
93060
93096
|
var className = getPrivateIdentifierEnvironment().className;
|
|
93061
|
-
var prefix = className ? "_"
|
|
93062
|
-
var identifier = factory.createUniqueName(prefix
|
|
93097
|
+
var prefix = className ? "_".concat(className) : "";
|
|
93098
|
+
var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
|
|
93063
93099
|
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
|
|
93064
93100
|
addBlockScopedVariable(identifier);
|
|
93065
93101
|
}
|
|
@@ -94957,7 +94993,7 @@ var ts;
|
|
|
94957
94993
|
specifierSourceImports = ts.createMap();
|
|
94958
94994
|
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
|
|
94959
94995
|
}
|
|
94960
|
-
var generatedName = factory.createUniqueName("_"
|
|
94996
|
+
var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
|
|
94961
94997
|
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
|
|
94962
94998
|
generatedName.generatedImportReference = specifier;
|
|
94963
94999
|
specifierSourceImports.set(name, specifier);
|
|
@@ -96096,11 +96132,11 @@ var ts;
|
|
|
96096
96132
|
}
|
|
96097
96133
|
else {
|
|
96098
96134
|
if (node.kind === 245 /* BreakStatement */) {
|
|
96099
|
-
labelMarker = "break-"
|
|
96135
|
+
labelMarker = "break-".concat(label.escapedText);
|
|
96100
96136
|
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
|
|
96101
96137
|
}
|
|
96102
96138
|
else {
|
|
96103
|
-
labelMarker = "continue-"
|
|
96139
|
+
labelMarker = "continue-".concat(label.escapedText);
|
|
96104
96140
|
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
|
|
96105
96141
|
}
|
|
96106
96142
|
}
|
|
@@ -104909,7 +104945,7 @@ var ts;
|
|
|
104909
104945
|
return getTypeAliasDeclarationVisibilityError;
|
|
104910
104946
|
}
|
|
104911
104947
|
else {
|
|
104912
|
-
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: "
|
|
104948
|
+
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
|
|
104913
104949
|
}
|
|
104914
104950
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
104915
104951
|
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
|
|
@@ -105120,7 +105156,7 @@ var ts;
|
|
|
105120
105156
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
|
|
105121
105157
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
|
|
105122
105158
|
default:
|
|
105123
|
-
return ts.Debug.fail("Unknown parent for parameter: "
|
|
105159
|
+
return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
|
|
105124
105160
|
}
|
|
105125
105161
|
}
|
|
105126
105162
|
function getTypeParameterConstraintVisibilityError() {
|
|
@@ -105878,7 +105914,7 @@ var ts;
|
|
|
105878
105914
|
while (ts.length(lateMarkedStatements)) {
|
|
105879
105915
|
var i = lateMarkedStatements.shift();
|
|
105880
105916
|
if (!ts.isLateVisibilityPaintedStatement(i)) {
|
|
105881
|
-
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: "
|
|
105917
|
+
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: ".concat(ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
|
|
105882
105918
|
}
|
|
105883
105919
|
var priorNeedsDeclare = needsDeclare;
|
|
105884
105920
|
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
|
|
@@ -106067,7 +106103,7 @@ var ts;
|
|
|
106067
106103
|
return cleanup(input);
|
|
106068
106104
|
return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf));
|
|
106069
106105
|
}
|
|
106070
|
-
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: "
|
|
106106
|
+
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
|
|
106071
106107
|
}
|
|
106072
106108
|
}
|
|
106073
106109
|
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
|
|
@@ -106358,7 +106394,7 @@ var ts;
|
|
|
106358
106394
|
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
|
|
106359
106395
|
// We must add a temporary declaration for the extends clause expression
|
|
106360
106396
|
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
|
|
106361
|
-
var newId_1 = factory.createUniqueName(oldId
|
|
106397
|
+
var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
|
|
106362
106398
|
getSymbolAccessibilityDiagnostic = function () { return ({
|
|
106363
106399
|
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
|
|
106364
106400
|
errorNode: extendsClause_1,
|
|
@@ -106399,7 +106435,7 @@ var ts;
|
|
|
106399
106435
|
}
|
|
106400
106436
|
}
|
|
106401
106437
|
// Anything left unhandled is an error, so this should be unreachable
|
|
106402
|
-
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: "
|
|
106438
|
+
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
|
|
106403
106439
|
function cleanup(node) {
|
|
106404
106440
|
if (isEnclosingDeclaration(input)) {
|
|
106405
106441
|
enclosingDeclaration = previousEnclosingDeclaration;
|
|
@@ -107291,13 +107327,13 @@ var ts;
|
|
|
107291
107327
|
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
|
|
107292
107328
|
return;
|
|
107293
107329
|
if (js && configFile.options.sourceMap) {
|
|
107294
|
-
addOutput(js
|
|
107330
|
+
addOutput("".concat(js, ".map"));
|
|
107295
107331
|
}
|
|
107296
107332
|
if (ts.getEmitDeclarations(configFile.options)) {
|
|
107297
107333
|
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
|
|
107298
107334
|
addOutput(dts);
|
|
107299
107335
|
if (configFile.options.declarationMap) {
|
|
107300
|
-
addOutput(dts
|
|
107336
|
+
addOutput("".concat(dts, ".map"));
|
|
107301
107337
|
}
|
|
107302
107338
|
}
|
|
107303
107339
|
}
|
|
@@ -107366,7 +107402,7 @@ var ts;
|
|
|
107366
107402
|
function getFirstProjectOutput(configFile, ignoreCase) {
|
|
107367
107403
|
if (ts.outFile(configFile.options)) {
|
|
107368
107404
|
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
|
|
107369
|
-
return ts.Debug.checkDefined(jsFilePath, "project "
|
|
107405
|
+
return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
|
|
107370
107406
|
}
|
|
107371
107407
|
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
|
|
107372
107408
|
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
|
|
@@ -107385,7 +107421,7 @@ var ts;
|
|
|
107385
107421
|
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
|
|
107386
107422
|
if (buildInfoPath)
|
|
107387
107423
|
return buildInfoPath;
|
|
107388
|
-
return ts.Debug.fail("project "
|
|
107424
|
+
return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
|
|
107389
107425
|
}
|
|
107390
107426
|
ts.getFirstProjectOutput = getFirstProjectOutput;
|
|
107391
107427
|
/*@internal*/
|
|
@@ -107611,7 +107647,7 @@ var ts;
|
|
|
107611
107647
|
if (sourceMappingURL) {
|
|
107612
107648
|
if (!writer.isAtStartOfLine())
|
|
107613
107649
|
writer.rawWrite(newLine);
|
|
107614
|
-
writer.writeComment("//# "
|
|
107650
|
+
writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
|
|
107615
107651
|
}
|
|
107616
107652
|
// Write the source map
|
|
107617
107653
|
if (sourceMapFilePath) {
|
|
@@ -107660,7 +107696,7 @@ var ts;
|
|
|
107660
107696
|
// Encode the sourceMap into the sourceMap url
|
|
107661
107697
|
var sourceMapText = sourceMapGenerator.toString();
|
|
107662
107698
|
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
|
|
107663
|
-
return "data:application/json;base64,"
|
|
107699
|
+
return "data:application/json;base64,".concat(base64SourceMapText);
|
|
107664
107700
|
}
|
|
107665
107701
|
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
|
|
107666
107702
|
if (mapOptions.mapRoot) {
|
|
@@ -107840,7 +107876,7 @@ var ts;
|
|
|
107840
107876
|
return;
|
|
107841
107877
|
break;
|
|
107842
107878
|
default:
|
|
107843
|
-
ts.Debug.fail("Unexpected path: "
|
|
107879
|
+
ts.Debug.fail("Unexpected path: ".concat(name));
|
|
107844
107880
|
}
|
|
107845
107881
|
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
|
|
107846
107882
|
},
|
|
@@ -108700,7 +108736,7 @@ var ts;
|
|
|
108700
108736
|
return writeTokenNode(node, writeKeyword);
|
|
108701
108737
|
if (ts.isTokenKind(node.kind))
|
|
108702
108738
|
return writeTokenNode(node, writePunctuation);
|
|
108703
|
-
ts.Debug.fail("Unhandled SyntaxKind: "
|
|
108739
|
+
ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
|
|
108704
108740
|
}
|
|
108705
108741
|
function emitMappedTypeParameter(node) {
|
|
108706
108742
|
emit(node.name);
|
|
@@ -108870,13 +108906,13 @@ var ts;
|
|
|
108870
108906
|
}
|
|
108871
108907
|
}
|
|
108872
108908
|
function emitPlaceholder(hint, node, snippet) {
|
|
108873
|
-
nonEscapingWrite("${"
|
|
108909
|
+
nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
|
|
108874
108910
|
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
|
|
108875
108911
|
nonEscapingWrite("}"); // `}`
|
|
108876
108912
|
// `${2:...}`
|
|
108877
108913
|
}
|
|
108878
108914
|
function emitTabStop(snippet) {
|
|
108879
|
-
nonEscapingWrite("$"
|
|
108915
|
+
nonEscapingWrite("$".concat(snippet.order));
|
|
108880
108916
|
}
|
|
108881
108917
|
//
|
|
108882
108918
|
// Identifiers
|
|
@@ -110598,17 +110634,17 @@ var ts;
|
|
|
110598
110634
|
writeLine();
|
|
110599
110635
|
}
|
|
110600
110636
|
if (currentSourceFile && currentSourceFile.moduleName) {
|
|
110601
|
-
writeComment("/// <amd-module name=\""
|
|
110637
|
+
writeComment("/// <amd-module name=\"".concat(currentSourceFile.moduleName, "\" />"));
|
|
110602
110638
|
writeLine();
|
|
110603
110639
|
}
|
|
110604
110640
|
if (currentSourceFile && currentSourceFile.amdDependencies) {
|
|
110605
110641
|
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
|
|
110606
110642
|
var dep = _b[_a];
|
|
110607
110643
|
if (dep.name) {
|
|
110608
|
-
writeComment("/// <amd-dependency name=\""
|
|
110644
|
+
writeComment("/// <amd-dependency name=\"".concat(dep.name, "\" path=\"").concat(dep.path, "\" />"));
|
|
110609
110645
|
}
|
|
110610
110646
|
else {
|
|
110611
|
-
writeComment("/// <amd-dependency path=\""
|
|
110647
|
+
writeComment("/// <amd-dependency path=\"".concat(dep.path, "\" />"));
|
|
110612
110648
|
}
|
|
110613
110649
|
writeLine();
|
|
110614
110650
|
}
|
|
@@ -110616,7 +110652,7 @@ var ts;
|
|
|
110616
110652
|
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
|
|
110617
110653
|
var directive = files_2[_c];
|
|
110618
110654
|
var pos = writer.getTextPos();
|
|
110619
|
-
writeComment("/// <reference path=\""
|
|
110655
|
+
writeComment("/// <reference path=\"".concat(directive.fileName, "\" />"));
|
|
110620
110656
|
if (bundleFileInfo)
|
|
110621
110657
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
|
|
110622
110658
|
writeLine();
|
|
@@ -110624,7 +110660,7 @@ var ts;
|
|
|
110624
110660
|
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
|
|
110625
110661
|
var directive = types_24[_d];
|
|
110626
110662
|
var pos = writer.getTextPos();
|
|
110627
|
-
writeComment("/// <reference types=\""
|
|
110663
|
+
writeComment("/// <reference types=\"".concat(directive.fileName, "\" />"));
|
|
110628
110664
|
if (bundleFileInfo)
|
|
110629
110665
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
|
|
110630
110666
|
writeLine();
|
|
@@ -110632,7 +110668,7 @@ var ts;
|
|
|
110632
110668
|
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
|
|
110633
110669
|
var directive = libs_1[_e];
|
|
110634
110670
|
var pos = writer.getTextPos();
|
|
110635
|
-
writeComment("/// <reference lib=\""
|
|
110671
|
+
writeComment("/// <reference lib=\"".concat(directive.fileName, "\" />"));
|
|
110636
110672
|
if (bundleFileInfo)
|
|
110637
110673
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
|
|
110638
110674
|
writeLine();
|
|
@@ -111407,9 +111443,9 @@ var ts;
|
|
|
111407
111443
|
var textSourceNode = node.textSourceNode;
|
|
111408
111444
|
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
|
|
111409
111445
|
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
|
|
111410
|
-
return jsxAttributeEscape ? "\""
|
|
111411
|
-
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\""
|
|
111412
|
-
"\""
|
|
111446
|
+
return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
|
|
111447
|
+
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
|
|
111448
|
+
"\"".concat(ts.escapeNonAsciiString(text), "\"");
|
|
111413
111449
|
}
|
|
111414
111450
|
else {
|
|
111415
111451
|
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
|
|
@@ -111886,8 +111922,8 @@ var ts;
|
|
|
111886
111922
|
}
|
|
111887
111923
|
function formatSynthesizedComment(comment) {
|
|
111888
111924
|
return comment.kind === 3 /* MultiLineCommentTrivia */
|
|
111889
|
-
? "/*"
|
|
111890
|
-
: "//"
|
|
111925
|
+
? "/*".concat(comment.text, "*/")
|
|
111926
|
+
: "//".concat(comment.text);
|
|
111891
111927
|
}
|
|
111892
111928
|
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
|
|
111893
111929
|
enterComment();
|
|
@@ -112395,7 +112431,7 @@ var ts;
|
|
|
112395
112431
|
var rootResult = tryReadDirectory(rootDir, rootDirPath);
|
|
112396
112432
|
var rootSymLinkResult;
|
|
112397
112433
|
if (rootResult !== undefined) {
|
|
112398
|
-
return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath
|
|
112434
|
+
return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath);
|
|
112399
112435
|
}
|
|
112400
112436
|
return host.readDirectory(rootDir, extensions, excludes, includes, depth);
|
|
112401
112437
|
function getFileSystemEntries(dir) {
|
|
@@ -112608,7 +112644,7 @@ var ts;
|
|
|
112608
112644
|
var watchedDirPath = _a.watchedDirPath, fileOrDirectory = _a.fileOrDirectory, fileOrDirectoryPath = _a.fileOrDirectoryPath, configFileName = _a.configFileName, options = _a.options, program = _a.program, extraFileExtensions = _a.extraFileExtensions, currentDirectory = _a.currentDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, writeLog = _a.writeLog, toPath = _a.toPath;
|
|
112609
112645
|
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
|
|
112610
112646
|
if (!newPath) {
|
|
112611
|
-
writeLog("Project: "
|
|
112647
|
+
writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
|
|
112612
112648
|
return true;
|
|
112613
112649
|
}
|
|
112614
112650
|
fileOrDirectoryPath = newPath;
|
|
@@ -112617,11 +112653,11 @@ var ts;
|
|
|
112617
112653
|
// If the the added or created file or directory is not supported file name, ignore the file
|
|
112618
112654
|
// But when watched directory is added/removed, we need to reload the file list
|
|
112619
112655
|
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
|
|
112620
|
-
writeLog("Project: "
|
|
112656
|
+
writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
|
|
112621
112657
|
return true;
|
|
112622
112658
|
}
|
|
112623
112659
|
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
|
|
112624
|
-
writeLog("Project: "
|
|
112660
|
+
writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
|
|
112625
112661
|
return true;
|
|
112626
112662
|
}
|
|
112627
112663
|
if (!program)
|
|
@@ -112645,7 +112681,7 @@ var ts;
|
|
|
112645
112681
|
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
|
|
112646
112682
|
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
|
|
112647
112683
|
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
|
|
112648
|
-
writeLog("Project: "
|
|
112684
|
+
writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
|
|
112649
112685
|
return true;
|
|
112650
112686
|
}
|
|
112651
112687
|
return false;
|
|
@@ -112713,36 +112749,36 @@ var ts;
|
|
|
112713
112749
|
host.useCaseSensitiveFileNames();
|
|
112714
112750
|
}
|
|
112715
112751
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
112716
|
-
log("ExcludeWatcher:: Added:: "
|
|
112752
|
+
log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
112717
112753
|
return {
|
|
112718
|
-
close: function () { return log("ExcludeWatcher:: Close:: "
|
|
112754
|
+
close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
|
|
112719
112755
|
};
|
|
112720
112756
|
}
|
|
112721
112757
|
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
112722
|
-
log("FileWatcher:: Added:: "
|
|
112758
|
+
log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
112723
112759
|
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
112724
112760
|
return {
|
|
112725
112761
|
close: function () {
|
|
112726
|
-
log("FileWatcher:: Close:: "
|
|
112762
|
+
log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
112727
112763
|
watcher.close();
|
|
112728
112764
|
}
|
|
112729
112765
|
};
|
|
112730
112766
|
}
|
|
112731
112767
|
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
112732
|
-
var watchInfo = "DirectoryWatcher:: Added:: "
|
|
112768
|
+
var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
112733
112769
|
log(watchInfo);
|
|
112734
112770
|
var start = ts.timestamp();
|
|
112735
112771
|
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
112736
112772
|
var elapsed = ts.timestamp() - start;
|
|
112737
|
-
log("Elapsed:: "
|
|
112773
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
|
|
112738
112774
|
return {
|
|
112739
112775
|
close: function () {
|
|
112740
|
-
var watchInfo = "DirectoryWatcher:: Close:: "
|
|
112776
|
+
var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
112741
112777
|
log(watchInfo);
|
|
112742
112778
|
var start = ts.timestamp();
|
|
112743
112779
|
watcher.close();
|
|
112744
112780
|
var elapsed = ts.timestamp() - start;
|
|
112745
|
-
log("Elapsed:: "
|
|
112781
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
|
|
112746
112782
|
}
|
|
112747
112783
|
};
|
|
112748
112784
|
}
|
|
@@ -112752,16 +112788,16 @@ var ts;
|
|
|
112752
112788
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
112753
112789
|
args[_i] = arguments[_i];
|
|
112754
112790
|
}
|
|
112755
|
-
var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"
|
|
112791
|
+
var triggerredInfo = "".concat(key === "watchFile" ? "FileWatcher" : "DirectoryWatcher", ":: Triggered with ").concat(args[0], " ").concat(args[1] !== undefined ? args[1] : "", ":: ").concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
112756
112792
|
log(triggerredInfo);
|
|
112757
112793
|
var start = ts.timestamp();
|
|
112758
112794
|
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
|
|
112759
112795
|
var elapsed = ts.timestamp() - start;
|
|
112760
|
-
log("Elapsed:: "
|
|
112796
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
|
|
112761
112797
|
}, flags, options, detailInfo1, detailInfo2); };
|
|
112762
112798
|
}
|
|
112763
112799
|
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
|
|
112764
|
-
return "WatchInfo: "
|
|
112800
|
+
return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
|
|
112765
112801
|
}
|
|
112766
112802
|
}
|
|
112767
112803
|
ts.getWatchFactory = getWatchFactory;
|
|
@@ -113068,12 +113104,12 @@ var ts;
|
|
|
113068
113104
|
}
|
|
113069
113105
|
ts.formatDiagnostics = formatDiagnostics;
|
|
113070
113106
|
function formatDiagnostic(diagnostic, host) {
|
|
113071
|
-
var errorMessage = ts.diagnosticCategoryName(diagnostic)
|
|
113107
|
+
var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
|
|
113072
113108
|
if (diagnostic.file) {
|
|
113073
113109
|
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
|
|
113074
113110
|
var fileName = diagnostic.file.fileName;
|
|
113075
113111
|
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
|
|
113076
|
-
return relativeFileName
|
|
113112
|
+
return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
|
|
113077
113113
|
}
|
|
113078
113114
|
return errorMessage;
|
|
113079
113115
|
}
|
|
@@ -113161,9 +113197,9 @@ var ts;
|
|
|
113161
113197
|
var output = "";
|
|
113162
113198
|
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
|
|
113163
113199
|
output += ":";
|
|
113164
|
-
output += color(""
|
|
113200
|
+
output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
|
|
113165
113201
|
output += ":";
|
|
113166
|
-
output += color(""
|
|
113202
|
+
output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
|
|
113167
113203
|
return output;
|
|
113168
113204
|
}
|
|
113169
113205
|
ts.formatLocation = formatLocation;
|
|
@@ -113177,7 +113213,7 @@ var ts;
|
|
|
113177
113213
|
output += " - ";
|
|
113178
113214
|
}
|
|
113179
113215
|
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
|
|
113180
|
-
output += formatColorAndReset(" TS"
|
|
113216
|
+
output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
|
|
113181
113217
|
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
|
|
113182
113218
|
if (diagnostic.file) {
|
|
113183
113219
|
output += host.getNewLine();
|
|
@@ -113286,7 +113322,7 @@ var ts;
|
|
|
113286
113322
|
var result = void 0;
|
|
113287
113323
|
var mode = getModeForResolutionAtIndex(containingFile, i);
|
|
113288
113324
|
i++;
|
|
113289
|
-
var cacheKey = mode !== undefined ? mode
|
|
113325
|
+
var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
|
|
113290
113326
|
if (cache.has(cacheKey)) {
|
|
113291
113327
|
result = cache.get(cacheKey);
|
|
113292
113328
|
}
|
|
@@ -115370,7 +115406,7 @@ var ts;
|
|
|
115370
115406
|
path += (i === 2 ? "/" : "-") + components[i];
|
|
115371
115407
|
i++;
|
|
115372
115408
|
}
|
|
115373
|
-
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_"
|
|
115409
|
+
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
|
|
115374
115410
|
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
115375
115411
|
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
115376
115412
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
@@ -116191,12 +116227,12 @@ var ts;
|
|
|
116191
116227
|
}
|
|
116192
116228
|
function directoryExistsIfProjectReferenceDeclDir(dir) {
|
|
116193
116229
|
var dirPath = host.toPath(dir);
|
|
116194
|
-
var dirPathWithTrailingDirectorySeparator = ""
|
|
116230
|
+
var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
|
|
116195
116231
|
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
|
|
116196
116232
|
// Any parent directory of declaration dir
|
|
116197
116233
|
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
|
|
116198
116234
|
// Any directory inside declaration dir
|
|
116199
|
-
ts.startsWith(dirPath, declDirPath
|
|
116235
|
+
ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
|
|
116200
116236
|
}
|
|
116201
116237
|
function handleDirectoryCouldBeSymlink(directory) {
|
|
116202
116238
|
var _a;
|
|
@@ -116249,7 +116285,7 @@ var ts;
|
|
|
116249
116285
|
if (isFile && result) {
|
|
116250
116286
|
// Store the real path for the file'
|
|
116251
116287
|
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
|
|
116252
|
-
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, ""
|
|
116288
|
+
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
|
|
116253
116289
|
}
|
|
116254
116290
|
return result;
|
|
116255
116291
|
}) || false;
|
|
@@ -116707,7 +116743,7 @@ var ts;
|
|
|
116707
116743
|
/*forceDtsEmit*/ true);
|
|
116708
116744
|
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
|
|
116709
116745
|
if (firstDts_1) {
|
|
116710
|
-
ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */]), "File extension for signature expected to be dts", function () { return "Found: "
|
|
116746
|
+
ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */]), "File extension for signature expected to be dts", function () { return "Found: ".concat(ts.getAnyExtensionFromPath(firstDts_1.name), " for ").concat(firstDts_1.name, ":: All output files: ").concat(JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; }))); });
|
|
116711
116747
|
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
|
|
116712
116748
|
if (exportedModulesMapCache && latestSignature !== prevSignature) {
|
|
116713
116749
|
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
|
|
@@ -117215,7 +117251,7 @@ var ts;
|
|
|
117215
117251
|
return;
|
|
117216
117252
|
}
|
|
117217
117253
|
else {
|
|
117218
|
-
ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: "
|
|
117254
|
+
ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: ".concat(affectedFile.fileName));
|
|
117219
117255
|
}
|
|
117220
117256
|
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
|
|
117221
117257
|
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
|
|
@@ -118360,7 +118396,7 @@ var ts;
|
|
|
118360
118396
|
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
118361
118397
|
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
|
|
118362
118398
|
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
|
|
118363
|
-
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: "
|
|
118399
|
+
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
|
|
118364
118400
|
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
118365
118401
|
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
|
|
118366
118402
|
return {
|
|
@@ -119342,13 +119378,15 @@ var ts;
|
|
|
119342
119378
|
if (host.fileExists(packageJsonPath)) {
|
|
119343
119379
|
var packageJsonContent = JSON.parse(host.readFile(packageJsonPath));
|
|
119344
119380
|
// TODO: Inject `require` or `import` condition based on the intended import mode
|
|
119345
|
-
|
|
119346
|
-
|
|
119347
|
-
|
|
119348
|
-
|
|
119349
|
-
|
|
119350
|
-
|
|
119351
|
-
|
|
119381
|
+
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
119382
|
+
var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, packageJsonContent.name, packageJsonContent.exports, ["node", "types"]) : undefined;
|
|
119383
|
+
if (fromExports) {
|
|
119384
|
+
var withJsExtension = !ts.hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: ts.removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
|
|
119385
|
+
return __assign(__assign({}, withJsExtension), { verbatimFromExports: true });
|
|
119386
|
+
}
|
|
119387
|
+
if (packageJsonContent.exports) {
|
|
119388
|
+
return { moduleFileToTry: path, blockedByExports: true };
|
|
119389
|
+
}
|
|
119352
119390
|
}
|
|
119353
119391
|
var versionPaths = packageJsonContent.typesVersions
|
|
119354
119392
|
? ts.getPackageJsonTypesVersionsPaths(packageJsonContent.typesVersions)
|
|
@@ -119472,7 +119510,7 @@ var ts;
|
|
|
119472
119510
|
}
|
|
119473
119511
|
function getJSExtensionForFile(fileName, options) {
|
|
119474
119512
|
var _a;
|
|
119475
|
-
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension "
|
|
119513
|
+
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
|
|
119476
119514
|
}
|
|
119477
119515
|
function tryGetJSExtensionForFile(fileName, options) {
|
|
119478
119516
|
var ext = ts.tryGetExtensionFromPath(fileName);
|
|
@@ -119575,8 +119613,8 @@ var ts;
|
|
|
119575
119613
|
return pretty ?
|
|
119576
119614
|
function (diagnostic, newLine, options) {
|
|
119577
119615
|
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
|
|
119578
|
-
var output = "["
|
|
119579
|
-
output += ""
|
|
119616
|
+
var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
|
|
119617
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
|
|
119580
119618
|
system.write(output);
|
|
119581
119619
|
} :
|
|
119582
119620
|
function (diagnostic, newLine, options) {
|
|
@@ -119584,8 +119622,8 @@ var ts;
|
|
|
119584
119622
|
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
|
|
119585
119623
|
output += newLine;
|
|
119586
119624
|
}
|
|
119587
|
-
output += getLocaleTimeString(system)
|
|
119588
|
-
output += ""
|
|
119625
|
+
output += "".concat(getLocaleTimeString(system), " - ");
|
|
119626
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
|
|
119589
119627
|
system.write(output);
|
|
119590
119628
|
};
|
|
119591
119629
|
}
|
|
@@ -119613,7 +119651,7 @@ var ts;
|
|
|
119613
119651
|
if (errorCount === 0)
|
|
119614
119652
|
return "";
|
|
119615
119653
|
var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
|
|
119616
|
-
return ""
|
|
119654
|
+
return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine);
|
|
119617
119655
|
}
|
|
119618
119656
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
119619
119657
|
function isBuilderProgram(program) {
|
|
@@ -119639,9 +119677,9 @@ var ts;
|
|
|
119639
119677
|
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
|
|
119640
119678
|
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
|
|
119641
119679
|
var file = _c[_i];
|
|
119642
|
-
write(""
|
|
119643
|
-
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" "
|
|
119644
|
-
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" "
|
|
119680
|
+
write("".concat(toFileName(file, relativeFileName)));
|
|
119681
|
+
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
|
|
119682
|
+
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
|
|
119645
119683
|
}
|
|
119646
119684
|
}
|
|
119647
119685
|
ts.explainFiles = explainFiles;
|
|
@@ -119681,7 +119719,7 @@ var ts;
|
|
|
119681
119719
|
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
|
|
119682
119720
|
return false;
|
|
119683
119721
|
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
|
|
119684
|
-
return !!pattern && ts.getRegexFromPattern("("
|
|
119722
|
+
return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
|
|
119685
119723
|
});
|
|
119686
119724
|
}
|
|
119687
119725
|
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
|
|
@@ -119690,7 +119728,7 @@ var ts;
|
|
|
119690
119728
|
var options = program.getCompilerOptions();
|
|
119691
119729
|
if (ts.isReferencedFile(reason)) {
|
|
119692
119730
|
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
|
|
119693
|
-
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\""
|
|
119731
|
+
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
|
|
119694
119732
|
var message = void 0;
|
|
119695
119733
|
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
|
|
119696
119734
|
switch (reason.kind) {
|
|
@@ -119814,7 +119852,7 @@ var ts;
|
|
|
119814
119852
|
var currentDir_1 = program.getCurrentDirectory();
|
|
119815
119853
|
ts.forEach(emittedFiles, function (file) {
|
|
119816
119854
|
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
|
|
119817
|
-
write("TSFILE: "
|
|
119855
|
+
write("TSFILE: ".concat(filepath));
|
|
119818
119856
|
});
|
|
119819
119857
|
listFiles(program, write);
|
|
119820
119858
|
}
|
|
@@ -120142,7 +120180,7 @@ var ts;
|
|
|
120142
120180
|
}
|
|
120143
120181
|
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
|
|
120144
120182
|
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
120145
|
-
writeLog("Current directory: "
|
|
120183
|
+
writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
|
|
120146
120184
|
var configFileWatcher;
|
|
120147
120185
|
if (configFileName) {
|
|
120148
120186
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
@@ -120291,10 +120329,10 @@ var ts;
|
|
|
120291
120329
|
function createNewProgram(hasInvalidatedResolution) {
|
|
120292
120330
|
// Compile the program
|
|
120293
120331
|
writeLog("CreatingProgramWith::");
|
|
120294
|
-
writeLog(" roots: "
|
|
120295
|
-
writeLog(" options: "
|
|
120332
|
+
writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
|
|
120333
|
+
writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
|
|
120296
120334
|
if (projectReferences)
|
|
120297
|
-
writeLog(" projectReferences: "
|
|
120335
|
+
writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
|
|
120298
120336
|
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
|
|
120299
120337
|
hasChangedCompilerOptions = false;
|
|
120300
120338
|
hasChangedConfigFileParsingErrors = false;
|
|
@@ -120455,7 +120493,7 @@ var ts;
|
|
|
120455
120493
|
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
|
|
120456
120494
|
}
|
|
120457
120495
|
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
|
|
120458
|
-
writeLog("Scheduling invalidateFailedLookup"
|
|
120496
|
+
writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
|
|
120459
120497
|
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
|
|
120460
120498
|
}
|
|
120461
120499
|
function invalidateResolutionsOfFailedLookup() {
|
|
@@ -120515,7 +120553,7 @@ var ts;
|
|
|
120515
120553
|
synchronizeProgram();
|
|
120516
120554
|
}
|
|
120517
120555
|
function reloadConfigFile() {
|
|
120518
|
-
writeLog("Reloading config file: "
|
|
120556
|
+
writeLog("Reloading config file: ".concat(configFileName));
|
|
120519
120557
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
120520
120558
|
if (cachedDirectoryStructureHost) {
|
|
120521
120559
|
cachedDirectoryStructureHost.clearCache();
|
|
@@ -120556,7 +120594,7 @@ var ts;
|
|
|
120556
120594
|
return config.parsedCommandLine;
|
|
120557
120595
|
}
|
|
120558
120596
|
}
|
|
120559
|
-
writeLog("Loading config file: "
|
|
120597
|
+
writeLog("Loading config file: ".concat(configFileName));
|
|
120560
120598
|
var parsedCommandLine = host.getParsedCommandLine ?
|
|
120561
120599
|
host.getParsedCommandLine(configFileName) :
|
|
120562
120600
|
getParsedCommandLineFromConfigFileHost(configFileName);
|
|
@@ -120860,8 +120898,8 @@ var ts;
|
|
|
120860
120898
|
*/
|
|
120861
120899
|
function createBuilderStatusReporter(system, pretty) {
|
|
120862
120900
|
return function (diagnostic) {
|
|
120863
|
-
var output = pretty ? "["
|
|
120864
|
-
output += ""
|
|
120901
|
+
var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
|
|
120902
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
|
|
120865
120903
|
system.write(output);
|
|
120866
120904
|
};
|
|
120867
120905
|
}
|
|
@@ -121636,7 +121674,7 @@ var ts;
|
|
|
121636
121674
|
function listEmittedFile(_a, proj, file) {
|
|
121637
121675
|
var write = _a.write;
|
|
121638
121676
|
if (write && proj.options.listEmittedFiles) {
|
|
121639
|
-
write("TSFILE: "
|
|
121677
|
+
write("TSFILE: ".concat(file));
|
|
121640
121678
|
}
|
|
121641
121679
|
}
|
|
121642
121680
|
function getOldProgram(_a, proj, parsed) {
|
|
@@ -121665,7 +121703,7 @@ var ts;
|
|
|
121665
121703
|
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
|
|
121666
121704
|
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
|
|
121667
121705
|
reportAndStoreErrors(state, resolvedPath, diagnostics);
|
|
121668
|
-
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType
|
|
121706
|
+
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
|
|
121669
121707
|
if (canEmitBuildInfo)
|
|
121670
121708
|
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
|
|
121671
121709
|
afterProgramDone(state, program, config);
|
|
@@ -121693,7 +121731,7 @@ var ts;
|
|
|
121693
121731
|
if (!host.fileExists(inputFile)) {
|
|
121694
121732
|
return {
|
|
121695
121733
|
type: ts.UpToDateStatusType.Unbuildable,
|
|
121696
|
-
reason: inputFile
|
|
121734
|
+
reason: "".concat(inputFile, " does not exist")
|
|
121697
121735
|
};
|
|
121698
121736
|
}
|
|
121699
121737
|
if (!force) {
|
|
@@ -122052,7 +122090,7 @@ var ts;
|
|
|
122052
122090
|
}
|
|
122053
122091
|
}
|
|
122054
122092
|
if (filesToDelete) {
|
|
122055
|
-
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * "
|
|
122093
|
+
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * ".concat(f); }).join(""));
|
|
122056
122094
|
}
|
|
122057
122095
|
return ts.ExitStatus.Success;
|
|
122058
122096
|
}
|
|
@@ -122385,7 +122423,7 @@ var ts;
|
|
|
122385
122423
|
function nowString() {
|
|
122386
122424
|
// E.g. "12:34:56.789"
|
|
122387
122425
|
var d = new Date();
|
|
122388
|
-
return ts.padLeft(d.getHours().toString(), 2, "0")
|
|
122426
|
+
return "".concat(ts.padLeft(d.getHours().toString(), 2, "0"), ":").concat(ts.padLeft(d.getMinutes().toString(), 2, "0"), ":").concat(ts.padLeft(d.getSeconds().toString(), 2, "0"), ".").concat(ts.padLeft(d.getMilliseconds().toString(), 3, "0"));
|
|
122389
122427
|
}
|
|
122390
122428
|
server.nowString = nowString;
|
|
122391
122429
|
})(server = ts.server || (ts.server = {}));
|
|
@@ -122396,7 +122434,7 @@ var ts;
|
|
|
122396
122434
|
var JsTyping;
|
|
122397
122435
|
(function (JsTyping) {
|
|
122398
122436
|
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
|
|
122399
|
-
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts"
|
|
122437
|
+
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
|
|
122400
122438
|
return availableVersion.compareTo(cachedTyping.version) <= 0;
|
|
122401
122439
|
}
|
|
122402
122440
|
JsTyping.isTypingUpToDate = isTypingUpToDate;
|
|
@@ -122449,7 +122487,7 @@ var ts;
|
|
|
122449
122487
|
"worker_threads",
|
|
122450
122488
|
"zlib"
|
|
122451
122489
|
];
|
|
122452
|
-
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:"
|
|
122490
|
+
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
|
|
122453
122491
|
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
|
|
122454
122492
|
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
|
|
122455
122493
|
function nonRelativeModuleNameForTypingCache(moduleName) {
|
|
@@ -122528,7 +122566,7 @@ var ts;
|
|
|
122528
122566
|
var excludeTypingName = exclude_1[_i];
|
|
122529
122567
|
var didDelete = inferredTypings.delete(excludeTypingName);
|
|
122530
122568
|
if (didDelete && log)
|
|
122531
|
-
log("Typing for "
|
|
122569
|
+
log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
|
|
122532
122570
|
}
|
|
122533
122571
|
var newTypingNames = [];
|
|
122534
122572
|
var cachedTypingPaths = [];
|
|
@@ -122542,7 +122580,7 @@ var ts;
|
|
|
122542
122580
|
});
|
|
122543
122581
|
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
|
|
122544
122582
|
if (log)
|
|
122545
|
-
log("Result: "
|
|
122583
|
+
log("Result: ".concat(JSON.stringify(result)));
|
|
122546
122584
|
return result;
|
|
122547
122585
|
function addInferredTyping(typingName) {
|
|
122548
122586
|
if (!inferredTypings.has(typingName)) {
|
|
@@ -122551,7 +122589,7 @@ var ts;
|
|
|
122551
122589
|
}
|
|
122552
122590
|
function addInferredTypings(typingNames, message) {
|
|
122553
122591
|
if (log)
|
|
122554
|
-
log(message
|
|
122592
|
+
log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
|
|
122555
122593
|
ts.forEach(typingNames, addInferredTyping);
|
|
122556
122594
|
}
|
|
122557
122595
|
/**
|
|
@@ -122564,7 +122602,7 @@ var ts;
|
|
|
122564
122602
|
filesToWatch.push(jsonPath);
|
|
122565
122603
|
var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config;
|
|
122566
122604
|
var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys);
|
|
122567
|
-
addInferredTypings(jsonTypingNames, "Typing names in '"
|
|
122605
|
+
addInferredTypings(jsonTypingNames, "Typing names in '".concat(jsonPath, "' dependencies"));
|
|
122568
122606
|
}
|
|
122569
122607
|
/**
|
|
122570
122608
|
* Infer typing names from given file names. For example, the file name "jquery-min.2.3.4.js"
|
|
@@ -122603,7 +122641,7 @@ var ts;
|
|
|
122603
122641
|
// depth of 2, so we access `node_modules/foo` but not `node_modules/foo/bar`
|
|
122604
122642
|
var fileNames = host.readDirectory(packagesFolderPath, [".json" /* Json */], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2);
|
|
122605
122643
|
if (log)
|
|
122606
|
-
log("Searching for typing names in "
|
|
122644
|
+
log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(fileNames)));
|
|
122607
122645
|
var packageNames = [];
|
|
122608
122646
|
for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) {
|
|
122609
122647
|
var fileName = fileNames_1[_i];
|
|
@@ -122630,7 +122668,7 @@ var ts;
|
|
|
122630
122668
|
if (ownTypes) {
|
|
122631
122669
|
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
|
|
122632
122670
|
if (log)
|
|
122633
|
-
log(" Package '"
|
|
122671
|
+
log(" Package '".concat(packageJson.name, "' provides its own types."));
|
|
122634
122672
|
inferredTypings.set(packageJson.name, absolutePath);
|
|
122635
122673
|
}
|
|
122636
122674
|
else {
|
|
@@ -122702,15 +122740,15 @@ var ts;
|
|
|
122702
122740
|
var kind = isScopeName ? "Scope" : "Package";
|
|
122703
122741
|
switch (result) {
|
|
122704
122742
|
case 1 /* EmptyName */:
|
|
122705
|
-
return "'"
|
|
122743
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
|
|
122706
122744
|
case 2 /* NameTooLong */:
|
|
122707
|
-
return "'"
|
|
122745
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
|
|
122708
122746
|
case 3 /* NameStartsWithDot */:
|
|
122709
|
-
return "'"
|
|
122747
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
|
|
122710
122748
|
case 4 /* NameStartsWithUnderscore */:
|
|
122711
|
-
return "'"
|
|
122749
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
|
|
122712
122750
|
case 5 /* NameContainsNonURISafeCharacters */:
|
|
122713
|
-
return "'"
|
|
122751
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
|
|
122714
122752
|
case 0 /* Ok */:
|
|
122715
122753
|
return ts.Debug.fail(); // Shouldn't have called this.
|
|
122716
122754
|
default:
|
|
@@ -122736,7 +122774,7 @@ var ts;
|
|
|
122736
122774
|
}
|
|
122737
122775
|
catch (e) {
|
|
122738
122776
|
if (log.isEnabled()) {
|
|
122739
|
-
log.writeLine("Failed to resolve "
|
|
122777
|
+
log.writeLine("Failed to resolve ".concat(packageName, " in folder '").concat(cachePath, "': ").concat(e.message));
|
|
122740
122778
|
}
|
|
122741
122779
|
return undefined;
|
|
122742
122780
|
}
|
|
@@ -122757,7 +122795,7 @@ var ts;
|
|
|
122757
122795
|
var sliceStart = packageNames.length - remaining;
|
|
122758
122796
|
var command, toSlice = remaining;
|
|
122759
122797
|
while (true) {
|
|
122760
|
-
command = npmPath
|
|
122798
|
+
command = "".concat(npmPath, " install --ignore-scripts ").concat((toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" "), " --save-dev --user-agent=\"typesInstaller/").concat(tsVersion, "\"");
|
|
122761
122799
|
if (command.length < 8000) {
|
|
122762
122800
|
break;
|
|
122763
122801
|
}
|
|
@@ -122784,7 +122822,7 @@ var ts;
|
|
|
122784
122822
|
ProjectWatcherType["DirectoryWatcher"] = "DirectoryWatcher";
|
|
122785
122823
|
})(ProjectWatcherType || (ProjectWatcherType = {}));
|
|
122786
122824
|
function getDetailWatchInfo(projectName, watchers) {
|
|
122787
|
-
return "Project: "
|
|
122825
|
+
return "Project: ".concat(projectName, " watcher already invoked: ").concat(watchers.isInvoked);
|
|
122788
122826
|
}
|
|
122789
122827
|
var TypingsInstaller = /** @class */ (function () {
|
|
122790
122828
|
function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log) {
|
|
@@ -122808,7 +122846,7 @@ var ts;
|
|
|
122808
122846
|
this.globalCachePackageJsonPath = ts.combinePaths(globalCachePath, "package.json");
|
|
122809
122847
|
var isLoggingEnabled = this.log.isEnabled();
|
|
122810
122848
|
if (isLoggingEnabled) {
|
|
122811
|
-
this.log.writeLine("Global cache location '"
|
|
122849
|
+
this.log.writeLine("Global cache location '".concat(globalCachePath, "', safe file path '").concat(safeListPath, "', types map path ").concat(typesMapLocation));
|
|
122812
122850
|
}
|
|
122813
122851
|
this.watchFactory = ts.getWatchFactory(this.installTypingHost, isLoggingEnabled ? ts.WatchLogLevel.Verbose : ts.WatchLogLevel.None, function (s) { return _this.log.writeLine(s); }, getDetailWatchInfo);
|
|
122814
122852
|
this.processCacheLocation(this.globalCachePath);
|
|
@@ -122818,30 +122856,30 @@ var ts;
|
|
|
122818
122856
|
};
|
|
122819
122857
|
TypingsInstaller.prototype.closeWatchers = function (projectName) {
|
|
122820
122858
|
if (this.log.isEnabled()) {
|
|
122821
|
-
this.log.writeLine("Closing file watchers for project '"
|
|
122859
|
+
this.log.writeLine("Closing file watchers for project '".concat(projectName, "'"));
|
|
122822
122860
|
}
|
|
122823
122861
|
var watchers = this.projectWatchers.get(projectName);
|
|
122824
122862
|
if (!watchers) {
|
|
122825
122863
|
if (this.log.isEnabled()) {
|
|
122826
|
-
this.log.writeLine("No watchers are registered for project '"
|
|
122864
|
+
this.log.writeLine("No watchers are registered for project '".concat(projectName, "'"));
|
|
122827
122865
|
}
|
|
122828
122866
|
return;
|
|
122829
122867
|
}
|
|
122830
122868
|
ts.clearMap(watchers, ts.closeFileWatcher);
|
|
122831
122869
|
this.projectWatchers.delete(projectName);
|
|
122832
122870
|
if (this.log.isEnabled()) {
|
|
122833
|
-
this.log.writeLine("Closing file watchers for project '"
|
|
122871
|
+
this.log.writeLine("Closing file watchers for project '".concat(projectName, "' - done."));
|
|
122834
122872
|
}
|
|
122835
122873
|
};
|
|
122836
122874
|
TypingsInstaller.prototype.install = function (req) {
|
|
122837
122875
|
var _this = this;
|
|
122838
122876
|
if (this.log.isEnabled()) {
|
|
122839
|
-
this.log.writeLine("Got install request "
|
|
122877
|
+
this.log.writeLine("Got install request ".concat(JSON.stringify(req)));
|
|
122840
122878
|
}
|
|
122841
122879
|
// load existing typing information from the cache
|
|
122842
122880
|
if (req.cachePath) {
|
|
122843
122881
|
if (this.log.isEnabled()) {
|
|
122844
|
-
this.log.writeLine("Request specifies cache path '"
|
|
122882
|
+
this.log.writeLine("Request specifies cache path '".concat(req.cachePath, "', loading cached information..."));
|
|
122845
122883
|
}
|
|
122846
122884
|
this.processCacheLocation(req.cachePath);
|
|
122847
122885
|
}
|
|
@@ -122850,7 +122888,7 @@ var ts;
|
|
|
122850
122888
|
}
|
|
122851
122889
|
var discoverTypingsResult = ts.JsTyping.discoverTypings(this.installTypingHost, this.log.isEnabled() ? (function (s) { return _this.log.writeLine(s); }) : undefined, req.fileNames, req.projectRootPath, this.safeList, this.packageNameToTypingLocation, req.typeAcquisition, req.unresolvedImports, this.typesRegistry);
|
|
122852
122890
|
if (this.log.isEnabled()) {
|
|
122853
|
-
this.log.writeLine("Finished typings discovery: "
|
|
122891
|
+
this.log.writeLine("Finished typings discovery: ".concat(JSON.stringify(discoverTypingsResult)));
|
|
122854
122892
|
}
|
|
122855
122893
|
// start watching files
|
|
122856
122894
|
this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch, req.projectRootPath, req.watchOptions);
|
|
@@ -122870,17 +122908,17 @@ var ts;
|
|
|
122870
122908
|
if (this.typesMapLocation) {
|
|
122871
122909
|
var safeListFromMap = ts.JsTyping.loadTypesMap(this.installTypingHost, this.typesMapLocation);
|
|
122872
122910
|
if (safeListFromMap) {
|
|
122873
|
-
this.log.writeLine("Loaded safelist from types map file '"
|
|
122911
|
+
this.log.writeLine("Loaded safelist from types map file '".concat(this.typesMapLocation, "'"));
|
|
122874
122912
|
this.safeList = safeListFromMap;
|
|
122875
122913
|
return;
|
|
122876
122914
|
}
|
|
122877
|
-
this.log.writeLine("Failed to load safelist from types map file '"
|
|
122915
|
+
this.log.writeLine("Failed to load safelist from types map file '".concat(this.typesMapLocation, "'"));
|
|
122878
122916
|
}
|
|
122879
122917
|
this.safeList = ts.JsTyping.loadSafeList(this.installTypingHost, this.safeListPath);
|
|
122880
122918
|
};
|
|
122881
122919
|
TypingsInstaller.prototype.processCacheLocation = function (cacheLocation) {
|
|
122882
122920
|
if (this.log.isEnabled()) {
|
|
122883
|
-
this.log.writeLine("Processing cache location '"
|
|
122921
|
+
this.log.writeLine("Processing cache location '".concat(cacheLocation, "'"));
|
|
122884
122922
|
}
|
|
122885
122923
|
if (this.knownCachesSet.has(cacheLocation)) {
|
|
122886
122924
|
if (this.log.isEnabled()) {
|
|
@@ -122891,14 +122929,14 @@ var ts;
|
|
|
122891
122929
|
var packageJson = ts.combinePaths(cacheLocation, "package.json");
|
|
122892
122930
|
var packageLockJson = ts.combinePaths(cacheLocation, "package-lock.json");
|
|
122893
122931
|
if (this.log.isEnabled()) {
|
|
122894
|
-
this.log.writeLine("Trying to find '"
|
|
122932
|
+
this.log.writeLine("Trying to find '".concat(packageJson, "'..."));
|
|
122895
122933
|
}
|
|
122896
122934
|
if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) {
|
|
122897
122935
|
var npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); // TODO: GH#18217
|
|
122898
122936
|
var npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); // TODO: GH#18217
|
|
122899
122937
|
if (this.log.isEnabled()) {
|
|
122900
|
-
this.log.writeLine("Loaded content of '"
|
|
122901
|
-
this.log.writeLine("Loaded content of '"
|
|
122938
|
+
this.log.writeLine("Loaded content of '".concat(packageJson, "': ").concat(JSON.stringify(npmConfig)));
|
|
122939
|
+
this.log.writeLine("Loaded content of '".concat(packageLockJson, "'"));
|
|
122902
122940
|
}
|
|
122903
122941
|
if (npmConfig.devDependencies && npmLock.dependencies) {
|
|
122904
122942
|
for (var key in npmConfig.devDependencies) {
|
|
@@ -122922,11 +122960,11 @@ var ts;
|
|
|
122922
122960
|
continue;
|
|
122923
122961
|
}
|
|
122924
122962
|
if (this.log.isEnabled()) {
|
|
122925
|
-
this.log.writeLine("New typing for package "
|
|
122963
|
+
this.log.writeLine("New typing for package ".concat(packageName, " from '").concat(typingFile, "' conflicts with existing typing file '").concat(existingTypingFile, "'"));
|
|
122926
122964
|
}
|
|
122927
122965
|
}
|
|
122928
122966
|
if (this.log.isEnabled()) {
|
|
122929
|
-
this.log.writeLine("Adding entry into typings cache: '"
|
|
122967
|
+
this.log.writeLine("Adding entry into typings cache: '".concat(packageName, "' => '").concat(typingFile, "'"));
|
|
122930
122968
|
}
|
|
122931
122969
|
var info = ts.getProperty(npmLock.dependencies, key);
|
|
122932
122970
|
var version_1 = info && info.version;
|
|
@@ -122939,7 +122977,7 @@ var ts;
|
|
|
122939
122977
|
}
|
|
122940
122978
|
}
|
|
122941
122979
|
if (this.log.isEnabled()) {
|
|
122942
|
-
this.log.writeLine("Finished processing cache location '"
|
|
122980
|
+
this.log.writeLine("Finished processing cache location '".concat(cacheLocation, "'"));
|
|
122943
122981
|
}
|
|
122944
122982
|
this.knownCachesSet.add(cacheLocation);
|
|
122945
122983
|
};
|
|
@@ -122949,7 +122987,7 @@ var ts;
|
|
|
122949
122987
|
var typingKey = ts.mangleScopedPackageName(typing);
|
|
122950
122988
|
if (_this.missingTypingsSet.has(typingKey)) {
|
|
122951
122989
|
if (_this.log.isEnabled())
|
|
122952
|
-
_this.log.writeLine("'"
|
|
122990
|
+
_this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' is in missingTypingsSet - skipping..."));
|
|
122953
122991
|
return undefined;
|
|
122954
122992
|
}
|
|
122955
122993
|
var validationResult = ts.JsTyping.validatePackageName(typing);
|
|
@@ -122962,12 +123000,12 @@ var ts;
|
|
|
122962
123000
|
}
|
|
122963
123001
|
if (!_this.typesRegistry.has(typingKey)) {
|
|
122964
123002
|
if (_this.log.isEnabled())
|
|
122965
|
-
_this.log.writeLine("'"
|
|
123003
|
+
_this.log.writeLine("'".concat(typing, "':: Entry for package '").concat(typingKey, "' does not exist in local types registry - skipping..."));
|
|
122966
123004
|
return undefined;
|
|
122967
123005
|
}
|
|
122968
123006
|
if (_this.packageNameToTypingLocation.get(typingKey) && ts.JsTyping.isTypingUpToDate(_this.packageNameToTypingLocation.get(typingKey), _this.typesRegistry.get(typingKey))) {
|
|
122969
123007
|
if (_this.log.isEnabled())
|
|
122970
|
-
_this.log.writeLine("'"
|
|
123008
|
+
_this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' already has an up-to-date typing - skipping..."));
|
|
122971
123009
|
return undefined;
|
|
122972
123010
|
}
|
|
122973
123011
|
return typingKey;
|
|
@@ -122976,11 +123014,11 @@ var ts;
|
|
|
122976
123014
|
TypingsInstaller.prototype.ensurePackageDirectoryExists = function (directory) {
|
|
122977
123015
|
var npmConfigPath = ts.combinePaths(directory, "package.json");
|
|
122978
123016
|
if (this.log.isEnabled()) {
|
|
122979
|
-
this.log.writeLine("Npm config file: "
|
|
123017
|
+
this.log.writeLine("Npm config file: ".concat(npmConfigPath));
|
|
122980
123018
|
}
|
|
122981
123019
|
if (!this.installTypingHost.fileExists(npmConfigPath)) {
|
|
122982
123020
|
if (this.log.isEnabled()) {
|
|
122983
|
-
this.log.writeLine("Npm config file: '"
|
|
123021
|
+
this.log.writeLine("Npm config file: '".concat(npmConfigPath, "' is missing, creating new one..."));
|
|
122984
123022
|
}
|
|
122985
123023
|
this.ensureDirectoryExists(directory, this.installTypingHost);
|
|
122986
123024
|
this.installTypingHost.writeFile(npmConfigPath, '{ "private": true }');
|
|
@@ -122989,7 +123027,7 @@ var ts;
|
|
|
122989
123027
|
TypingsInstaller.prototype.installTypings = function (req, cachePath, currentlyCachedTypings, typingsToInstall) {
|
|
122990
123028
|
var _this = this;
|
|
122991
123029
|
if (this.log.isEnabled()) {
|
|
122992
|
-
this.log.writeLine("Installing typings "
|
|
123030
|
+
this.log.writeLine("Installing typings ".concat(JSON.stringify(typingsToInstall)));
|
|
122993
123031
|
}
|
|
122994
123032
|
var filteredTypings = this.filterTypings(typingsToInstall);
|
|
122995
123033
|
if (filteredTypings.length === 0) {
|
|
@@ -123016,7 +123054,7 @@ var ts;
|
|
|
123016
123054
|
try {
|
|
123017
123055
|
if (!ok) {
|
|
123018
123056
|
if (_this.log.isEnabled()) {
|
|
123019
|
-
_this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: "
|
|
123057
|
+
_this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: ".concat(JSON.stringify(filteredTypings)));
|
|
123020
123058
|
}
|
|
123021
123059
|
for (var _i = 0, filteredTypings_1 = filteredTypings; _i < filteredTypings_1.length; _i++) {
|
|
123022
123060
|
var typing = filteredTypings_1[_i];
|
|
@@ -123026,7 +123064,7 @@ var ts;
|
|
|
123026
123064
|
}
|
|
123027
123065
|
// TODO: watch project directory
|
|
123028
123066
|
if (_this.log.isEnabled()) {
|
|
123029
|
-
_this.log.writeLine("Installed typings "
|
|
123067
|
+
_this.log.writeLine("Installed typings ".concat(JSON.stringify(scopedTypings)));
|
|
123030
123068
|
}
|
|
123031
123069
|
var installedTypingFiles = [];
|
|
123032
123070
|
for (var _a = 0, filteredTypings_2 = filteredTypings; _a < filteredTypings_2.length; _a++) {
|
|
@@ -123038,13 +123076,13 @@ var ts;
|
|
|
123038
123076
|
}
|
|
123039
123077
|
// packageName is guaranteed to exist in typesRegistry by filterTypings
|
|
123040
123078
|
var distTags = _this.typesRegistry.get(packageName);
|
|
123041
|
-
var newVersion = new ts.Version(distTags["ts"
|
|
123079
|
+
var newVersion = new ts.Version(distTags["ts".concat(ts.versionMajorMinor)] || distTags[_this.latestDistTag]);
|
|
123042
123080
|
var newTyping = { typingLocation: typingFile, version: newVersion };
|
|
123043
123081
|
_this.packageNameToTypingLocation.set(packageName, newTyping);
|
|
123044
123082
|
installedTypingFiles.push(typingFile);
|
|
123045
123083
|
}
|
|
123046
123084
|
if (_this.log.isEnabled()) {
|
|
123047
|
-
_this.log.writeLine("Installed typing files "
|
|
123085
|
+
_this.log.writeLine("Installed typing files ".concat(JSON.stringify(installedTypingFiles)));
|
|
123048
123086
|
}
|
|
123049
123087
|
_this.sendResponse(_this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles)));
|
|
123050
123088
|
}
|
|
@@ -123098,7 +123136,7 @@ var ts;
|
|
|
123098
123136
|
return;
|
|
123099
123137
|
}
|
|
123100
123138
|
if (isLoggingEnabled) {
|
|
123101
|
-
_this.log.writeLine(projectWatcherType
|
|
123139
|
+
_this.log.writeLine("".concat(projectWatcherType, ":: Added:: WatchInfo: ").concat(path));
|
|
123102
123140
|
}
|
|
123103
123141
|
var watcher = projectWatcherType === "FileWatcher" /* FileWatcher */ ?
|
|
123104
123142
|
_this.watchFactory.watchFile(path, function () {
|
|
@@ -123119,7 +123157,7 @@ var ts;
|
|
|
123119
123157
|
}, 1 /* Recursive */, options, projectName, watchers);
|
|
123120
123158
|
watchers.set(canonicalPath, isLoggingEnabled ? {
|
|
123121
123159
|
close: function () {
|
|
123122
|
-
_this.log.writeLine(projectWatcherType
|
|
123160
|
+
_this.log.writeLine("".concat(projectWatcherType, ":: Closed:: WatchInfo: ").concat(path));
|
|
123123
123161
|
watcher.close();
|
|
123124
123162
|
}
|
|
123125
123163
|
} : watcher);
|
|
@@ -123194,7 +123232,7 @@ var ts;
|
|
|
123194
123232
|
typingsInstaller.TypingsInstaller = TypingsInstaller;
|
|
123195
123233
|
/* @internal */
|
|
123196
123234
|
function typingsName(packageName) {
|
|
123197
|
-
return "@types/"
|
|
123235
|
+
return "@types/".concat(packageName, "@ts").concat(ts.versionMajorMinor);
|
|
123198
123236
|
}
|
|
123199
123237
|
typingsInstaller.typingsName = typingsName;
|
|
123200
123238
|
})(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
|
|
@@ -123219,7 +123257,7 @@ var ts;
|
|
|
123219
123257
|
if (typeof _this.logFile !== "string")
|
|
123220
123258
|
return;
|
|
123221
123259
|
try {
|
|
123222
|
-
fs.appendFileSync(_this.logFile, "["
|
|
123260
|
+
fs.appendFileSync(_this.logFile, "[".concat(server.nowString(), "] ").concat(text).concat(ts.sys.newLine));
|
|
123223
123261
|
}
|
|
123224
123262
|
catch (e) {
|
|
123225
123263
|
_this.logFile = undefined;
|
|
@@ -123235,7 +123273,7 @@ var ts;
|
|
|
123235
123273
|
return npmPath;
|
|
123236
123274
|
}
|
|
123237
123275
|
if (host.fileExists(npmPath)) {
|
|
123238
|
-
return "\""
|
|
123276
|
+
return "\"".concat(npmPath, "\"");
|
|
123239
123277
|
}
|
|
123240
123278
|
}
|
|
123241
123279
|
return "npm";
|
|
@@ -123243,7 +123281,7 @@ var ts;
|
|
|
123243
123281
|
function loadTypesRegistryFile(typesRegistryFilePath, host, log) {
|
|
123244
123282
|
if (!host.fileExists(typesRegistryFilePath)) {
|
|
123245
123283
|
if (log.isEnabled()) {
|
|
123246
|
-
log.writeLine("Types registry file '"
|
|
123284
|
+
log.writeLine("Types registry file '".concat(typesRegistryFilePath, "' does not exist"));
|
|
123247
123285
|
}
|
|
123248
123286
|
return new ts.Map();
|
|
123249
123287
|
}
|
|
@@ -123253,14 +123291,14 @@ var ts;
|
|
|
123253
123291
|
}
|
|
123254
123292
|
catch (e) {
|
|
123255
123293
|
if (log.isEnabled()) {
|
|
123256
|
-
log.writeLine("Error when loading types registry file '"
|
|
123294
|
+
log.writeLine("Error when loading types registry file '".concat(typesRegistryFilePath, "': ").concat(e.message, ", ").concat(e.stack));
|
|
123257
123295
|
}
|
|
123258
123296
|
return new ts.Map();
|
|
123259
123297
|
}
|
|
123260
123298
|
}
|
|
123261
123299
|
var typesRegistryPackageName = "types-registry";
|
|
123262
123300
|
function getTypesRegistryFileLocation(globalTypingsCacheLocation) {
|
|
123263
|
-
return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/"
|
|
123301
|
+
return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/".concat(typesRegistryPackageName, "/index.json"));
|
|
123264
123302
|
}
|
|
123265
123303
|
var NodeTypingsInstaller = (function (_super) {
|
|
123266
123304
|
__extends(NodeTypingsInstaller, _super);
|
|
@@ -123268,27 +123306,27 @@ var ts;
|
|
|
123268
123306
|
var _this = _super.call(this, ts.sys, globalTypingsCacheLocation, typingSafeListLocation ? ts.toPath(typingSafeListLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typingSafeList.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), typesMapLocation ? ts.toPath(typesMapLocation, "", ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)) : ts.toPath("typesMap.json", __dirname, ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)), throttleLimit, log) || this;
|
|
123269
123307
|
_this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation, _this.installTypingHost);
|
|
123270
123308
|
if (ts.stringContains(_this.npmPath, " ") && _this.npmPath[0] !== "\"") {
|
|
123271
|
-
_this.npmPath = "\""
|
|
123309
|
+
_this.npmPath = "\"".concat(_this.npmPath, "\"");
|
|
123272
123310
|
}
|
|
123273
123311
|
if (_this.log.isEnabled()) {
|
|
123274
|
-
_this.log.writeLine("Process id: "
|
|
123275
|
-
_this.log.writeLine("NPM location: "
|
|
123276
|
-
_this.log.writeLine("validateDefaultNpmLocation: "
|
|
123312
|
+
_this.log.writeLine("Process id: ".concat(process.pid));
|
|
123313
|
+
_this.log.writeLine("NPM location: ".concat(_this.npmPath, " (explicit '").concat(server.Arguments.NpmLocation, "' ").concat(npmLocation === undefined ? "not " : "", " provided)"));
|
|
123314
|
+
_this.log.writeLine("validateDefaultNpmLocation: ".concat(validateDefaultNpmLocation));
|
|
123277
123315
|
}
|
|
123278
123316
|
(_this.nodeExecSync = require("child_process").execSync);
|
|
123279
123317
|
_this.ensurePackageDirectoryExists(globalTypingsCacheLocation);
|
|
123280
123318
|
try {
|
|
123281
123319
|
if (_this.log.isEnabled()) {
|
|
123282
|
-
_this.log.writeLine("Updating "
|
|
123320
|
+
_this.log.writeLine("Updating ".concat(typesRegistryPackageName, " npm package..."));
|
|
123283
123321
|
}
|
|
123284
|
-
_this.execSyncAndLog(_this.npmPath
|
|
123322
|
+
_this.execSyncAndLog("".concat(_this.npmPath, " install --ignore-scripts ").concat(typesRegistryPackageName, "@").concat(_this.latestDistTag), { cwd: globalTypingsCacheLocation });
|
|
123285
123323
|
if (_this.log.isEnabled()) {
|
|
123286
|
-
_this.log.writeLine("Updated "
|
|
123324
|
+
_this.log.writeLine("Updated ".concat(typesRegistryPackageName, " npm package"));
|
|
123287
123325
|
}
|
|
123288
123326
|
}
|
|
123289
123327
|
catch (e) {
|
|
123290
123328
|
if (_this.log.isEnabled()) {
|
|
123291
|
-
_this.log.writeLine("Error updating "
|
|
123329
|
+
_this.log.writeLine("Error updating ".concat(typesRegistryPackageName, " package: ").concat(e.message));
|
|
123292
123330
|
}
|
|
123293
123331
|
_this.delayedInitializationError = {
|
|
123294
123332
|
kind: "event::initializationFailed",
|
|
@@ -123327,7 +123365,7 @@ var ts;
|
|
|
123327
123365
|
var cwd = getDirectoryOfPackageJson(fileName, _this.installTypingHost) || projectRootPath;
|
|
123328
123366
|
if (cwd) {
|
|
123329
123367
|
_this.installWorker(-1, [packageName_1], cwd, function (success) {
|
|
123330
|
-
var message = success ? "Package "
|
|
123368
|
+
var message = success ? "Package ".concat(packageName_1, " installed.") : "There was an error installing ".concat(packageName_1, ".");
|
|
123331
123369
|
var response = { kind: server.ActionPackageInstalled, projectName: projectName_1, success: success, message: message };
|
|
123332
123370
|
_this.sendResponse(response);
|
|
123333
123371
|
});
|
|
@@ -123345,7 +123383,7 @@ var ts;
|
|
|
123345
123383
|
};
|
|
123346
123384
|
NodeTypingsInstaller.prototype.sendResponse = function (response) {
|
|
123347
123385
|
if (this.log.isEnabled()) {
|
|
123348
|
-
this.log.writeLine("Sending response:\n "
|
|
123386
|
+
this.log.writeLine("Sending response:\n ".concat(JSON.stringify(response)));
|
|
123349
123387
|
}
|
|
123350
123388
|
process.send(response);
|
|
123351
123389
|
if (this.log.isEnabled()) {
|
|
@@ -123355,29 +123393,29 @@ var ts;
|
|
|
123355
123393
|
NodeTypingsInstaller.prototype.installWorker = function (requestId, packageNames, cwd, onRequestCompleted) {
|
|
123356
123394
|
var _this = this;
|
|
123357
123395
|
if (this.log.isEnabled()) {
|
|
123358
|
-
this.log.writeLine("#"
|
|
123396
|
+
this.log.writeLine("#".concat(requestId, " with arguments'").concat(JSON.stringify(packageNames), "'."));
|
|
123359
123397
|
}
|
|
123360
123398
|
var start = Date.now();
|
|
123361
123399
|
var hasError = typingsInstaller.installNpmPackages(this.npmPath, ts.version, packageNames, function (command) { return _this.execSyncAndLog(command, { cwd: cwd }); });
|
|
123362
123400
|
if (this.log.isEnabled()) {
|
|
123363
|
-
this.log.writeLine("npm install #"
|
|
123401
|
+
this.log.writeLine("npm install #".concat(requestId, " took: ").concat(Date.now() - start, " ms"));
|
|
123364
123402
|
}
|
|
123365
123403
|
onRequestCompleted(!hasError);
|
|
123366
123404
|
};
|
|
123367
123405
|
NodeTypingsInstaller.prototype.execSyncAndLog = function (command, options) {
|
|
123368
123406
|
if (this.log.isEnabled()) {
|
|
123369
|
-
this.log.writeLine("Exec: "
|
|
123407
|
+
this.log.writeLine("Exec: ".concat(command));
|
|
123370
123408
|
}
|
|
123371
123409
|
try {
|
|
123372
123410
|
var stdout = this.nodeExecSync(command, __assign(__assign({}, options), { encoding: "utf-8" }));
|
|
123373
123411
|
if (this.log.isEnabled()) {
|
|
123374
|
-
this.log.writeLine(" Succeeded. stdout:"
|
|
123412
|
+
this.log.writeLine(" Succeeded. stdout:".concat(indent(ts.sys.newLine, stdout)));
|
|
123375
123413
|
}
|
|
123376
123414
|
return false;
|
|
123377
123415
|
}
|
|
123378
123416
|
catch (error) {
|
|
123379
123417
|
var stdout = error.stdout, stderr = error.stderr;
|
|
123380
|
-
this.log.writeLine(" Failed. stdout:"
|
|
123418
|
+
this.log.writeLine(" Failed. stdout:".concat(indent(ts.sys.newLine, stdout)).concat(ts.sys.newLine, " stderr:").concat(indent(ts.sys.newLine, stderr)));
|
|
123381
123419
|
return true;
|
|
123382
123420
|
}
|
|
123383
123421
|
};
|
|
@@ -123400,7 +123438,7 @@ var ts;
|
|
|
123400
123438
|
var log = new FileLog(logFilePath);
|
|
123401
123439
|
if (log.isEnabled()) {
|
|
123402
123440
|
process.on("uncaughtException", function (e) {
|
|
123403
|
-
log.writeLine("Unhandled exception: "
|
|
123441
|
+
log.writeLine("Unhandled exception: ".concat(e, " at ").concat(e.stack));
|
|
123404
123442
|
});
|
|
123405
123443
|
}
|
|
123406
123444
|
process.on("disconnect", function () {
|
|
@@ -123413,7 +123451,7 @@ var ts;
|
|
|
123413
123451
|
installer.listen();
|
|
123414
123452
|
function indent(newline, str) {
|
|
123415
123453
|
return str && str.length
|
|
123416
|
-
? newline
|
|
123454
|
+
? "".concat(newline, " ") + str.replace(/\r?\n/, "".concat(newline, " "))
|
|
123417
123455
|
: "";
|
|
123418
123456
|
}
|
|
123419
123457
|
})(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
|