diff --git a/lib/cancellationToken.js b/lib/cancellationToken.js
index 76a6a60e729..0d4569c601b 100644
--- a/lib/cancellationToken.js
+++ b/lib/cancellationToken.js
@@ -49,7 +49,7 @@ function createCancellationToken(args) {
},
resetRequest: function (requestId) {
if (currentRequestId_1 !== requestId) {
- throw new Error("Mismatched request id, expected " + currentRequestId_1 + ", actual " + requestId);
+ throw new Error("Mismatched request id, expected ".concat(currentRequestId_1, ", actual ").concat(requestId));
}
perRequestPipeName_1 = undefined;
}
diff --git a/lib/tsc.js b/lib/tsc.js
index 61c31328899..49ef5010f3f 100644
--- a/lib/tsc.js
+++ b/lib/tsc.js
@@ -22,7 +22,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
ar[i] = from[i];
}
}
- return to.concat(ar || from);
+ return to.concat(ar || Array.prototype.slice.call(from));
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
var ts;
(function (ts) {
ts.versionMajorMinor = "4.6";
- ts.version = ts.versionMajorMinor + ".1-rc";
+ ts.version = "4.6.2";
var NativeCollections;
(function (NativeCollections) {
var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -94,7 +94,7 @@ var ts;
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
if (constructor)
return constructor;
- throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
+ throw new Error("TypeScript requires an environment that provides a compatible native ".concat(name, " implementation."));
}
})(ts || (ts = {}));
var ts;
@@ -1293,7 +1293,7 @@ var ts;
function cast(value, test) {
if (value !== undefined && test(value))
return value;
- return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'.");
+ return ts.Debug.fail("Invalid cast. The supplied value ".concat(value, " did not pass the test '").concat(ts.Debug.getFunctionName(test), "'."));
}
ts.cast = cast;
function noop(_) { }
@@ -1343,7 +1343,7 @@ var ts;
function memoizeOne(callback) {
var map = new ts.Map();
return function (arg) {
- var key = typeof arg + ":" + arg;
+ var key = "".concat(typeof arg, ":").concat(arg);
var value = map.get(key);
if (value === undefined && !map.has(key)) {
value = callback(arg);
@@ -1678,7 +1678,7 @@ var ts;
ts.createGetCanonicalFileName = createGetCanonicalFileName;
function patternText(_a) {
var prefix = _a.prefix, suffix = _a.suffix;
- return prefix + "*" + suffix;
+ return "".concat(prefix, "*").concat(suffix);
}
ts.patternText = patternText;
function matchedText(pattern, candidate) {
@@ -1947,7 +1947,7 @@ var ts;
}
function fail(message, stackCrawlMark) {
debugger;
- var e = new Error(message ? "Debug Failure. " + message : "Debug Failure.");
+ var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");
if (Error.captureStackTrace) {
Error.captureStackTrace(e, stackCrawlMark || fail);
}
@@ -1955,12 +1955,12 @@ var ts;
}
Debug.fail = fail;
function failBadSyntaxKind(node, message, stackCrawlMark) {
- return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", stackCrawlMark || failBadSyntaxKind);
+ return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind);
}
Debug.failBadSyntaxKind = failBadSyntaxKind;
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
if (!expression) {
- message = message ? "False expression: " + message : "False expression.";
+ message = message ? "False expression: ".concat(message) : "False expression.";
if (verboseDebugInfo) {
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
}
@@ -1970,26 +1970,26 @@ var ts;
Debug.assert = assert;
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
if (a !== b) {
- var message = msg ? msg2 ? msg + " " + msg2 : msg : "";
- fail("Expected " + a + " === " + b + ". " + message, stackCrawlMark || assertEqual);
+ var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
+ fail("Expected ".concat(a, " === ").concat(b, ". ").concat(message), stackCrawlMark || assertEqual);
}
}
Debug.assertEqual = assertEqual;
function assertLessThan(a, b, msg, stackCrawlMark) {
if (a >= b) {
- fail("Expected " + a + " < " + b + ". " + (msg || ""), stackCrawlMark || assertLessThan);
+ fail("Expected ".concat(a, " < ").concat(b, ". ").concat(msg || ""), stackCrawlMark || assertLessThan);
}
}
Debug.assertLessThan = assertLessThan;
function assertLessThanOrEqual(a, b, stackCrawlMark) {
if (a > b) {
- fail("Expected " + a + " <= " + b, stackCrawlMark || assertLessThanOrEqual);
+ fail("Expected ".concat(a, " <= ").concat(b), stackCrawlMark || assertLessThanOrEqual);
}
}
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
if (a < b) {
- fail("Expected " + a + " >= " + b, stackCrawlMark || assertGreaterThanOrEqual);
+ fail("Expected ".concat(a, " >= ").concat(b), stackCrawlMark || assertGreaterThanOrEqual);
}
}
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
@@ -2019,42 +2019,42 @@ var ts;
function assertNever(member, message, stackCrawlMark) {
if (message === void 0) { message = "Illegal value:"; }
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
- return fail(message + " " + detail, stackCrawlMark || assertNever);
+ return fail("".concat(message, " ").concat(detail), stackCrawlMark || assertNever);
}
Debug.assertNever = assertNever;
function assertEachNode(nodes, test, message, stackCrawlMark) {
if (shouldAssertFunction(1, "assertEachNode")) {
- assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertEachNode);
+ assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '".concat(getFunctionName(test), "'."); }, stackCrawlMark || assertEachNode);
}
}
Debug.assertEachNode = assertEachNode;
function assertNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1, "assertNode")) {
- assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNode);
+ 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);
}
}
Debug.assertNode = assertNode;
function assertNotNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1, "assertNotNode")) {
- assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " should not have passed test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNotNode);
+ 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);
}
}
Debug.assertNotNode = assertNotNode;
function assertOptionalNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1, "assertOptionalNode")) {
- assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertOptionalNode);
+ 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);
}
}
Debug.assertOptionalNode = assertOptionalNode;
function assertOptionalToken(node, kind, message, stackCrawlMark) {
if (shouldAssertFunction(1, "assertOptionalToken")) {
- assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, stackCrawlMark || assertOptionalToken);
+ 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);
}
}
Debug.assertOptionalToken = assertOptionalToken;
function assertMissingNode(node, message, stackCrawlMark) {
if (shouldAssertFunction(1, "assertMissingNode")) {
- assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, stackCrawlMark || assertMissingNode);
+ assert(node === undefined, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); }, stackCrawlMark || assertMissingNode);
}
}
Debug.assertMissingNode = assertMissingNode;
@@ -2075,7 +2075,7 @@ var ts;
}
Debug.getFunctionName = getFunctionName;
function formatSymbol(symbol) {
- return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }";
+ return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");
}
Debug.formatSymbol = formatSymbol;
function formatEnum(value, enumObject, isFlags) {
@@ -2093,7 +2093,7 @@ var ts;
break;
}
if (enumValue !== 0 && enumValue & value) {
- result = "" + result + (result ? "|" : "") + enumName;
+ result = "".concat(result).concat(result ? "|" : "").concat(enumName);
remainingFlags &= ~enumValue;
}
}
@@ -2202,7 +2202,7 @@ var ts;
this.flags & 1 ? "FlowUnreachable" :
"UnknownFlow";
var remainingFlags = this.flags & ~(2048 - 1);
- return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : "");
+ return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : "");
}
},
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, true); } },
@@ -2232,7 +2232,7 @@ var ts;
__tsDebuggerDisplay: {
value: function (defaultValue) {
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
- return "NodeArray " + defaultValue;
+ return "NodeArray ".concat(defaultValue);
}
}
});
@@ -2278,7 +2278,7 @@ var ts;
var symbolHeader = this.flags & 33554432 ? "TransientSymbol" :
"Symbol";
var remainingSymbolFlags = this.flags & ~33554432;
- return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : "");
+ return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
@@ -2287,11 +2287,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var typeHeader = this.flags & 98304 ? "NullableType" :
- this.flags & 384 ? "LiteralType " + JSON.stringify(this.value) :
- this.flags & 2048 ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" :
+ this.flags & 384 ? "LiteralType ".concat(JSON.stringify(this.value)) :
+ this.flags & 2048 ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") :
this.flags & 8192 ? "UniqueESSymbolType" :
this.flags & 32 ? "EnumType" :
- this.flags & 67359327 ? "IntrinsicType " + this.intrinsicName :
+ this.flags & 67359327 ? "IntrinsicType ".concat(this.intrinsicName) :
this.flags & 1048576 ? "UnionType" :
this.flags & 2097152 ? "IntersectionType" :
this.flags & 4194304 ? "IndexType" :
@@ -2310,7 +2310,7 @@ var ts;
"ObjectType" :
"Type";
var remainingObjectFlags = this.flags & 524288 ? this.objectFlags & ~1343 : 0;
- return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : "");
+ return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
@@ -2344,11 +2344,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
- ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" :
- ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" :
- ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") :
- ts.isNumericLiteral(this) ? "NumericLiteral " + this.text :
- ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" :
+ ts.isIdentifier(this) ? "Identifier '".concat(ts.idText(this), "'") :
+ ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
+ ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
+ ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
+ ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") :
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
ts.isParameter(this) ? "ParameterDeclaration" :
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
@@ -2380,7 +2380,7 @@ var ts;
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
ts.isImportTypeNode(this) ? "ImportTypeNode" :
formatSyntaxKind(this.kind);
- return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : "");
+ return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : "");
}
},
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
@@ -2424,10 +2424,10 @@ var ts;
Debug.enableDebugInfo = enableDebugInfo;
function formatDeprecationMessage(name, error, errorAfter, since, message) {
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
- deprecationMessage += "'" + name + "' ";
- deprecationMessage += since ? "has been deprecated since v" + since : "is deprecated";
- deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v" + errorAfter + "." : ".";
- deprecationMessage += message ? " " + ts.formatStringFromArgs(message, [name], 0) : "";
+ deprecationMessage += "'".concat(name, "' ");
+ deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
+ deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
+ deprecationMessage += message ? " ".concat(ts.formatStringFromArgs(message, [name], 0)) : "";
return deprecationMessage;
}
function createErrorDeprecation(name, errorAfter, since, message) {
@@ -2524,11 +2524,11 @@ var ts;
}
};
Version.prototype.toString = function () {
- var result = this.major + "." + this.minor + "." + this.patch;
+ var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
if (ts.some(this.prerelease))
- result += "-" + this.prerelease.join(".");
+ result += "-".concat(this.prerelease.join("."));
if (ts.some(this.build))
- result += "+" + this.build.join(".");
+ result += "+".concat(this.build.join("."));
return result;
};
Version.zero = new Version(0, 0, 0);
@@ -2750,7 +2750,7 @@ var ts;
return ts.map(comparators, formatComparator).join(" ");
}
function formatComparator(comparator) {
- return "" + comparator.operator + comparator.operand;
+ return "".concat(comparator.operator).concat(comparator.operand);
}
})(ts || (ts = {}));
var ts;
@@ -2979,7 +2979,7 @@ var ts;
fs = require("fs");
}
catch (e) {
- throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
+ throw new Error("tracing requires having fs\n(original error: ".concat(e.message || e, ")"));
}
}
mode = tracingMode;
@@ -2990,11 +2990,11 @@ var ts;
if (!fs.existsSync(traceDir)) {
fs.mkdirSync(traceDir, { recursive: true });
}
- var countPart = mode === "build" ? "." + process.pid + "-" + ++traceCount
- : mode === "server" ? "." + process.pid
+ var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount)
+ : mode === "server" ? ".".concat(process.pid)
: "";
- var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
- var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
+ var tracePath = ts.combinePaths(traceDir, "trace".concat(countPart, ".json"));
+ var typesPath = ts.combinePaths(traceDir, "types".concat(countPart, ".json"));
legend.push({
configFilePath: configFilePath,
tracePath: tracePath,
@@ -3062,7 +3062,7 @@ var ts;
writeEvent("E", phase, name, args, undefined, endTime);
}
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
- writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
+ writeEvent("X", phase, name, args, "\"dur\":".concat(endTime - time), time);
}
}
function writeEvent(eventType, phase, name, args, extras, time) {
@@ -3070,11 +3070,11 @@ var ts;
if (mode === "server" && phase === "checkTypes")
return;
ts.performance.mark("beginTracing");
- fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\"");
+ fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
if (extras)
- fs.writeSync(traceFd, "," + extras);
+ fs.writeSync(traceFd, ",".concat(extras));
if (args)
- fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args));
+ fs.writeSync(traceFd, ",\"args\":".concat(JSON.stringify(args)));
fs.writeSync(traceFd, "}");
ts.performance.mark("endTracing");
ts.performance.measure("Tracing", "beginTracing", "endTracing");
@@ -3394,7 +3394,7 @@ var ts;
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
function getLevel(envVar, level) {
- return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase());
+ return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
}
function getCustomLevels(baseVariable) {
var customLevels;
@@ -3818,7 +3818,7 @@ var ts;
}
function onTimerToUpdateChildWatches() {
timerToUpdateChildWatches = undefined;
- sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
var start = ts.timestamp();
var invokeMap = new ts.Map();
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
@@ -3829,7 +3829,7 @@ var ts;
var hasChanges = updateChildWatches(dirName, dirPath, options);
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
}
- sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
callbackCache.forEach(function (callbacks, rootDirName) {
var existing = invokeMap.get(rootDirName);
if (existing) {
@@ -3845,7 +3845,7 @@ var ts;
}
});
var elapsed = ts.timestamp() - start;
- sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
+ sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
}
function removeChildWatches(parentWatcher) {
if (!parentWatcher)
@@ -4237,7 +4237,7 @@ var ts;
var externalFileCounter = 0;
var remappedPaths = new ts.Map();
var normalizedDir = ts.normalizeSlashes(__dirname);
- var fileUrlRoot = "file://" + (ts.getRootLength(normalizedDir) === 1 ? "" : "/") + normalizedDir;
+ var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
var node = _a[_i];
if (node.callFrame.url) {
@@ -4246,7 +4246,7 @@ var ts;
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), true);
}
else if (!nativePattern.test(url)) {
- node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external" + externalFileCounter + ".js")).get(url);
+ node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
externalFileCounter++;
}
}
@@ -4262,7 +4262,7 @@ var ts;
if (!err) {
try {
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
- profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
+ profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
}
}
catch (_c) {
@@ -4347,7 +4347,7 @@ var ts;
}
};
function invokeCallbackAndUpdateWatcher(createWatcher) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
callback("rename", "");
if (watcher) {
watcher.close();
@@ -4364,7 +4364,7 @@ var ts;
}
}
if (hitSystemWatcherLimit) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
@@ -4376,7 +4376,7 @@ var ts;
}
catch (e) {
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
}
@@ -5295,6 +5295,8 @@ var ts;
Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),
+ Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, ts.DiagnosticCategory.Error, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."),
+ Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, ts.DiagnosticCategory.Error, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
@@ -7082,7 +7084,7 @@ var ts;
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
}
else {
- ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
+ 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"));
}
}
var res = lineStarts[line] + character;
@@ -9597,7 +9599,7 @@ var ts;
: "linkplain";
var name = link.name ? ts.entityNameToString(link.name) : "";
var space = link.name && link.text.startsWith("://") ? "" : " ";
- return "{@" + kind + " " + name + space + link.text + "}";
+ return "{@".concat(kind, " ").concat(name).concat(space).concat(link.text, "}");
}
function getEffectiveTypeParameterDeclarations(node) {
if (ts.isJSDocSignature(node)) {
@@ -10691,11 +10693,11 @@ var ts;
}
function packageIdToPackageName(_a) {
var name = _a.name, subModuleName = _a.subModuleName;
- return subModuleName ? name + "/" + subModuleName : name;
+ return subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
}
ts.packageIdToPackageName = packageIdToPackageName;
function packageIdToString(packageId) {
- return packageIdToPackageName(packageId) + "@" + packageId.version;
+ return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version);
}
ts.packageIdToString = packageIdToString;
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
@@ -10769,7 +10771,7 @@ var ts;
function nodePosToString(node) {
var file = getSourceFileOfNode(node);
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
- return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
+ return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
}
ts.nodePosToString = nodePosToString;
function getEndLinePosition(line, sourceFile) {
@@ -10870,7 +10872,7 @@ var ts;
ts.isPinnedComment = isPinnedComment;
function createCommentDirectivesMap(sourceFile, commentDirectives) {
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
- "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,
+ "".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
commentDirective,
]); }));
var usedLines = new ts.Map();
@@ -10887,10 +10889,10 @@ var ts;
});
}
function markUsed(line) {
- if (!directivesByLine.has("" + line)) {
+ if (!directivesByLine.has("".concat(line))) {
return false;
}
- usedLines.set("" + line, true);
+ usedLines.set("".concat(line), true);
return true;
}
}
@@ -11089,7 +11091,7 @@ var ts;
}
return node.text;
}
- return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
+ return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
}
ts.getLiteralText = getLiteralText;
function canUseOriginalText(node, flags) {
@@ -13424,11 +13426,11 @@ var ts;
}
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
function getPropertyNameForUniqueESSymbol(symbol) {
- return "__@" + ts.getSymbolId(symbol) + "@" + symbol.escapedName;
+ return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
}
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
- return "__#" + ts.getSymbolId(containingClassSymbol) + "@" + description;
+ return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
}
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
function isKnownSymbol(symbol) {
@@ -15725,7 +15727,7 @@ var ts;
}
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
function getJSXRuntimeImport(base, options) {
- return base ? base + "/" + (options.jsx === 5 ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
+ return base ? "".concat(base, "/").concat(options.jsx === 5 ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
}
ts.getJSXRuntimeImport = getJSXRuntimeImport;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -15823,15 +15825,15 @@ var ts;
}
var wildcardCharCodes = [42, 63];
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
- var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))";
+ var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
var filesMatcher = {
singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*",
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
};
var directoriesMatcher = {
singleAsteriskRegexFragment: "[^/]*",
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
};
var excludeMatcher = {
@@ -15849,9 +15851,9 @@ var ts;
if (!patterns || !patterns.length) {
return undefined;
}
- var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|");
+ var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
var terminator = usage === "exclude" ? "($|/)" : "$";
- return "^(" + pattern + ")" + terminator;
+ return "^(".concat(pattern, ")").concat(terminator);
}
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
function getRegularExpressionsForWildcards(specs, basePath, usage) {
@@ -15869,7 +15871,7 @@ var ts;
ts.isImplicitGlob = isImplicitGlob;
function getPatternFromSpec(spec, basePath, usage) {
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
- return pattern && "^(" + pattern + ")" + (usage === "exclude" ? "($|/)" : "$");
+ return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
}
ts.getPatternFromSpec = getPatternFromSpec;
function getSubPatternFromSpec(spec, basePath, usage, _a) {
@@ -15935,7 +15937,7 @@ var ts;
currentDirectory = ts.normalizePath(currentDirectory);
var absolutePath = ts.combinePaths(currentDirectory, path);
return {
- includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
+ includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
@@ -16180,7 +16182,7 @@ var ts;
ts.resolutionExtensionIsTSOrJson = resolutionExtensionIsTSOrJson;
function extensionFromPath(path) {
var ext = tryGetExtensionFromPath(path);
- return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension.");
+ return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
}
ts.extensionFromPath = extensionFromPath;
function isAnySupportedFileExtension(path) {
@@ -21251,7 +21253,7 @@ var ts;
case 326: return "augments";
case 327: return "implements";
default:
- return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
+ return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
}
}
var rawTextScanner;
@@ -21570,7 +21572,7 @@ var ts;
};
var definedTextGetter_1 = function (path) {
var result = textGetter_1(path);
- return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
+ return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
};
var buildInfo_1;
var getAndCacheBuildInfo_1 = function (getText) {
@@ -25232,7 +25234,7 @@ var ts;
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
var keyword = viableKeywordSuggestions_1[_i];
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
- return keyword + " " + expressionText.slice(keyword.length);
+ return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
}
}
return undefined;
@@ -30741,7 +30743,7 @@ var ts;
if (namedArgRegExCache.has(name)) {
return namedArgRegExCache.get(name);
}
- var result = new RegExp("(\\s" + name + "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))", "im");
+ var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
namedArgRegExCache.set(name, result);
return result;
}
@@ -32151,8 +32153,8 @@ var ts;
}
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
- var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
- return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
+ var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
+ return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
}
function parseCustomTypeOption(opt, value, errors) {
return convertJsonOptionOfCustomType(opt, ts.trimString(value || ""), errors);
@@ -32869,10 +32871,10 @@ var ts;
var newValue = compilerOptionsMap.get(cmd.name);
var defaultValue = getDefaultValueForOption(cmd);
if (newValue !== defaultValue) {
- result.push("" + tab + cmd.name + ": " + newValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
}
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
- result.push("" + tab + cmd.name + ": " + defaultValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
}
});
return result.join(newLine) + newLine;
@@ -32910,19 +32912,19 @@ var ts;
if (entries.length !== 0) {
entries.push({ value: "" });
}
- entries.push({ value: "/* " + category + " */" });
+ entries.push({ value: "/* ".concat(category, " */") });
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
var option = options_1[_i];
var optionName = void 0;
if (compilerOptionsMap.has(option.name)) {
- optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
+ optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
}
else {
- optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ",";
+ optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
}
entries.push({
value: optionName,
- description: "/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"
+ description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
});
marginLength = Math.max(optionName.length, marginLength);
}
@@ -32930,24 +32932,24 @@ var ts;
var tab = makePadding(2);
var result = [];
result.push("{");
- result.push(tab + "\"compilerOptions\": {");
- result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + " */");
+ result.push("".concat(tab, "\"compilerOptions\": {"));
+ 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), " */"));
result.push("");
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
var entry = entries_2[_a];
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
- result.push(value && "" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));
+ result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
}
if (fileNames.length) {
- result.push(tab + "},");
- result.push(tab + "\"files\": [");
+ result.push("".concat(tab, "},"));
+ result.push("".concat(tab, "\"files\": ["));
for (var i = 0; i < fileNames.length; i++) {
- result.push("" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? "" : ","));
+ result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
}
- result.push(tab + "]");
+ result.push("".concat(tab, "]"));
}
else {
- result.push(tab + "}");
+ result.push("".concat(tab, "}"));
}
result.push("}");
return result.join(newLine) + newLine;
@@ -33297,7 +33299,7 @@ var ts;
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) {
- extendedConfigPath = extendedConfigPath + ".json";
+ extendedConfigPath = "".concat(extendedConfigPath, ".json");
if (!host.fileExists(extendedConfigPath)) {
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
return undefined;
@@ -33493,7 +33495,7 @@ var ts;
if (ts.fileExtensionIs(file, ".json")) {
if (!jsonOnlyIncludeRegexes) {
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json"); });
- var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^" + pattern + "$"; });
+ var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
}
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
@@ -33865,7 +33867,7 @@ var ts;
var bestVersionKey = result.version, bestVersionPaths = result.paths;
if (typeof bestVersionPaths !== "object") {
if (state.traceEnabled) {
- trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['" + bestVersionKey + "']", "object", typeof bestVersionPaths);
+ trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
}
return;
}
@@ -34234,7 +34236,7 @@ var ts;
};
return cache;
function getUnderlyingCacheKey(specifier, mode) {
- var result = mode === undefined ? specifier : mode + "|" + specifier;
+ var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
memoizedReverseKeys.set(result, [specifier, mode]);
return result;
}
@@ -34264,7 +34266,7 @@ var ts;
}
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
- return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode + "|" + nonRelativeModuleName, createPerModuleNameCache);
+ return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
}
function createPerModuleNameCache() {
var directoryPathMap = new ts.Map();
@@ -34392,10 +34394,10 @@ var ts;
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
break;
default:
- return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
+ return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
}
if (result && result.resolvedModule)
- ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
+ ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
if (perFolderCache) {
perFolderCache.set(moduleName, resolutionMode, result);
@@ -34525,7 +34527,7 @@ var ts;
function resolveJSModule(moduleName, initialDir, host) {
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
if (!resolvedModule) {
- throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", "));
+ throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
}
return resolvedModule.resolvedFileName;
}
@@ -34624,7 +34626,7 @@ var ts;
if (traceEnabled) {
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
}
- ts.Debug.assert(host.fileExists(real), path + " linked to nonexistent file " + real);
+ ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
return real;
}
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
@@ -35056,7 +35058,7 @@ var ts;
return undefined;
}
var trailingParts = parts.slice(nameParts.length);
- return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
+ return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
}
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
if (!scope.packageJsonContent.exports) {
@@ -35368,7 +35370,7 @@ var ts;
return mangled;
}
function getTypesPackageName(packageName) {
- return "@types/" + mangleScopedPackageName(packageName);
+ return "@types/".concat(mangleScopedPackageName(packageName));
}
ts.getTypesPackageName = getTypesPackageName;
function mangleScopedPackageName(packageName) {
@@ -35694,7 +35696,7 @@ var ts;
if (name) {
if (ts.isAmbientModule(node)) {
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
- return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
+ return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
}
if (name.kind === 161) {
var nameExpression = name.expression;
@@ -35743,7 +35745,7 @@ var ts;
case 315:
return (ts.isJSDocConstructSignature(node) ? "__new" : "__call");
case 163:
- ts.Debug.assert(node.parent.kind === 315, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ ts.Debug.assert(node.parent.kind === 315, "Impossible parameter parent kind", function () { return "parent is: ".concat(ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind, ", expected JSDocFunctionType"); });
var functionType = node.parent;
var index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -35809,7 +35811,7 @@ var ts;
}
var relatedInformation_1 = [];
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1) && symbol.flags & (2097152 | 788968 | 1920)) {
- relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { " + ts.unescapeLeadingUnderscores(node.name.escapedText) + " }"));
+ relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
}
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
ts.forEach(symbol.declarations, function (declaration, index) {
@@ -37631,7 +37633,7 @@ var ts;
}
}
function bindSourceFileAsExternalModule() {
- bindAnonymousDeclaration(file, 512, "\"" + ts.removeFileExtension(file.fileName) + "\"");
+ bindAnonymousDeclaration(file, 512, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
}
function bindExportAssignment(node) {
if (!container.symbol || !container.symbol.exports) {
@@ -39350,7 +39352,7 @@ var ts;
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 ? sourceSymbolFile : targetSymbolFile;
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
- var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + "|" + secondFile_1.path, function () {
+ var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
});
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
@@ -41634,7 +41636,7 @@ var ts;
var links = getSymbolLinks(symbol);
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
- var key = (useOnlyExternalAliasing ? 0 : 1) + "|" + (firstRelevantLocation && getNodeId(firstRelevantLocation)) + "|" + meaning;
+ var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
if (cache.has(key)) {
return cache.get(key);
}
@@ -42402,7 +42404,7 @@ var ts;
context.symbolDepth = new ts.Map();
}
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
- var key = getTypeId(type) + "|" + context.flags;
+ var key = "".concat(getTypeId(type), "|").concat(context.flags);
if (links) {
links.serializedTypes || (links.serializedTypes = new ts.Map());
}
@@ -42657,7 +42659,7 @@ var ts;
}
}
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
- typeElements.push(ts.factory.createPropertySignature(undefined, "... " + (properties.length - i) + " more ...", undefined, undefined));
+ typeElements.push(ts.factory.createPropertySignature(undefined, "... ".concat(properties.length - i, " more ..."), undefined, undefined));
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
break;
}
@@ -42765,7 +42767,7 @@ var ts;
else if (types.length > 2) {
return [
typeToTypeNodeHelper(types[0], context),
- ts.factory.createTypeReferenceNode("... " + (types.length - 2) + " more ...", undefined),
+ ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), undefined),
typeToTypeNodeHelper(types[types.length - 1], context)
];
}
@@ -42778,7 +42780,7 @@ var ts;
var type = types_2[_i];
i++;
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
- result_5.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", undefined));
+ result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), undefined));
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
if (typeNode_1) {
result_5.push(typeNode_1);
@@ -43254,7 +43256,7 @@ var ts;
var text = rawtext;
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
i++;
- text = rawtext + "_" + i;
+ text = "".concat(rawtext, "_").concat(i);
}
if (text !== rawtext) {
result = ts.factory.createIdentifier(text, result.typeArguments);
@@ -43536,7 +43538,7 @@ var ts;
function getNameForJSDocFunctionParameter(p, index) {
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
: getEffectiveDotDotDotForParameter(p) ? "args"
- : "arg" + index;
+ : "arg".concat(index);
}
function rewriteModuleSpecifier(parent, lit) {
if (bundled) {
@@ -44345,7 +44347,7 @@ var ts;
}
return results_1;
}
- return ts.Debug.fail("Unhandled class member kind! " + (p.__debugFlags || p.flags));
+ return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
};
}
function serializePropertySymbolForInterface(p, baseType) {
@@ -44415,7 +44417,7 @@ var ts;
if (ref) {
return ref;
}
- var tempName = getUnusedName(rootName + "_base");
+ var tempName = getUnusedName("".concat(rootName, "_base"));
var statement = ts.factory.createVariableStatement(undefined, ts.factory.createVariableDeclarationList([
ts.factory.createVariableDeclaration(tempName, undefined, typeToTypeNodeHelper(staticType, context))
], 2));
@@ -44460,7 +44462,7 @@ var ts;
var original = input;
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
i++;
- input = original + "_" + i;
+ input = "".concat(original, "_").concat(i);
}
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
if (id) {
@@ -44566,15 +44568,15 @@ var ts;
if (nameType.flags & 384) {
var name = "" + nameType.value;
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
- return "\"" + ts.escapeString(name, 34) + "\"";
+ return "\"".concat(ts.escapeString(name, 34), "\"");
}
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
- return "[" + name + "]";
+ return "[".concat(name, "]");
}
return name;
}
if (nameType.flags & 8192) {
- return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
+ return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
}
}
}
@@ -47019,7 +47021,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 | (isOptional && !isRestParam ? 16777216 : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 | (isOptional && !isRestParam ? 16777216 : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -48732,7 +48734,7 @@ var ts;
return result;
}
function getAliasId(aliasSymbol, aliasTypeArguments) {
- return aliasSymbol ? "@" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? ":" + getTypeListId(aliasTypeArguments) : "") : "";
+ return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
}
function getPropagatingFlagsOfTypes(types, excludeKinds) {
var result = 0;
@@ -48895,7 +48897,7 @@ var ts;
return undefined;
}
function getSymbolPath(symbol) {
- return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
+ return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
var identifier = name.kind === 160 ? name.right :
@@ -48906,7 +48908,7 @@ var ts;
var parentSymbol = name.kind === 160 ? getUnresolvedSymbolForEntityName(name.left) :
name.kind === 205 ? getUnresolvedSymbolForEntityName(name.expression) :
undefined;
- var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
+ var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
var result = unresolvedSymbols.get(path);
if (!result) {
unresolvedSymbols.set(path, result = createSymbol(524288, text, 1048576));
@@ -48972,7 +48974,7 @@ var ts;
if (substitute.flags & 3 || substitute === baseType) {
return baseType;
}
- var id = getTypeId(baseType) + ">" + getTypeId(substitute);
+ var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
var cached = substitutionTypes.get(id);
if (cached) {
return cached;
@@ -49816,9 +49818,9 @@ var ts;
return types[0];
}
var typeKey = !origin ? getTypeListId(types) :
- origin.flags & 1048576 ? "|" + getTypeListId(origin.types) :
- origin.flags & 2097152 ? "&" + getTypeListId(origin.types) :
- "#" + origin.type.id + "|" + getTypeListId(types);
+ origin.flags & 1048576 ? "|".concat(getTypeListId(origin.types)) :
+ origin.flags & 2097152 ? "&".concat(getTypeListId(origin.types)) :
+ "#".concat(origin.type.id, "|").concat(getTypeListId(types));
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
var type = unionTypes.get(id);
if (!type) {
@@ -50268,7 +50270,7 @@ var ts;
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4); })) {
return stringType;
}
- var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join("");
+ var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
var type = templateLiteralTypes.get(id);
if (!type) {
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
@@ -50328,7 +50330,7 @@ var ts;
return str;
}
function getStringMappingTypeForGenericType(symbol, type) {
- var id = getSymbolId(symbol) + "," + getTypeId(type);
+ var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
var result = stringMappingTypes.get(id);
if (!result) {
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
@@ -51236,7 +51238,7 @@ var ts;
function createUniqueESSymbolType(symbol) {
var type = createType(8192);
type.symbol = symbol;
- type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
+ type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
return type;
}
function getESSymbolLikeTypeForNode(node) {
@@ -52669,11 +52671,11 @@ var ts;
var overflow = false;
var overrideNextErrorInfo = 0;
var lastSkippedInfo;
- var incompatibleStack = [];
+ var incompatibleStack;
var inPropertyCheck = false;
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
var result = isRelatedTo(source, target, 3, !!errorNode, headMessage);
- if (incompatibleStack.length) {
+ if (incompatibleStack) {
reportIncompatibleStack();
}
if (overflow) {
@@ -52728,19 +52730,19 @@ var ts;
return {
errorInfo: errorInfo,
lastSkippedInfo: lastSkippedInfo,
- incompatibleStack: incompatibleStack.slice(),
+ incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
overrideNextErrorInfo: overrideNextErrorInfo,
- relatedInfo: !relatedInfo ? undefined : relatedInfo.slice()
+ relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
};
}
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
overrideNextErrorInfo++;
lastSkippedInfo = undefined;
- incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
+ (incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
}
function reportIncompatibleStack() {
- var stack = incompatibleStack;
- incompatibleStack = [];
+ var stack = incompatibleStack || [];
+ incompatibleStack = undefined;
var info = lastSkippedInfo;
lastSkippedInfo = undefined;
if (stack.length === 1) {
@@ -52757,20 +52759,20 @@ var ts;
switch (msg.code) {
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
if (path.indexOf("new ") === 0) {
- path = "(" + path + ")";
+ path = "(".concat(path, ")");
}
var str = "" + args[0];
if (path.length === 0) {
- path = "" + str;
+ path = "".concat(str);
}
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
- path = path + "." + str;
+ path = "".concat(path, ".").concat(str);
}
else if (str[0] === "[" && str[str.length - 1] === "]") {
- path = "" + path + str;
+ path = "".concat(path).concat(str);
}
else {
- path = path + "[" + str + "]";
+ path = "".concat(path, "[").concat(str, "]");
}
break;
}
@@ -52797,7 +52799,7 @@ var ts;
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
? ""
: "...";
- path = "" + prefix + path + "(" + params + ")";
+ path = "".concat(prefix).concat(path, "(").concat(params, ")");
}
break;
}
@@ -52810,7 +52812,7 @@ var ts;
break;
}
default:
- return ts.Debug.fail("Unhandled Diagnostic: " + msg.code);
+ return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
}
}
if (path) {
@@ -52834,7 +52836,7 @@ var ts;
}
function reportError(message, arg0, arg1, arg2, arg3) {
ts.Debug.assert(!!errorNode);
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
if (message.elidedInCompatabilityPyramid)
return;
@@ -52850,7 +52852,7 @@ var ts;
}
}
function reportRelationError(message, source, target) {
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
var generalizedSource = source;
@@ -52941,7 +52943,9 @@ var ts;
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
return -1;
}
- reportErrorResults(originalSource, originalTarget, 0, !!(ts.getObjectFlags(originalSource) & 2048));
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
+ }
return 0;
}
var source = getNormalizedType(originalSource, false);
@@ -52949,127 +52953,121 @@ var ts;
if (source === target)
return -1;
if (relation === identityRelation) {
- return isIdenticalTo(source, target, recursionFlags);
+ if (source.flags !== target.flags)
+ return 0;
+ if (source.flags & 67358815)
+ return -1;
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
}
if (source.flags & 262144 && getConstraintOfType(source) === target) {
return -1;
}
- if (target.flags & 1048576 && source.flags & 524288 &&
- target.types.length <= 3 && maybeTypeOfKind(target, 98304)) {
- var nullStrippedTarget = extractTypesOfKind(target, ~98304);
- if (!(nullStrippedTarget.flags & (1048576 | 131072))) {
- target = getNormalizedType(nullStrippedTarget, true);
+ if (source.flags & 470302716 && target.flags & 1048576) {
+ var types = target.types;
+ var candidate = types.length === 2 && types[0].flags & 98304 ? types[1] :
+ types.length === 3 && types[0].flags & 98304 && types[1].flags & 98304 ? types[2] :
+ undefined;
+ if (candidate && !(candidate.flags & 98304)) {
+ target = getNormalizedType(candidate, true);
+ if (source === target)
+ return -1;
}
- if (source === nullStrippedTarget)
- return -1;
}
if (relation === comparableRelation && !(target.flags & 131072) && isSimpleTypeRelatedTo(target, source, relation) ||
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
return -1;
- var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048);
- var isPerformingExcessPropertyChecks = !(intersectionState & 2) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384);
- if (isPerformingExcessPropertyChecks) {
- if (hasExcessProperties(source, target, reportErrors)) {
+ if (source.flags & 469499904 || target.flags & 469499904) {
+ var isPerformingExcessPropertyChecks = !(intersectionState & 2) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384);
+ if (isPerformingExcessPropertyChecks) {
+ if (hasExcessProperties(source, target, reportErrors)) {
+ if (reportErrors) {
+ reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ }
+ return 0;
+ }
+ }
+ var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2) &&
+ source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
+ target.flags & (524288 | 2097152) && isWeakType(target) &&
+ (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
+ var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048);
+ if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
if (reportErrors) {
- reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
+ var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
+ var calls = getSignaturesOfType(source, 0);
+ var constructs = getSignaturesOfType(source, 1);
+ if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
+ constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
+ reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
+ }
+ else {
+ reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
+ }
}
return 0;
}
- }
- var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2) &&
- source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
- target.flags & (524288 | 2097152) && isWeakType(target) &&
- (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
- if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
- if (reportErrors) {
- var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
- var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
- var calls = getSignaturesOfType(source, 0);
- var constructs = getSignaturesOfType(source, 1);
- if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
- constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
- reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
- }
- else {
- reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
- }
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ var skipCaching = source.flags & 1048576 && source.types.length < 4 && !(target.flags & 1048576) ||
+ target.flags & 1048576 && target.types.length < 4 && !(source.flags & 469499904);
+ var result_7 = skipCaching ?
+ unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
+ recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
+ if (result_7 && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
+ isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288); }))) {
+ inPropertyCheck = true;
+ result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
+ inPropertyCheck = false;
}
- return 0;
- }
- traceUnionsOrIntersectionsTooLarge(source, target);
- var result = 0;
- var saveErrorInfo = captureErrorCalculationState();
- if ((source.flags & 1048576 || target.flags & 1048576) && getConstituentCount(source) * getConstituentCount(target) < 4) {
- result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8);
- }
- else if (source.flags & 3145728 || target.flags & 3145728) {
- result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8, recursionFlags);
- }
- if (!result && !(source.flags & 1048576) && (source.flags & (469499904) || target.flags & 469499904)) {
- if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
- resetErrorInfo(saveErrorInfo);
+ if (result_7) {
+ return result_7;
}
}
- if (!result && source.flags & (2097152 | 262144)) {
- var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
- if (constraint && (source.flags & 2097152 || target.flags & 1048576)) {
- if (everyType(constraint, function (c) { return c !== source; })) {
- if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
- resetErrorInfo(saveErrorInfo);
- }
- }
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, source, target, headMessage);
+ }
+ return 0;
+ }
+ function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
+ var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
+ var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
+ source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
+ target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
+ var maybeSuppress = overrideNextErrorInfo > 0;
+ if (maybeSuppress) {
+ overrideNextErrorInfo--;
+ }
+ if (source.flags & 524288 && target.flags & 524288) {
+ var currentError = errorInfo;
+ tryElaborateArrayLikeErrors(source, target, true);
+ if (errorInfo !== currentError) {
+ maybeSuppress = !!errorInfo;
}
}
- if (result && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
- isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288); }))) {
- inPropertyCheck = true;
- result &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
- inPropertyCheck = false;
+ if (source.flags & 524288 && target.flags & 131068) {
+ tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
- reportErrorResults(source, target, result, isComparingJsxAttributes);
- return result;
- function reportErrorResults(source, target, result, isComparingJsxAttributes) {
- if (!result && reportErrors) {
- var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
- var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
- source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
- target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
- var maybeSuppress = overrideNextErrorInfo > 0;
- if (maybeSuppress) {
- overrideNextErrorInfo--;
- }
- if (source.flags & 524288 && target.flags & 524288) {
- var currentError = errorInfo;
- tryElaborateArrayLikeErrors(source, target, reportErrors);
- if (errorInfo !== currentError) {
- maybeSuppress = !!errorInfo;
- }
- }
- if (source.flags & 524288 && target.flags & 131068) {
- tryElaborateErrorsForPrimitivesAndObjects(source, target);
- }
- else if (source.symbol && source.flags & 524288 && globalObjectType === source) {
- reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
- }
- else if (isComparingJsxAttributes && target.flags & 2097152) {
- var targetTypes = target.types;
- var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
- var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
- if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
- (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
- return result;
- }
- }
- else {
- errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
- }
- if (!headMessage && maybeSuppress) {
- lastSkippedInfo = [source, target];
- return result;
- }
- reportRelationError(headMessage, source, target);
+ else if (source.symbol && source.flags & 524288 && globalObjectType === source) {
+ reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
+ }
+ else if (ts.getObjectFlags(source) & 2048 && target.flags & 2097152) {
+ var targetTypes = target.types;
+ var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
+ var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
+ if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
+ (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
+ return;
}
}
+ else {
+ errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
+ }
+ if (!headMessage && maybeSuppress) {
+ lastSkippedInfo = [source, target];
+ return;
+ }
+ reportRelationError(headMessage, source, target);
}
function traceUnionsOrIntersectionsTooLarge(source, target) {
if (!ts.tracing) {
@@ -53095,21 +53093,6 @@ var ts;
}
}
}
- function isIdenticalTo(source, target, recursionFlags) {
- if (source.flags !== target.flags)
- return 0;
- if (source.flags & 67358815)
- return -1;
- traceUnionsOrIntersectionsTooLarge(source, target);
- if (source.flags & 3145728) {
- var result_7 = eachTypeRelatedToSomeType(source, target);
- if (result_7) {
- result_7 &= eachTypeRelatedToSomeType(target, source);
- }
- return result_7;
- }
- return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
- }
function getTypeOfPropertyInTypes(types, name) {
var appendPropType = function (propTypes, type) {
var _a;
@@ -53198,6 +53181,29 @@ var ts;
function shouldCheckAsExcessProperty(prop, container) {
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
}
+ function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
+ if (source.flags & 1048576) {
+ return relation === comparableRelation ?
+ someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState) :
+ eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState);
+ }
+ if (target.flags & 1048576) {
+ return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068) && !(target.flags & 131068));
+ }
+ if (target.flags & 2097152) {
+ return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2);
+ }
+ if (relation === comparableRelation && target.flags & 131068) {
+ var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
+ if (constraints !== source.types) {
+ source = getIntersectionType(constraints);
+ if (!(source.flags & 2097152)) {
+ return isRelatedTo(source, target, 1, false);
+ }
+ }
+ }
+ return someTypeRelatedToType(source, target, false, 1);
+ }
function eachTypeRelatedToSomeType(source, target) {
var result = -1;
var sourceTypes = source.types;
@@ -53234,7 +53240,9 @@ var ts;
}
if (reportErrors) {
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
- isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], 2, true);
+ if (bestMatchingType) {
+ isRelatedTo(source, bestMatchingType, 2, true);
+ }
}
return 0;
}
@@ -53342,7 +53350,7 @@ var ts;
if (overflow) {
return 0;
}
- var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 : 0);
+ var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 : 0);
var id = getRelationKey(source, target, keyIntersectionState, relation, false);
var entry = relation.get(id);
if (entry !== undefined) {
@@ -53403,6 +53411,7 @@ var ts;
return originalHandler(onlyUnreliable);
};
}
+ var result;
if (expandingFlags === 3) {
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "recursiveTypeRelatedTo_DepthLimit", {
sourceId: source.id,
@@ -53412,8 +53421,13 @@ var ts;
depth: sourceDepth,
targetDepth: targetDepth
});
+ result = 3;
+ }
+ else {
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
+ result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
}
- var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3;
if (outofbandVarianceMarkerHandler) {
outofbandVarianceMarkerHandler = originalHandler;
}
@@ -53441,74 +53455,73 @@ var ts;
return result;
}
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
- var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
- return result;
- }
- function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
if (intersectionState & 4) {
return propertiesRelatedTo(source, target, reportErrors, undefined, 0);
}
- if (intersectionState & 8) {
- if (source.flags & 1048576) {
- return relation === comparableRelation ?
- someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState & ~8) :
- eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState & ~8);
- }
- if (target.flags & 1048576) {
- return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068) && !(target.flags & 131068));
- }
- if (target.flags & 2097152) {
- return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2);
- }
- if (relation === comparableRelation && target.flags & 131068) {
- var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
- if (constraints !== source.types) {
- source = getIntersectionType(constraints);
- if (!(source.flags & 2097152)) {
- return isRelatedTo(source, target, 1, false);
- }
+ var result;
+ var originalErrorInfo;
+ var varianceCheckFailed = false;
+ var saveErrorInfo = captureErrorCalculationState();
+ var sourceFlags = source.flags;
+ var targetFlags = target.flags;
+ if (relation === identityRelation) {
+ if (sourceFlags & 3145728) {
+ var result_8 = eachTypeRelatedToSomeType(source, target);
+ if (result_8) {
+ result_8 &= eachTypeRelatedToSomeType(target, source);
}
+ return result_8;
}
- return someTypeRelatedToType(source, target, false, 1);
- }
- var flags = source.flags & target.flags;
- if (relation === identityRelation && !(flags & 524288)) {
- if (flags & 4194304) {
+ if (sourceFlags & 4194304) {
return isRelatedTo(source.type, target.type, 3, false);
}
- var result_8 = 0;
- if (flags & 8388608) {
- if (result_8 = isRelatedTo(source.objectType, target.objectType, 3, false)) {
- if (result_8 &= isRelatedTo(source.indexType, target.indexType, 3, false)) {
- return result_8;
+ if (sourceFlags & 8388608) {
+ if (result = isRelatedTo(source.objectType, target.objectType, 3, false)) {
+ if (result &= isRelatedTo(source.indexType, target.indexType, 3, false)) {
+ return result;
}
}
}
- if (flags & 16777216) {
+ if (sourceFlags & 16777216) {
if (source.root.isDistributive === target.root.isDistributive) {
- if (result_8 = isRelatedTo(source.checkType, target.checkType, 3, false)) {
- if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, 3, false)) {
- if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3, false)) {
- if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3, false)) {
- return result_8;
+ if (result = isRelatedTo(source.checkType, target.checkType, 3, false)) {
+ if (result &= isRelatedTo(source.extendsType, target.extendsType, 3, false)) {
+ if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3, false)) {
+ if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3, false)) {
+ return result;
}
}
}
}
}
}
- if (flags & 33554432) {
+ if (sourceFlags & 33554432) {
return isRelatedTo(source.substitute, target.substitute, 3, false);
}
- return 0;
+ if (!(sourceFlags & 524288)) {
+ return 0;
+ }
}
- var result;
- var originalErrorInfo;
- var varianceCheckFailed = false;
- var saveErrorInfo = captureErrorCalculationState();
- if (source.flags & (524288 | 16777216) && source.aliasSymbol &&
+ else if (sourceFlags & 3145728 || targetFlags & 3145728) {
+ if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
+ return result;
+ }
+ if (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576) {
+ var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
+ if (constraint && everyType(constraint, function (c) { return c !== source; })) {
+ if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
+ resetErrorInfo(saveErrorInfo);
+ return result;
+ }
+ }
+ }
+ if (!(sourceFlags & 465829888 ||
+ sourceFlags & 524288 && targetFlags & 1048576 ||
+ sourceFlags & 2097152 && targetFlags & (524288 | 1048576 | 465829888))) {
+ return 0;
+ }
+ }
+ if (sourceFlags & (524288 | 16777216) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
var variances = getAliasVariances(source.aliasSymbol);
@@ -53524,7 +53537,7 @@ var ts;
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2))) {
return result;
}
- if (target.flags & 262144) {
+ if (targetFlags & 262144) {
if (ts.getObjectFlags(source) & 32 && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3)) {
if (!(getMappedTypeModifiers(source) & 4)) {
var templateType = getTemplateTypeFromMappedType(source);
@@ -53535,9 +53548,9 @@ var ts;
}
}
}
- else if (target.flags & 4194304) {
+ else if (targetFlags & 4194304) {
var targetType_1 = target.type;
- if (source.flags & 4194304) {
+ if (sourceFlags & 4194304) {
if (result = isRelatedTo(targetType_1, source.type, 3, false)) {
return result;
}
@@ -53573,8 +53586,8 @@ var ts;
}
}
}
- else if (target.flags & 8388608) {
- if (source.flags & 8388608) {
+ else if (targetFlags & 8388608) {
+ if (sourceFlags & 8388608) {
if (result = isRelatedTo(source.objectType, target.objectType, 3, reportErrors)) {
result &= isRelatedTo(source.indexType, target.indexType, 3, reportErrors);
}
@@ -53653,7 +53666,7 @@ var ts;
}
}
}
- else if (target.flags & 16777216) {
+ else if (targetFlags & 16777216) {
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
resetErrorInfo(saveErrorInfo);
return 3;
@@ -53671,8 +53684,8 @@ var ts;
}
}
}
- else if (target.flags & 134217728) {
- if (source.flags & 134217728) {
+ else if (targetFlags & 134217728) {
+ if (sourceFlags & 134217728) {
if (relation === comparableRelation) {
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 : -1;
}
@@ -53682,10 +53695,10 @@ var ts;
return -1;
}
}
- if (source.flags & 8650752) {
- if (!(source.flags & 8388608 && target.flags & 8388608)) {
+ if (sourceFlags & 8650752) {
+ if (!(sourceFlags & 8388608 && targetFlags & 8388608)) {
var constraint = getConstraintOfType(source);
- if (!constraint || (source.flags & 262144 && constraint.flags & 1)) {
+ if (!constraint || (sourceFlags & 262144 && constraint.flags & 1)) {
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
resetErrorInfo(saveErrorInfo);
return result;
@@ -53695,7 +53708,7 @@ var ts;
resetErrorInfo(saveErrorInfo);
return result;
}
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(target.flags & source.flags & 262144), undefined, intersectionState)) {
+ else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(targetFlags & sourceFlags & 262144), undefined, intersectionState)) {
resetErrorInfo(saveErrorInfo);
return result;
}
@@ -53710,14 +53723,14 @@ var ts;
}
}
}
- else if (source.flags & 4194304) {
+ else if (sourceFlags & 4194304) {
if (result = isRelatedTo(keyofConstraintType, target, 1, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
}
}
- else if (source.flags & 134217728 && !(target.flags & 524288)) {
- if (!(target.flags & 134217728)) {
+ else if (sourceFlags & 134217728 && !(targetFlags & 524288)) {
+ if (!(targetFlags & 134217728)) {
var constraint = getBaseConstraintOfType(source);
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1, reportErrors))) {
resetErrorInfo(saveErrorInfo);
@@ -53725,8 +53738,8 @@ var ts;
}
}
}
- else if (source.flags & 268435456) {
- if (target.flags & 268435456 && source.symbol === target.symbol) {
+ else if (sourceFlags & 268435456) {
+ if (targetFlags & 268435456 && source.symbol === target.symbol) {
if (result = isRelatedTo(source.type, target.type, 3, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
@@ -53740,12 +53753,12 @@ var ts;
}
}
}
- else if (source.flags & 16777216) {
+ else if (sourceFlags & 16777216) {
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
resetErrorInfo(saveErrorInfo);
return 3;
}
- if (target.flags & 16777216) {
+ if (targetFlags & 16777216) {
var sourceParams = source.root.inferTypeParameters;
var sourceExtends = source.extendsType;
var mapper = void 0;
@@ -53796,9 +53809,10 @@ var ts;
}
return 0;
}
- var sourceIsPrimitive = !!(source.flags & 131068);
+ var sourceIsPrimitive = !!(sourceFlags & 131068);
if (relation !== identityRelation) {
source = getApparentType(source);
+ sourceFlags = source.flags;
}
else if (isGenericMappedType(source)) {
return 0;
@@ -53825,7 +53839,7 @@ var ts;
else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 16384 && !isEmptyObjectType(source)) {
return 0;
}
- if (source.flags & (524288 | 2097152) && target.flags & 524288) {
+ if (sourceFlags & (524288 | 2097152) && targetFlags & 524288) {
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
result = propertiesRelatedTo(source, target, reportStructuralErrors, undefined, intersectionState);
if (result) {
@@ -53844,7 +53858,7 @@ var ts;
return result;
}
}
- if (source.flags & (524288 | 2097152) && target.flags & 1048576) {
+ if (sourceFlags & (524288 | 2097152) && targetFlags & 1048576) {
var objectOnlyTarget = extractTypesOfKind(target, 524288 | 2097152 | 33554432);
if (objectOnlyTarget.flags & 1048576) {
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
@@ -54290,7 +54304,6 @@ var ts;
}
}
var result = -1;
- var saveErrorInfo = captureErrorCalculationState();
var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
var sourceObjectFlags = ts.getObjectFlags(source);
var targetObjectFlags = ts.getObjectFlags(target);
@@ -54322,6 +54335,7 @@ var ts;
else {
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
var t = targetSignatures_1[_i];
+ var saveErrorInfo = captureErrorCalculationState();
var shouldElaborateErrors = reportErrors;
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
var s = sourceSignatures_1[_c];
@@ -54658,7 +54672,7 @@ var ts;
var constraintMarker = "";
var sourceId = getTypeReferenceId(source, 0);
var targetId = getTypeReferenceId(target, 0);
- return "" + constraintMarker + sourceId + "," + targetId + postFix;
+ return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
function getTypeReferenceId(type, depth) {
if (depth === void 0) { depth = 0; }
var result = "" + type.target.id;
@@ -54694,7 +54708,7 @@ var ts;
var postFix = intersectionState ? ":" + intersectionState : "";
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
- source.id + "," + target.id + postFix;
+ "".concat(source.id, ",").concat(target.id).concat(postFix);
}
function forEachProperty(prop, callback) {
if (ts.getCheckFlags(prop) & 6) {
@@ -56517,10 +56531,10 @@ var ts;
case 79:
if (!ts.isThisInTypeQuery(node)) {
var symbol = getResolvedSymbol(node);
- return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
+ return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
}
case 108:
- return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
+ return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
case 229:
case 211:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
@@ -57110,9 +57124,6 @@ var ts;
getUnionType(ts.map(type.types, mapper), 1, aliasSymbol, aliasTypeArguments) :
mapType(type, mapper);
}
- function getConstituentCount(type) {
- return type.flags & 1048576 ? type.types.length : 1;
- }
function extractTypesOfKind(type, kind) {
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
}
@@ -58457,7 +58468,7 @@ var ts;
var substituteConstraints = !(checkMode && checkMode & 2) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
+ return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 ? getBaseConstraintOrType(t) : t; }) : type;
}
function isExportOrExportExpression(location) {
return !!ts.findAncestor(location, function (n) {
@@ -59837,7 +59848,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 | (isOptional && !isRestParam ? 16777216 : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 | (isOptional && !isRestParam ? 16777216 : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -63621,19 +63632,20 @@ var ts;
if (links.type === unknownType) {
links.type = getTypeFromBindingPattern(declaration.name);
}
- assignBindingElementTypes(declaration.name);
+ assignBindingElementTypes(declaration.name, links.type);
}
}
}
- function assignBindingElementTypes(pattern) {
+ function assignBindingElementTypes(pattern, parentType) {
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
+ var type = getBindingElementTypeFromParentType(element, parentType);
if (element.name.kind === 79) {
- getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
+ getSymbolLinks(getSymbolOfNode(element)).type = type;
}
else {
- assignBindingElementTypes(element.name);
+ assignBindingElementTypes(element.name, type);
}
}
}
@@ -66828,26 +66840,24 @@ var ts;
if (returnType.flags & 1) {
return;
}
+ var headMessage;
var expectedReturnType;
- var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
- var errorInfo;
switch (node.parent.kind) {
case 256:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 163:
- expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
- break;
case 166:
+ case 163:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
case 168:
case 171:
case 172:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -66855,7 +66865,7 @@ var ts;
default:
return ts.Debug.fail();
}
- checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; });
+ checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
}
function markTypeNodeAsReferenced(node) {
markEntityNameOrEntityExpressionAsReference(node && ts.getEntityNameFromTypeNode(node));
@@ -68256,7 +68266,7 @@ var ts;
function getPropertyNameForKnownSymbolName(symbolName) {
var ctorType = getGlobalESSymbolConstructorSymbol(false);
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
- return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
+ return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
}
function getIterationTypesOfIterableSlow(type, resolver, errorNode) {
var _a;
@@ -68716,9 +68726,9 @@ var ts;
var containsArguments = containsArgumentsReference(node);
if (containsArguments) {
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
- if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
+ if (isJs && lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
- errorOrSuggestion(isJs, lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
+ error(lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
}
}
else {
@@ -68728,7 +68738,9 @@ var ts;
return;
}
if (ts.isQualifiedName(name)) {
- errorOrSuggestion(isJs, name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ if (isJs) {
+ error(name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ }
}
else {
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
@@ -73424,25 +73436,24 @@ var ts;
}
function findMostOverlappyType(source, unionTarget) {
var bestMatch;
- var matchingCount = 0;
- for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
- var target = _a[_i];
- var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
- if (overlap.flags & 4194304) {
- bestMatch = target;
- matchingCount = Infinity;
- }
- else if (overlap.flags & 1048576) {
- var len = ts.length(ts.filter(overlap.types, isUnitType));
- if (len >= matchingCount) {
- bestMatch = target;
- matchingCount = len;
+ if (!(source.flags & (131068 | 406847488))) {
+ var matchingCount = 0;
+ for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
+ var target = _a[_i];
+ if (!(target.flags & (131068 | 406847488))) {
+ var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
+ if (overlap.flags & 4194304) {
+ return target;
+ }
+ else if (isUnitType(overlap) || overlap.flags & 1048576) {
+ var len = overlap.flags & 1048576 ? ts.countWhere(overlap.types, isUnitType) : 1;
+ if (len >= matchingCount) {
+ bestMatch = target;
+ matchingCount = len;
+ }
+ }
}
}
- else if (isUnitType(overlap) && 1 >= matchingCount) {
- bestMatch = target;
- matchingCount = 1;
- }
}
return bestMatch;
}
@@ -74582,7 +74593,7 @@ var ts;
value >= 52 && value < 62 ? 48 + value - 52 :
value === 62 ? 43 :
value === 63 ? 47 :
- ts.Debug.fail(value + ": not a base64 value");
+ ts.Debug.fail("".concat(value, ": not a base64 value"));
}
function base64FormatDecode(ch) {
return ch >= 65 && ch <= 90 ? ch - 65 :
@@ -74655,7 +74666,7 @@ var ts;
var mappings = ts.arrayFrom(decoder, processMapping);
if (decoder.error !== undefined) {
if (host.log) {
- host.log("Encountered error while decoding sourcemap: " + decoder.error);
+ host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
}
decodedMappings = ts.emptyArray;
}
@@ -77098,7 +77109,7 @@ var ts;
var propertyName = ts.isPropertyAccessExpression(originalNode)
? ts.declarationNameToString(originalNode.name)
: ts.getTextOfNode(originalNode.argumentExpression);
- ts.addSyntheticTrailingComment(substitute, 3, " " + propertyName + " ");
+ ts.addSyntheticTrailingComment(substitute, 3, " ".concat(propertyName, " "));
}
return substitute;
}
@@ -78348,8 +78359,8 @@ var ts;
}
function createHoistedVariableForClass(name, node) {
var className = getPrivateIdentifierEnvironment().className;
- var prefix = className ? "_" + className : "";
- var identifier = factory.createUniqueName(prefix + "_" + name, 16);
+ var prefix = className ? "_".concat(className) : "";
+ var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16);
if (resolver.getNodeCheckFlags(node) & 524288) {
addBlockScopedVariable(identifier);
}
@@ -80007,7 +80018,7 @@ var ts;
specifierSourceImports = new ts.Map();
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
}
- var generatedName = factory.createUniqueName("_" + name, 16 | 32 | 64);
+ var generatedName = factory.createUniqueName("_".concat(name), 16 | 32 | 64);
var specifier = factory.createImportSpecifier(false, factory.createIdentifier(name), generatedName);
generatedName.generatedImportReference = specifier;
specifierSourceImports.set(name, specifier);
@@ -80948,11 +80959,11 @@ var ts;
}
else {
if (node.kind === 245) {
- labelMarker = "break-" + label.escapedText;
+ labelMarker = "break-".concat(label.escapedText);
setLabeledJump(convertedLoopState, true, ts.idText(label), labelMarker);
}
else {
- labelMarker = "continue-" + label.escapedText;
+ labelMarker = "continue-".concat(label.escapedText);
setLabeledJump(convertedLoopState, false, ts.idText(label), labelMarker);
}
}
@@ -86607,7 +86618,7 @@ var ts;
return getTypeAliasDeclarationVisibilityError;
}
else {
- return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
+ return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (node.kind === 253 || node.kind === 202) {
@@ -86804,7 +86815,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
- return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
+ return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
}
}
function getTypeParameterConstraintVisibilityError() {
@@ -87491,7 +87502,7 @@ var ts;
while (ts.length(lateMarkedStatements)) {
var i = lateMarkedStatements.shift();
if (!ts.isLateVisibilityPaintedStatement(i)) {
- return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
+ 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));
}
var priorNeedsDeclare = needsDeclare;
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
@@ -87656,7 +87667,7 @@ var ts;
return cleanup(input);
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));
}
- default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
+ default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
}
}
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
@@ -87900,7 +87911,7 @@ var ts;
var extendsClause_1 = ts.getEffectiveBaseTypeNode(input);
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104) {
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
- var newId_1 = factory.createUniqueName(oldId + "_base", 16);
+ var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16);
getSymbolAccessibilityDiagnostic = function () { return ({
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
errorNode: extendsClause_1,
@@ -87937,7 +87948,7 @@ var ts;
}))));
}
}
- return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
+ return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
function cleanup(node) {
if (isEnclosingDeclaration(input)) {
enclosingDeclaration = previousEnclosingDeclaration;
@@ -88706,13 +88717,13 @@ var ts;
if (ts.fileExtensionIs(inputFileName, ".json"))
return;
if (js && configFile.options.sourceMap) {
- addOutput(js + ".map");
+ addOutput("".concat(js, ".map"));
}
if (ts.getEmitDeclarations(configFile.options)) {
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
addOutput(dts);
if (configFile.options.declarationMap) {
- addOutput(dts + ".map");
+ addOutput("".concat(dts, ".map"));
}
}
}
@@ -88772,7 +88783,7 @@ var ts;
function getFirstProjectOutput(configFile, ignoreCase) {
if (ts.outFile(configFile.options)) {
var jsFilePath = getOutputPathsForBundle(configFile.options, false).jsFilePath;
- return ts.Debug.checkDefined(jsFilePath, "project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
@@ -88791,7 +88802,7 @@ var ts;
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
if (buildInfoPath)
return buildInfoPath;
- return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
ts.getFirstProjectOutput = getFirstProjectOutput;
function emitFiles(resolver, host, targetSourceFile, _a, emitOnlyDtsFiles, onlyBuildInfo, forceDtsEmit) {
@@ -89001,7 +89012,7 @@ var ts;
if (sourceMappingURL) {
if (!writer.isAtStartOfLine())
writer.rawWrite(newLine);
- writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL);
+ writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL));
}
if (sourceMapFilePath) {
var sourceMap = sourceMapGenerator.toString();
@@ -89041,7 +89052,7 @@ var ts;
if (mapOptions.inlineSourceMap) {
var sourceMapText = sourceMapGenerator.toString();
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
- return "data:application/json;base64," + base64SourceMapText;
+ return "data:application/json;base64,".concat(base64SourceMapText);
}
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
if (mapOptions.mapRoot) {
@@ -89205,7 +89216,7 @@ var ts;
return;
break;
default:
- ts.Debug.fail("Unexpected path: " + name);
+ ts.Debug.fail("Unexpected path: ".concat(name));
}
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
},
@@ -90013,7 +90024,7 @@ var ts;
return writeTokenNode(node, writeKeyword);
if (ts.isTokenKind(node.kind))
return writeTokenNode(node, writePunctuation);
- ts.Debug.fail("Unhandled SyntaxKind: " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
}
function emitMappedTypeParameter(node) {
emit(node.name);
@@ -90153,14 +90164,14 @@ var ts;
}
}
function emitPlaceholder(hint, node, snippet) {
- nonEscapingWrite("${" + snippet.order + ":");
+ nonEscapingWrite("${".concat(snippet.order, ":"));
pipelineEmitWithHintWorker(hint, node, false);
nonEscapingWrite("}");
}
function emitTabStop(hint, node, snippet) {
- ts.Debug.assert(node.kind === 235, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.assert(node.kind === 235, "A tab stop cannot be attached to a node of kind ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
ts.Debug.assert(hint !== 5, "A tab stop cannot be attached to an embedded statement.");
- nonEscapingWrite("$" + snippet.order);
+ nonEscapingWrite("$".concat(snippet.order));
}
function emitIdentifier(node) {
var writeText = node.symbol ? writeSymbol : write;
@@ -91823,17 +91834,17 @@ var ts;
writeLine();
}
if (currentSourceFile && currentSourceFile.moduleName) {
- writeComment("/// ");
+ writeComment("/// "));
writeLine();
}
if (currentSourceFile && currentSourceFile.amdDependencies) {
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
var dep = _b[_a];
if (dep.name) {
- writeComment("/// ");
+ writeComment("/// "));
}
else {
- writeComment("/// ");
+ writeComment("/// "));
}
writeLine();
}
@@ -91841,7 +91852,7 @@ var ts;
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
var directive = files_2[_c];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference", data: directive.fileName });
writeLine();
@@ -91849,7 +91860,7 @@ var ts;
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
var directive = types_24[_d];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type", data: directive.fileName });
writeLine();
@@ -91857,7 +91868,7 @@ var ts;
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
var directive = libs_1[_e];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib", data: directive.fileName });
writeLine();
@@ -92556,9 +92567,9 @@ var ts;
var textSourceNode = node.textSourceNode;
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
- return jsxAttributeEscape ? "\"" + ts.escapeJsxAttributeString(text) + "\"" :
- neverAsciiEscape || (ts.getEmitFlags(node) & 16777216) ? "\"" + ts.escapeString(text) + "\"" :
- "\"" + ts.escapeNonAsciiString(text) + "\"";
+ return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
+ neverAsciiEscape || (ts.getEmitFlags(node) & 16777216) ? "\"".concat(ts.escapeString(text), "\"") :
+ "\"".concat(ts.escapeNonAsciiString(text), "\"");
}
else {
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
@@ -92957,8 +92968,8 @@ var ts;
}
function formatSynthesizedComment(comment) {
return comment.kind === 3
- ? "/*" + comment.text + "*/"
- : "//" + comment.text;
+ ? "/*".concat(comment.text, "*/")
+ : "//".concat(comment.text);
}
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
enterComment();
@@ -93572,18 +93583,18 @@ var ts;
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;
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
if (!newPath) {
- writeLog("Project: " + configFileName + " Detected ignored path: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
return true;
}
fileOrDirectoryPath = newPath;
if (fileOrDirectoryPath === watchedDirPath)
return false;
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
- writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
return true;
}
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
- writeLog("Project: " + configFileName + " Detected excluded file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
return true;
}
if (!program)
@@ -93602,7 +93613,7 @@ var ts;
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
if (hasSourceFile((filePathWithoutExtension + ".ts")) ||
hasSourceFile((filePathWithoutExtension + ".tsx"))) {
- writeLog("Project: " + configFileName + " Detected output file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
return true;
}
return false;
@@ -93670,36 +93681,36 @@ var ts;
host.useCaseSensitiveFileNames();
}
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
- log("ExcludeWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
return {
- close: function () { return log("ExcludeWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }
+ close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
};
}
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- log("FileWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
return {
close: function () {
- log("FileWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
watcher.close();
}
};
}
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- var watchInfo = "DirectoryWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
return {
close: function () {
- var watchInfo = "DirectoryWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
watcher.close();
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
}
};
}
@@ -93709,16 +93720,16 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
- var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher") + ":: Triggered with " + args[0] + " " + (args[1] !== undefined ? args[1] : "") + ":: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ 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));
log(triggerredInfo);
var start = ts.timestamp();
cb.call.apply(cb, __spreadArray([undefined], args, false));
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + triggerredInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
}, flags, options, detailInfo1, detailInfo2); };
}
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
- return "WatchInfo: " + file + " " + flags + " " + JSON.stringify(options) + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2);
+ return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
}
}
ts.getWatchFactory = getWatchFactory;
@@ -94008,12 +94019,12 @@ var ts;
}
ts.formatDiagnostics = formatDiagnostics;
function formatDiagnostic(diagnostic, host) {
- var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();
+ var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
if (diagnostic.file) {
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character;
var fileName = diagnostic.file.fileName;
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
- return relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): " + errorMessage;
+ return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
}
return errorMessage;
}
@@ -94091,9 +94102,9 @@ var ts;
var output = "";
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
output += ":";
- output += color("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
output += ":";
- output += color("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
return output;
}
ts.formatLocation = formatLocation;
@@ -94107,7 +94118,7 @@ var ts;
output += " - ";
}
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
- output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
+ output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
if (diagnostic.file) {
output += host.getNewLine();
@@ -94207,7 +94218,7 @@ var ts;
var result = void 0;
var mode = getModeForResolutionAtIndex(containingFile, i);
i++;
- var cacheKey = mode !== undefined ? mode + "|" + name : name;
+ var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
if (cache.has(cacheKey)) {
result = cache.get(cacheKey);
}
@@ -96078,7 +96089,7 @@ var ts;
path += (i === 2 ? "/" : "-") + components[i];
i++;
}
- var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
+ var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
return localOverrideModuleResult.resolvedModule.resolvedFileName;
@@ -96847,10 +96858,10 @@ var ts;
}
function directoryExistsIfProjectReferenceDeclDir(dir) {
var dirPath = host.toPath(dir);
- var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
+ var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
- ts.startsWith(dirPath, declDirPath + "/"); });
+ ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
}
function handleDirectoryCouldBeSymlink(directory) {
var _a;
@@ -96898,7 +96909,7 @@ var ts;
var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath));
if (isFile && result) {
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
- symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), ""));
+ symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
}
return result;
}) || false;
@@ -97282,7 +97293,7 @@ var ts;
var emitOutput_1 = getFileEmitOutput(programOfThisState, sourceFile, true, cancellationToken, undefined, true);
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
if (firstDts_1) {
- ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts", ".d.mts", ".d.cts"]), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
+ ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts", ".d.mts", ".d.cts"]), "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; }))); });
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
if (exportedModulesMapCache && latestSignature !== prevSignature) {
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
@@ -97678,7 +97689,7 @@ var ts;
return;
}
else {
- 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: " + affectedFile.fileName);
+ 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));
}
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
@@ -98650,7 +98661,7 @@ var ts;
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
- ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: " + failedLookupLocation + " failedLookupLocationPath: " + failedLookupLocationPath);
+ ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
if (failedLookupPathSplit.length > rootSplitLength + 1) {
return {
dir: failedLookupSplit.slice(0, rootSplitLength + 1).join(ts.directorySeparator),
@@ -99572,7 +99583,7 @@ var ts;
}
function getJSExtensionForFile(fileName, options) {
var _a;
- return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension " + ts.extensionFromPath(fileName) + " is unsupported:: FileName:: " + fileName);
+ return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
}
function tryGetJSExtensionForFile(fileName, options) {
var ext = ts.tryGetExtensionFromPath(fileName);
@@ -99662,8 +99673,8 @@ var ts;
return pretty ?
function (diagnostic, newLine, options) {
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
- var output = "[" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);
+ var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
system.write(output);
} :
function (diagnostic, newLine, options) {
@@ -99671,8 +99682,8 @@ var ts;
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
output += newLine;
}
- output += getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);
+ output += "".concat(getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
system.write(output);
};
}
@@ -99694,7 +99705,7 @@ var ts;
.map(function (errorDiagnostic) {
if (errorDiagnostic.file === undefined)
return;
- return "" + errorDiagnostic.file.fileName;
+ return "".concat(errorDiagnostic.file.fileName);
});
return filesInError.map(function (fileName) {
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
@@ -99727,7 +99738,7 @@ var ts;
if (errorCount === 0)
return "";
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
- var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return "".concat(fileInError.fileName, ":").concat(fileInError.line); })
.filter(function (value, index, self) { return self.indexOf(value) === index; });
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
var d = errorCount === 1 ?
@@ -99740,7 +99751,7 @@ var ts;
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
+ return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix);
}
ts.getErrorSummaryText = getErrorSummaryText;
function createTabularErrorsDisplay(filesInError, host) {
@@ -99763,7 +99774,7 @@ var ts;
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
: "";
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
- tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
+ tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n");
});
return tabularData;
}
@@ -99790,9 +99801,9 @@ var ts;
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
var file = _c[_i];
- write("" + toFileName(file, relativeFileName));
- (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" " + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });
- (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" " + d.messageText); });
+ write("".concat(toFileName(file, relativeFileName)));
+ (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
+ (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
}
}
ts.explainFiles = explainFiles;
@@ -99830,7 +99841,7 @@ var ts;
if (isJsonFile && !ts.endsWith(includeSpec, ".json"))
return false;
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
- return !!pattern && ts.getRegexFromPattern("(" + pattern + ")$", useCaseSensitiveFileNames).test(fileName);
+ return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
});
}
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
@@ -99839,7 +99850,7 @@ var ts;
var options = program.getCompilerOptions();
if (ts.isReferencedFile(reason)) {
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
- var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"" + referenceLocation.text + "\"";
+ var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
var message = void 0;
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
switch (reason.kind) {
@@ -99950,7 +99961,7 @@ var ts;
var currentDir_1 = program.getCurrentDirectory();
ts.forEach(emittedFiles, function (file) {
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
- write("TSFILE: " + filepath);
+ write("TSFILE: ".concat(filepath));
});
listFiles(program, write);
}
@@ -100257,7 +100268,7 @@ var ts;
}
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
- writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames);
+ writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
var configFileWatcher;
if (configFileName) {
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
@@ -100404,10 +100415,10 @@ var ts;
}
function createNewProgram(hasInvalidatedResolution) {
writeLog("CreatingProgramWith::");
- writeLog(" roots: " + JSON.stringify(rootFileNames));
- writeLog(" options: " + JSON.stringify(compilerOptions));
+ writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
+ writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
if (projectReferences)
- writeLog(" projectReferences: " + JSON.stringify(projectReferences));
+ writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
hasChangedCompilerOptions = false;
hasChangedConfigFileParsingErrors = false;
@@ -100549,7 +100560,7 @@ var ts;
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
}
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
- writeLog("Scheduling invalidateFailedLookup" + (pending ? ", Cancelled earlier one" : ""));
+ writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
}
function invalidateResolutionsOfFailedLookup() {
@@ -100605,7 +100616,7 @@ var ts;
synchronizeProgram();
}
function reloadConfigFile() {
- writeLog("Reloading config file: " + configFileName);
+ writeLog("Reloading config file: ".concat(configFileName));
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
if (cachedDirectoryStructureHost) {
cachedDirectoryStructureHost.clearCache();
@@ -100643,7 +100654,7 @@ var ts;
return config.parsedCommandLine;
}
}
- writeLog("Loading config file: " + configFileName);
+ writeLog("Loading config file: ".concat(configFileName));
var parsedCommandLine = host.getParsedCommandLine ?
host.getParsedCommandLine(configFileName) :
getParsedCommandLineFromConfigFileHost(configFileName);
@@ -100896,8 +100907,8 @@ var ts;
ts.getBuildOrderFromAnyBuildOrder = getBuildOrderFromAnyBuildOrder;
function createBuilderStatusReporter(system, pretty) {
return function (diagnostic) {
- var output = pretty ? "[" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] " : ts.getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);
+ var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
system.write(output);
};
}
@@ -101640,7 +101651,7 @@ var ts;
function listEmittedFile(_a, proj, file) {
var write = _a.write;
if (write && proj.options.listEmittedFiles) {
- write("TSFILE: " + file);
+ write("TSFILE: ".concat(file));
}
}
function getOldProgram(_a, proj, parsed) {
@@ -101669,7 +101680,7 @@ var ts;
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
reportAndStoreErrors(state, resolvedPath, diagnostics);
- state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
+ state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
if (canEmitBuildInfo)
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
afterProgramDone(state, program, config);
@@ -101695,7 +101706,7 @@ var ts;
if (!host.fileExists(inputFile)) {
return {
type: ts.UpToDateStatusType.Unbuildable,
- reason: inputFile + " does not exist"
+ reason: "".concat(inputFile, " does not exist")
};
}
if (!force) {
@@ -102020,7 +102031,7 @@ var ts;
}
}
if (filesToDelete) {
- reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ 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(""));
}
return ts.ExitStatus.Success;
}
@@ -102370,7 +102381,7 @@ var ts;
};
}
function bold(str) {
- return "\u001B[1m" + str + "\u001B[22m";
+ return "\u001B[1m".concat(str, "\u001B[22m");
}
var isWindows = sys.getEnvironmentVariable("OS") && ts.stringContains(sys.getEnvironmentVariable("OS").toLowerCase(), "windows");
var isWindowsTerminal = sys.getEnvironmentVariable("WT_SESSION");
@@ -102379,19 +102390,19 @@ var ts;
if (isWindows && !isWindowsTerminal && !isVSCode) {
return brightWhite(str);
}
- return "\u001B[94m" + str + "\u001B[39m";
+ return "\u001B[94m".concat(str, "\u001B[39m");
}
var supportsRicherColors = sys.getEnvironmentVariable("COLORTERM") === "truecolor" || sys.getEnvironmentVariable("TERM") === "xterm-256color";
function blueBackground(str) {
if (supportsRicherColors) {
- return "\u001B[48;5;68m" + str + "\u001B[39;49m";
+ return "\u001B[48;5;68m".concat(str, "\u001B[39;49m");
}
else {
- return "\u001B[44m" + str + "\u001B[39;49m";
+ return "\u001B[44m".concat(str, "\u001B[39;49m");
}
}
function brightWhite(str) {
- return "\u001B[97m" + str + "\u001B[39m";
+ return "\u001B[97m".concat(str, "\u001B[39m");
}
return {
bold: bold,
@@ -102401,7 +102412,7 @@ var ts;
};
}
function getDisplayNameTextOfOption(option) {
- return "--" + option.name + (option.shortName ? ", -" + option.shortName : "");
+ return "--".concat(option.name).concat(option.shortName ? ", -".concat(option.shortName) : "");
}
function generateOptionOutput(sys, option, rightAlignOfLeft, leftAlignOfRight) {
var _a, _b;
@@ -102438,13 +102449,13 @@ var ts;
text.push(sys.newLine);
if (showAdditionalInfoOutput(valueCandidates, option)) {
if (valueCandidates) {
- text.push(valueCandidates.valueType + " " + valueCandidates.possibleValues);
+ text.push("".concat(valueCandidates.valueType, " ").concat(valueCandidates.possibleValues));
}
if (defaultValueDescription) {
if (valueCandidates)
text.push(sys.newLine);
var diagType = ts.getDiagnosticText(ts.Diagnostics.default_Colon);
- text.push(diagType + " " + defaultValueDescription);
+ text.push("".concat(diagType, " ").concat(defaultValueDescription));
}
text.push(sys.newLine);
}
@@ -102493,7 +102504,7 @@ var ts;
}
var curRight = remainRight.substr(0, rightCharacterNumber);
remainRight = remainRight.slice(rightCharacterNumber);
- res.push("" + curLeft + curRight);
+ res.push("".concat(curLeft).concat(curRight));
isFirstLine = false;
}
return res;
@@ -102594,7 +102605,7 @@ var ts;
categoryMap.set(curCategory, optionsOfCurCategory);
}
categoryMap.forEach(function (value, key) {
- res.push("### " + key + sys.newLine + sys.newLine);
+ res.push("### ".concat(key).concat(sys.newLine).concat(sys.newLine));
res = __spreadArray(__spreadArray([], res, true), generateGroupOptionOutput(sys, value), true);
});
if (afterOptionsDescription) {
@@ -102604,7 +102615,7 @@ var ts;
}
function printEasyHelp(sys, simpleOptions) {
var colors = createColors(sys);
- var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
+ var output = __spreadArray([], getHeader(sys, "".concat(ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler), " - ").concat(ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version))), true);
output.push(colors.bold(ts.getDiagnosticText(ts.Diagnostics.COMMON_COMMANDS)) + sys.newLine + sys.newLine);
example("tsc", ts.Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
example("tsc app.ts util.ts", ts.Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
@@ -102630,7 +102641,7 @@ var ts;
}
}
function printAllHelp(sys, compilerOptions, buildOptions, watchOptions) {
- var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
+ var output = __spreadArray([], getHeader(sys, "".concat(ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler), " - ").concat(ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version))), true);
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, true, undefined, ts.formatMessage(undefined, ts.Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference")), true);
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.WATCH_OPTIONS), watchOptions, false, ts.getDiagnosticText(ts.Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon)), true);
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.BUILD_OPTIONS), buildOptions, false, ts.formatMessage(undefined, ts.Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")), true);
@@ -102640,7 +102651,7 @@ var ts;
}
}
function printBuildHelp(sys, buildOptions) {
- var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
+ var output = __spreadArray([], getHeader(sys, "".concat(ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler), " - ").concat(ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version))), true);
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.BUILD_OPTIONS), buildOptions, false, ts.formatMessage(undefined, ts.Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")), true);
for (var _i = 0, output_3 = output; _i < output_3.length; _i++) {
var line = output_3[_i];
@@ -103021,7 +103032,7 @@ var ts;
reportCountStatistic("Subtype cache size", caches.subtype);
reportCountStatistic("Strict subtype cache size", caches.strictSubtype);
if (isPerformanceEnabled) {
- ts.performance.forEachMeasure(function (name, duration) { return reportTimeStatistic(name + " time", duration); });
+ ts.performance.forEachMeasure(function (name, duration) { return reportTimeStatistic("".concat(name, " time"), duration); });
}
}
else if (isPerformanceEnabled) {
@@ -103092,7 +103103,7 @@ var ts;
// This file actually uses arguments passed on commandline and executes it
ts.Debug.loggingHost = {
log: function (_level, s) {
- ts.sys.write("" + (s || "") + ts.sys.newLine);
+ ts.sys.write("".concat(s || "").concat(ts.sys.newLine));
}
};
if (ts.Debug.isDebugging) {
diff --git a/lib/tsserver.js b/lib/tsserver.js
index 768189be52d..026f89d462f 100644
--- a/lib/tsserver.js
+++ b/lib/tsserver.js
@@ -22,7 +22,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
ar[i] = from[i];
}
}
- return to.concat(ar || from);
+ return to.concat(ar || Array.prototype.slice.call(from));
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
@@ -100,7 +100,7 @@ var ts;
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
- ts.version = ts.versionMajorMinor + ".1-rc";
+ ts.version = "4.6.2";
/* @internal */
var Comparison;
(function (Comparison) {
@@ -147,7 +147,7 @@ var ts;
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
if (constructor)
return constructor;
- throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
+ throw new Error("TypeScript requires an environment that provides a compatible native ".concat(name, " implementation."));
}
})(ts || (ts = {}));
/* @internal */
@@ -1497,7 +1497,7 @@ var ts;
function cast(value, test) {
if (value !== undefined && test(value))
return value;
- return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'.");
+ return ts.Debug.fail("Invalid cast. The supplied value ".concat(value, " did not pass the test '").concat(ts.Debug.getFunctionName(test), "'."));
}
ts.cast = cast;
/** Does nothing. */
@@ -1588,7 +1588,7 @@ var ts;
function memoizeOne(callback) {
var map = new ts.Map();
return function (arg) {
- var key = typeof arg + ":" + arg;
+ var key = "".concat(typeof arg, ":").concat(arg);
var value = map.get(key);
if (value === undefined && !map.has(key)) {
value = callback(arg);
@@ -2038,7 +2038,7 @@ var ts;
ts.createGetCanonicalFileName = createGetCanonicalFileName;
function patternText(_a) {
var prefix = _a.prefix, suffix = _a.suffix;
- return prefix + "*" + suffix;
+ return "".concat(prefix, "*").concat(suffix);
}
ts.patternText = patternText;
/**
@@ -2351,7 +2351,7 @@ var ts;
}
function fail(message, stackCrawlMark) {
debugger;
- var e = new Error(message ? "Debug Failure. " + message : "Debug Failure.");
+ var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");
if (Error.captureStackTrace) {
Error.captureStackTrace(e, stackCrawlMark || fail);
}
@@ -2359,12 +2359,12 @@ var ts;
}
Debug.fail = fail;
function failBadSyntaxKind(node, message, stackCrawlMark) {
- return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", stackCrawlMark || failBadSyntaxKind);
+ return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind);
}
Debug.failBadSyntaxKind = failBadSyntaxKind;
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
if (!expression) {
- message = message ? "False expression: " + message : "False expression.";
+ message = message ? "False expression: ".concat(message) : "False expression.";
if (verboseDebugInfo) {
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
}
@@ -2374,26 +2374,26 @@ var ts;
Debug.assert = assert;
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
if (a !== b) {
- var message = msg ? msg2 ? msg + " " + msg2 : msg : "";
- fail("Expected " + a + " === " + b + ". " + message, stackCrawlMark || assertEqual);
+ var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
+ fail("Expected ".concat(a, " === ").concat(b, ". ").concat(message), stackCrawlMark || assertEqual);
}
}
Debug.assertEqual = assertEqual;
function assertLessThan(a, b, msg, stackCrawlMark) {
if (a >= b) {
- fail("Expected " + a + " < " + b + ". " + (msg || ""), stackCrawlMark || assertLessThan);
+ fail("Expected ".concat(a, " < ").concat(b, ". ").concat(msg || ""), stackCrawlMark || assertLessThan);
}
}
Debug.assertLessThan = assertLessThan;
function assertLessThanOrEqual(a, b, stackCrawlMark) {
if (a > b) {
- fail("Expected " + a + " <= " + b, stackCrawlMark || assertLessThanOrEqual);
+ fail("Expected ".concat(a, " <= ").concat(b), stackCrawlMark || assertLessThanOrEqual);
}
}
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
if (a < b) {
- fail("Expected " + a + " >= " + b, stackCrawlMark || assertGreaterThanOrEqual);
+ fail("Expected ".concat(a, " >= ").concat(b), stackCrawlMark || assertGreaterThanOrEqual);
}
}
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
@@ -2424,42 +2424,42 @@ var ts;
function assertNever(member, message, stackCrawlMark) {
if (message === void 0) { message = "Illegal value:"; }
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
- return fail(message + " " + detail, stackCrawlMark || assertNever);
+ return fail("".concat(message, " ").concat(detail), stackCrawlMark || assertNever);
}
Debug.assertNever = assertNever;
function assertEachNode(nodes, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) {
- assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertEachNode);
+ assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '".concat(getFunctionName(test), "'."); }, stackCrawlMark || assertEachNode);
}
}
Debug.assertEachNode = assertEachNode;
function assertNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNode")) {
- assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNode);
+ 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);
}
}
Debug.assertNode = assertNode;
function assertNotNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) {
- assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " should not have passed test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNotNode);
+ 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);
}
}
Debug.assertNotNode = assertNotNode;
function assertOptionalNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) {
- assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertOptionalNode);
+ 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);
}
}
Debug.assertOptionalNode = assertOptionalNode;
function assertOptionalToken(node, kind, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) {
- assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, stackCrawlMark || assertOptionalToken);
+ 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);
}
}
Debug.assertOptionalToken = assertOptionalToken;
function assertMissingNode(node, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) {
- assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, stackCrawlMark || assertMissingNode);
+ assert(node === undefined, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); }, stackCrawlMark || assertMissingNode);
}
}
Debug.assertMissingNode = assertMissingNode;
@@ -2480,7 +2480,7 @@ var ts;
}
Debug.getFunctionName = getFunctionName;
function formatSymbol(symbol) {
- return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }";
+ return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");
}
Debug.formatSymbol = formatSymbol;
/**
@@ -2501,7 +2501,7 @@ var ts;
break;
}
if (enumValue !== 0 && enumValue & value) {
- result = "" + result + (result ? "|" : "") + enumName;
+ result = "".concat(result).concat(result ? "|" : "").concat(enumName);
remainingFlags &= ~enumValue;
}
}
@@ -2611,7 +2611,7 @@ var ts;
this.flags & 1 /* Unreachable */ ? "FlowUnreachable" :
"UnknownFlow";
var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);
- return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : "");
+ return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : "");
}
},
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },
@@ -2650,7 +2650,7 @@ var ts;
// We don't care, this is debug code that's only enabled with a debugger attached -
// we're just taking note of it for anyone checking regex performance in the future.
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
- return "NodeArray " + defaultValue;
+ return "NodeArray ".concat(defaultValue);
}
}
});
@@ -2705,7 +2705,7 @@ var ts;
var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" :
"Symbol";
var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;
- return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : "");
+ return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
@@ -2715,11 +2715,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" :
- this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) :
- this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" :
+ this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType ".concat(JSON.stringify(this.value)) :
+ this.flags & 2048 /* BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") :
this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" :
this.flags & 32 /* Enum */ ? "EnumType" :
- this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName :
+ this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType ".concat(this.intrinsicName) :
this.flags & 1048576 /* Union */ ? "UnionType" :
this.flags & 2097152 /* Intersection */ ? "IntersectionType" :
this.flags & 4194304 /* Index */ ? "IndexType" :
@@ -2738,7 +2738,7 @@ var ts;
"ObjectType" :
"Type";
var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
- return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : "");
+ return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
@@ -2774,11 +2774,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
- ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" :
- ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" :
- ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") :
- ts.isNumericLiteral(this) ? "NumericLiteral " + this.text :
- ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" :
+ ts.isIdentifier(this) ? "Identifier '".concat(ts.idText(this), "'") :
+ ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
+ ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
+ ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
+ ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") :
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
ts.isParameter(this) ? "ParameterDeclaration" :
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
@@ -2810,7 +2810,7 @@ var ts;
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
ts.isImportTypeNode(this) ? "ImportTypeNode" :
formatSyntaxKind(this.kind);
- return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : "");
+ return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : "");
}
},
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
@@ -2857,10 +2857,10 @@ var ts;
Debug.enableDebugInfo = enableDebugInfo;
function formatDeprecationMessage(name, error, errorAfter, since, message) {
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
- deprecationMessage += "'" + name + "' ";
- deprecationMessage += since ? "has been deprecated since v" + since : "is deprecated";
- deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v" + errorAfter + "." : ".";
- deprecationMessage += message ? " " + ts.formatStringFromArgs(message, [name], 0) : "";
+ deprecationMessage += "'".concat(name, "' ");
+ deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
+ deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
+ deprecationMessage += message ? " ".concat(ts.formatStringFromArgs(message, [name], 0)) : "";
return deprecationMessage;
}
function createErrorDeprecation(name, errorAfter, since, message) {
@@ -2991,11 +2991,11 @@ var ts;
}
};
Version.prototype.toString = function () {
- var result = this.major + "." + this.minor + "." + this.patch;
+ var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
if (ts.some(this.prerelease))
- result += "-" + this.prerelease.join(".");
+ result += "-".concat(this.prerelease.join("."));
if (ts.some(this.build))
- result += "+" + this.build.join(".");
+ result += "+".concat(this.build.join("."));
return result;
};
Version.zero = new Version(0, 0, 0);
@@ -3262,7 +3262,7 @@ var ts;
return ts.map(comparators, formatComparator).join(" ");
}
function formatComparator(comparator) {
- return "" + comparator.operator + comparator.operand;
+ return "".concat(comparator.operator).concat(comparator.operand);
}
})(ts || (ts = {}));
/*@internal*/
@@ -3560,7 +3560,7 @@ var ts;
fs = require("fs");
}
catch (e) {
- throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
+ throw new Error("tracing requires having fs\n(original error: ".concat(e.message || e, ")"));
}
}
mode = tracingMode;
@@ -3572,11 +3572,11 @@ var ts;
if (!fs.existsSync(traceDir)) {
fs.mkdirSync(traceDir, { recursive: true });
}
- var countPart = mode === "build" ? "." + process.pid + "-" + ++traceCount
- : mode === "server" ? "." + process.pid
+ var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount)
+ : mode === "server" ? ".".concat(process.pid)
: "";
- var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
- var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
+ var tracePath = ts.combinePaths(traceDir, "trace".concat(countPart, ".json"));
+ var typesPath = ts.combinePaths(traceDir, "types".concat(countPart, ".json"));
legend.push({
configFilePath: configFilePath,
tracePath: tracePath,
@@ -3666,7 +3666,7 @@ var ts;
}
// test if [time,endTime) straddles a sampling point
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
- writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
+ writeEvent("X", phase, name, args, "\"dur\":".concat(endTime - time), time);
}
}
function writeEvent(eventType, phase, name, args, extras, time) {
@@ -3675,11 +3675,11 @@ var ts;
if (mode === "server" && phase === "checkTypes" /* CheckTypes */)
return;
ts.performance.mark("beginTracing");
- fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\"");
+ fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
if (extras)
- fs.writeSync(traceFd, "," + extras);
+ fs.writeSync(traceFd, ",".concat(extras));
if (args)
- fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args));
+ fs.writeSync(traceFd, ",\"args\":".concat(JSON.stringify(args)));
fs.writeSync(traceFd, "}");
ts.performance.mark("endTracing");
ts.performance.measure("Tracing", "beginTracing", "endTracing");
@@ -4840,6 +4840,8 @@ var ts;
TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike";
TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike";
/* @internal */
+ TypeFlags[TypeFlags["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable";
+ /* @internal */
TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains";
TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection";
TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType";
@@ -5792,7 +5794,7 @@ var ts;
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
function getLevel(envVar, level) {
- return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase());
+ return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
}
function getCustomLevels(baseVariable) {
var customLevels;
@@ -6261,7 +6263,7 @@ var ts;
}
function onTimerToUpdateChildWatches() {
timerToUpdateChildWatches = undefined;
- sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
var start = ts.timestamp();
var invokeMap = new ts.Map();
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
@@ -6274,7 +6276,7 @@ var ts;
var hasChanges = updateChildWatches(dirName, dirPath, options);
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
}
- sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
callbackCache.forEach(function (callbacks, rootDirName) {
var existing = invokeMap.get(rootDirName);
if (existing) {
@@ -6290,7 +6292,7 @@ var ts;
}
});
var elapsed = ts.timestamp() - start;
- sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
+ sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
}
function removeChildWatches(parentWatcher) {
if (!parentWatcher)
@@ -6750,7 +6752,7 @@ var ts;
var remappedPaths = new ts.Map();
var normalizedDir = ts.normalizeSlashes(__dirname);
// Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
- var fileUrlRoot = "file://" + (ts.getRootLength(normalizedDir) === 1 ? "" : "/") + normalizedDir;
+ var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
var node = _a[_i];
if (node.callFrame.url) {
@@ -6759,7 +6761,7 @@ var ts;
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
}
else if (!nativePattern.test(url)) {
- node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external" + externalFileCounter + ".js")).get(url);
+ node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
externalFileCounter++;
}
}
@@ -6775,7 +6777,7 @@ var ts;
if (!err) {
try {
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
- profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
+ profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
}
}
catch (_c) {
@@ -6877,7 +6879,7 @@ var ts;
* @param createWatcher
*/
function invokeCallbackAndUpdateWatcher(createWatcher) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
// Call the callback for current directory
callback("rename", "");
// If watcher is not closed, update it
@@ -6902,7 +6904,7 @@ var ts;
}
}
if (hitSystemWatcherLimit) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
@@ -6918,7 +6920,7 @@ var ts;
// 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
// so instead of throwing error, use fs.watchFile
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
}
@@ -8081,6 +8083,8 @@ var ts;
Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),
+ Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, ts.DiagnosticCategory.Error, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."),
+ Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, ts.DiagnosticCategory.Error, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
@@ -9933,7 +9937,7 @@ var ts;
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
}
else {
- ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
+ 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"));
}
}
var res = lineStarts[line] + character;
@@ -12823,7 +12827,7 @@ var ts;
: "linkplain";
var name = link.name ? ts.entityNameToString(link.name) : "";
var space = link.name && link.text.startsWith("://") ? "" : " ";
- return "{@" + kind + " " + name + space + link.text + "}";
+ return "{@".concat(kind, " ").concat(name).concat(space).concat(link.text, "}");
}
/**
* Gets the effective type parameters. If the node was parsed in a
@@ -14080,11 +14084,11 @@ var ts;
}
function packageIdToPackageName(_a) {
var name = _a.name, subModuleName = _a.subModuleName;
- return subModuleName ? name + "/" + subModuleName : name;
+ return subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
}
ts.packageIdToPackageName = packageIdToPackageName;
function packageIdToString(packageId) {
- return packageIdToPackageName(packageId) + "@" + packageId.version;
+ return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version);
}
ts.packageIdToString = packageIdToString;
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
@@ -14167,7 +14171,7 @@ var ts;
function nodePosToString(node) {
var file = getSourceFileOfNode(node);
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
- return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
+ return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
}
ts.nodePosToString = nodePosToString;
function getEndLinePosition(line, sourceFile) {
@@ -14306,7 +14310,7 @@ var ts;
ts.isPinnedComment = isPinnedComment;
function createCommentDirectivesMap(sourceFile, commentDirectives) {
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
- "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,
+ "".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
commentDirective,
]); }));
var usedLines = new ts.Map();
@@ -14323,10 +14327,10 @@ var ts;
});
}
function markUsed(line) {
- if (!directivesByLine.has("" + line)) {
+ if (!directivesByLine.has("".concat(line))) {
return false;
}
- usedLines.set("" + line, true);
+ usedLines.set("".concat(line), true);
return true;
}
}
@@ -14556,7 +14560,7 @@ var ts;
}
return node.text;
}
- return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
+ return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
}
ts.getLiteralText = getLiteralText;
function canUseOriginalText(node, flags) {
@@ -17137,11 +17141,11 @@ var ts;
}
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
function getPropertyNameForUniqueESSymbol(symbol) {
- return "__@" + ts.getSymbolId(symbol) + "@" + symbol.escapedName;
+ return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
}
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
- return "__#" + ts.getSymbolId(containingClassSymbol) + "@" + description;
+ return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
}
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
function isKnownSymbol(symbol) {
@@ -19843,7 +19847,7 @@ var ts;
}
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
function getJSXRuntimeImport(base, options) {
- return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
+ return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
}
ts.getJSXRuntimeImport = getJSXRuntimeImport;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -19950,7 +19954,7 @@ var ts;
}
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
- var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))";
+ var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
var filesMatcher = {
/**
* Matches any single directory segment unless it is the last segment and a .min.js file
@@ -19963,7 +19967,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
};
var directoriesMatcher = {
@@ -19972,7 +19976,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
};
var excludeMatcher = {
@@ -19990,10 +19994,10 @@ var ts;
if (!patterns || !patterns.length) {
return undefined;
}
- var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|");
+ var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
var terminator = usage === "exclude" ? "($|/)" : "$";
- return "^(" + pattern + ")" + terminator;
+ return "^(".concat(pattern, ")").concat(terminator);
}
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
function getRegularExpressionsForWildcards(specs, basePath, usage) {
@@ -20015,7 +20019,7 @@ var ts;
ts.isImplicitGlob = isImplicitGlob;
function getPatternFromSpec(spec, basePath, usage) {
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
- return pattern && "^(" + pattern + ")" + (usage === "exclude" ? "($|/)" : "$");
+ return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
}
ts.getPatternFromSpec = getPatternFromSpec;
function getSubPatternFromSpec(spec, basePath, usage, _a) {
@@ -20093,7 +20097,7 @@ var ts;
currentDirectory = ts.normalizePath(currentDirectory);
var absolutePath = ts.combinePaths(currentDirectory, path);
return {
- includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
+ includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
@@ -20374,7 +20378,7 @@ var ts;
*/
function extensionFromPath(path) {
var ext = tryGetExtensionFromPath(path);
- return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension.");
+ return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
}
ts.extensionFromPath = extensionFromPath;
function isAnySupportedFileExtension(path) {
@@ -26457,7 +26461,7 @@ var ts;
case 326 /* JSDocAugmentsTag */: return "augments";
case 327 /* JSDocImplementsTag */: return "implements";
default:
- return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
+ return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
}
}
var rawTextScanner;
@@ -26785,7 +26789,7 @@ var ts;
};
var definedTextGetter_1 = function (path) {
var result = textGetter_1(path);
- return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
+ return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
};
var buildInfo_1;
var getAndCacheBuildInfo_1 = function (getText) {
@@ -31323,7 +31327,7 @@ var ts;
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
var keyword = viableKeywordSuggestions_1[_i];
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
- return keyword + " " + expressionText.slice(keyword.length);
+ return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
}
}
return undefined;
@@ -38093,7 +38097,7 @@ var ts;
if (namedArgRegExCache.has(name)) {
return namedArgRegExCache.get(name);
}
- var result = new RegExp("(\\s" + name + "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))", "im");
+ var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
namedArgRegExCache.set(name, result);
return result;
}
@@ -39571,8 +39575,8 @@ var ts;
}
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
- var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
- return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
+ var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
+ return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
}
/* @internal */
function parseCustomTypeOption(opt, value, errors) {
@@ -40366,10 +40370,10 @@ var ts;
var newValue = compilerOptionsMap.get(cmd.name);
var defaultValue = getDefaultValueForOption(cmd);
if (newValue !== defaultValue) {
- result.push("" + tab + cmd.name + ": " + newValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
}
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
- result.push("" + tab + cmd.name + ": " + defaultValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
}
});
return result.join(newLine) + newLine;
@@ -40420,19 +40424,19 @@ var ts;
if (entries.length !== 0) {
entries.push({ value: "" });
}
- entries.push({ value: "/* " + category + " */" });
+ entries.push({ value: "/* ".concat(category, " */") });
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
var option = options_1[_i];
var optionName = void 0;
if (compilerOptionsMap.has(option.name)) {
- optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
+ optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
}
else {
- optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ",";
+ optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
}
entries.push({
value: optionName,
- description: "/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"
+ description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
});
marginLength = Math.max(optionName.length, marginLength);
}
@@ -40441,25 +40445,25 @@ var ts;
var tab = makePadding(2);
var result = [];
result.push("{");
- result.push(tab + "\"compilerOptions\": {");
- result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + " */");
+ result.push("".concat(tab, "\"compilerOptions\": {"));
+ 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), " */"));
result.push("");
// Print out each row, aligning all the descriptions on the same column.
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
var entry = entries_2[_a];
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
- result.push(value && "" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));
+ result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
}
if (fileNames.length) {
- result.push(tab + "},");
- result.push(tab + "\"files\": [");
+ result.push("".concat(tab, "},"));
+ result.push("".concat(tab, "\"files\": ["));
for (var i = 0; i < fileNames.length; i++) {
- result.push("" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? "" : ","));
+ result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
}
- result.push(tab + "]");
+ result.push("".concat(tab, "]"));
}
else {
- result.push(tab + "}");
+ result.push("".concat(tab, "}"));
}
result.push("}");
return result.join(newLine) + newLine;
@@ -40857,7 +40861,7 @@ var ts;
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
- extendedConfigPath = extendedConfigPath + ".json";
+ extendedConfigPath = "".concat(extendedConfigPath, ".json");
if (!host.fileExists(extendedConfigPath)) {
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
return undefined;
@@ -41102,7 +41106,7 @@ var ts;
// Valid only if *.json specified
if (!jsonOnlyIncludeRegexes) {
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
- var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^" + pattern + "$"; });
+ var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
}
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
@@ -41538,7 +41542,7 @@ var ts;
var bestVersionKey = result.version, bestVersionPaths = result.paths;
if (typeof bestVersionPaths !== "object") {
if (state.traceEnabled) {
- trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['" + bestVersionKey + "']", "object", typeof bestVersionPaths);
+ trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
}
return;
}
@@ -41945,7 +41949,7 @@ var ts;
};
return cache;
function getUnderlyingCacheKey(specifier, mode) {
- var result = mode === undefined ? specifier : mode + "|" + specifier;
+ var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
memoizedReverseKeys.set(result, [specifier, mode]);
return result;
}
@@ -41976,7 +41980,7 @@ var ts;
}
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
- return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode + "|" + nonRelativeModuleName, createPerModuleNameCache);
+ return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
}
function createPerModuleNameCache() {
var directoryPathMap = new ts.Map();
@@ -42123,10 +42127,10 @@ var ts;
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
break;
default:
- return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
+ return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
}
if (result && result.resolvedModule)
- ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
+ ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
if (perFolderCache) {
perFolderCache.set(moduleName, resolutionMode, result);
@@ -42329,7 +42333,7 @@ var ts;
function resolveJSModule(moduleName, initialDir, host) {
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
if (!resolvedModule) {
- throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", "));
+ throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
}
return resolvedModule.resolvedFileName;
}
@@ -42439,7 +42443,7 @@ var ts;
if (traceEnabled) {
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
}
- ts.Debug.assert(host.fileExists(real), path + " linked to nonexistent file " + real);
+ ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
return real;
}
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
@@ -42916,7 +42920,7 @@ var ts;
return undefined;
}
var trailingParts = parts.slice(nameParts.length);
- return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
+ return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
}
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
if (!scope.packageJsonContent.exports) {
@@ -43244,7 +43248,7 @@ var ts;
}
/* @internal */
function getTypesPackageName(packageName) {
- return "@types/" + mangleScopedPackageName(packageName);
+ return "@types/".concat(mangleScopedPackageName(packageName));
}
ts.getTypesPackageName = getTypesPackageName;
/* @internal */
@@ -43645,7 +43649,7 @@ var ts;
if (name) {
if (ts.isAmbientModule(node)) {
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
- return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
+ return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
}
if (name.kind === 161 /* ComputedPropertyName */) {
var nameExpression = name.expression;
@@ -43702,7 +43706,7 @@ var ts;
case 163 /* Parameter */:
// Parameters with names are handled at the top of this function. Parameters
// without names can only come from JSDocFunctionTypes.
- ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ 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"); });
var functionType = node.parent;
var index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -43814,7 +43818,7 @@ var ts;
var relatedInformation_1 = [];
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
// export type T; - may have meant export type { T }?
- relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { " + ts.unescapeLeadingUnderscores(node.name.escapedText) + " }"));
+ relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
}
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
ts.forEach(symbol.declarations, function (declaration, index) {
@@ -45890,7 +45894,7 @@ var ts;
}
}
function bindSourceFileAsExternalModule() {
- bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\"");
+ bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
}
function bindExportAssignment(node) {
if (!container.symbol || !container.symbol.exports) {
@@ -46941,8 +46945,7 @@ var ts;
IntersectionState[IntersectionState["Source"] = 1] = "Source";
IntersectionState[IntersectionState["Target"] = 2] = "Target";
IntersectionState[IntersectionState["PropertyCheck"] = 4] = "PropertyCheck";
- IntersectionState[IntersectionState["UnionIntersectionCheck"] = 8] = "UnionIntersectionCheck";
- IntersectionState[IntersectionState["InPropertyCheck"] = 16] = "InPropertyCheck";
+ IntersectionState[IntersectionState["InPropertyCheck"] = 8] = "InPropertyCheck";
})(IntersectionState || (IntersectionState = {}));
var RecursionFlags;
(function (RecursionFlags) {
@@ -47990,7 +47993,7 @@ var ts;
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
- var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + "|" + secondFile_1.path, function () {
+ var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
});
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
@@ -50643,7 +50646,7 @@ var ts;
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
- var key = (useOnlyExternalAliasing ? 0 : 1) + "|" + (firstRelevantLocation && getNodeId(firstRelevantLocation)) + "|" + meaning;
+ var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
if (cache.has(key)) {
return cache.get(key);
}
@@ -51492,7 +51495,7 @@ var ts;
context.symbolDepth = new ts.Map();
}
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
- var key = getTypeId(type) + "|" + context.flags;
+ var key = "".concat(getTypeId(type), "|").concat(context.flags);
if (links) {
links.serializedTypes || (links.serializedTypes = new ts.Map());
}
@@ -51761,7 +51764,7 @@ var ts;
}
}
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
- typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... " + (properties.length - i) + " more ...", /*questionToken*/ undefined, /*type*/ undefined));
+ typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
break;
}
@@ -51876,7 +51879,7 @@ var ts;
else if (types.length > 2) {
return [
typeToTypeNodeHelper(types[0], context),
- ts.factory.createTypeReferenceNode("... " + (types.length - 2) + " more ...", /*typeArguments*/ undefined),
+ ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
typeToTypeNodeHelper(types[types.length - 1], context)
];
}
@@ -51890,7 +51893,7 @@ var ts;
var type = types_2[_i];
i++;
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
- result_5.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined));
+ result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
if (typeNode_1) {
result_5.push(typeNode_1);
@@ -52413,7 +52416,7 @@ var ts;
var text = rawtext;
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
i++;
- text = rawtext + "_" + i;
+ text = "".concat(rawtext, "_").concat(i);
}
if (text !== rawtext) {
result = ts.factory.createIdentifier(text, result.typeArguments);
@@ -52733,7 +52736,7 @@ var ts;
function getNameForJSDocFunctionParameter(p, index) {
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
: getEffectiveDotDotDotForParameter(p) ? "args"
- : "arg" + index;
+ : "arg".concat(index);
}
function rewriteModuleSpecifier(parent, lit) {
if (bundled) {
@@ -53818,7 +53821,7 @@ var ts;
return results_1;
}
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
- return ts.Debug.fail("Unhandled class member kind! " + (p.__debugFlags || p.flags));
+ return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
};
}
function serializePropertySymbolForInterface(p, baseType) {
@@ -53893,7 +53896,7 @@ var ts;
if (ref) {
return ref;
}
- var tempName = getUnusedName(rootName + "_base");
+ var tempName = getUnusedName("".concat(rootName, "_base"));
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
], 2 /* Const */));
@@ -53940,7 +53943,7 @@ var ts;
var original = input;
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
i++;
- input = original + "_" + i;
+ input = "".concat(original, "_").concat(i);
}
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
if (id) {
@@ -54048,15 +54051,15 @@ var ts;
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
var name = "" + nameType.value;
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
- return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\"";
+ return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
}
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
- return "[" + name + "]";
+ return "[".concat(name, "]");
}
return name;
}
if (nameType.flags & 8192 /* UniqueESSymbol */) {
- return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
+ return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
}
}
}
@@ -56887,7 +56890,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -58838,7 +58841,7 @@ var ts;
return result;
}
function getAliasId(aliasSymbol, aliasTypeArguments) {
- return aliasSymbol ? "@" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? ":" + getTypeListId(aliasTypeArguments) : "") : "";
+ return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
}
// This function is used to propagate certain flags when creating new object type references and union types.
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
@@ -59024,7 +59027,7 @@ var ts;
return undefined;
}
function getSymbolPath(symbol) {
- return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
+ return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
@@ -59035,7 +59038,7 @@ var ts;
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
undefined;
- var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
+ var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
var result = unresolvedSymbols.get(path);
if (!result) {
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
@@ -59108,7 +59111,7 @@ var ts;
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
return baseType;
}
- var id = getTypeId(baseType) + ">" + getTypeId(substitute);
+ var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
var cached = substitutionTypes.get(id);
if (cached) {
return cached;
@@ -60032,9 +60035,9 @@ var ts;
return types[0];
}
var typeKey = !origin ? getTypeListId(types) :
- origin.flags & 1048576 /* Union */ ? "|" + getTypeListId(origin.types) :
- origin.flags & 2097152 /* Intersection */ ? "&" + getTypeListId(origin.types) :
- "#" + origin.type.id + "|" + getTypeListId(types); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
+ origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
+ origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
+ "#".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
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
var type = unionTypes.get(id);
if (!type) {
@@ -60556,7 +60559,7 @@ var ts;
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
return stringType;
}
- var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join("");
+ var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
var type = templateLiteralTypes.get(id);
if (!type) {
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
@@ -60616,7 +60619,7 @@ var ts;
return str;
}
function getStringMappingTypeForGenericType(symbol, type) {
- var id = getSymbolId(symbol) + "," + getTypeId(type);
+ var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
var result = stringMappingTypes.get(id);
if (!result) {
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
@@ -61633,7 +61636,7 @@ var ts;
function createUniqueESSymbolType(symbol) {
var type = createType(8192 /* UniqueESSymbol */);
type.symbol = symbol;
- type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
+ type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
return type;
}
function getESSymbolLikeTypeForNode(node) {
@@ -63228,11 +63231,11 @@ var ts;
var overflow = false;
var overrideNextErrorInfo = 0; // How many `reportRelationError` calls should be skipped in the elaboration pyramid
var lastSkippedInfo;
- var incompatibleStack = [];
+ var incompatibleStack;
var inPropertyCheck = false;
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
var result = isRelatedTo(source, target, 3 /* Both */, /*reportErrors*/ !!errorNode, headMessage);
- if (incompatibleStack.length) {
+ if (incompatibleStack) {
reportIncompatibleStack();
}
if (overflow) {
@@ -63289,19 +63292,19 @@ var ts;
return {
errorInfo: errorInfo,
lastSkippedInfo: lastSkippedInfo,
- incompatibleStack: incompatibleStack.slice(),
+ incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
overrideNextErrorInfo: overrideNextErrorInfo,
- relatedInfo: !relatedInfo ? undefined : relatedInfo.slice()
+ relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
};
}
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
overrideNextErrorInfo++; // Suppress the next relation error
lastSkippedInfo = undefined; // Reset skipped info cache
- incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
+ (incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
}
function reportIncompatibleStack() {
- var stack = incompatibleStack;
- incompatibleStack = [];
+ var stack = incompatibleStack || [];
+ incompatibleStack = undefined;
var info = lastSkippedInfo;
lastSkippedInfo = undefined;
if (stack.length === 1) {
@@ -63322,24 +63325,24 @@ var ts;
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
// Parenthesize a `new` if there is one
if (path.indexOf("new ") === 0) {
- path = "(" + path + ")";
+ path = "(".concat(path, ")");
}
var str = "" + args[0];
// If leading, just print back the arg (irrespective of if it's a valid identifier)
if (path.length === 0) {
- path = "" + str;
+ path = "".concat(str);
}
// Otherwise write a dotted name if possible
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
- path = path + "." + str;
+ path = "".concat(path, ".").concat(str);
}
// Failing that, check if the name is already a computed name
else if (str[0] === "[" && str[str.length - 1] === "]") {
- path = "" + path + str;
+ path = "".concat(path).concat(str);
}
// And finally write out a computed name as a last resort
else {
- path = path + "[" + str + "]";
+ path = "".concat(path, "[").concat(str, "]");
}
break;
}
@@ -63368,7 +63371,7 @@ var ts;
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
? ""
: "...";
- path = "" + prefix + path + "(" + params + ")";
+ path = "".concat(prefix).concat(path, "(").concat(params, ")");
}
break;
}
@@ -63381,7 +63384,7 @@ var ts;
break;
}
default:
- return ts.Debug.fail("Unhandled Diagnostic: " + msg.code);
+ return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
}
}
if (path) {
@@ -63407,7 +63410,7 @@ var ts;
}
function reportError(message, arg0, arg1, arg2, arg3) {
ts.Debug.assert(!!errorNode);
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
if (message.elidedInCompatabilityPyramid)
return;
@@ -63423,7 +63426,7 @@ var ts;
}
}
function reportRelationError(message, source, target) {
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
var generalizedSource = source;
@@ -63535,7 +63538,9 @@ var ts;
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
return -1 /* True */;
}
- reportErrorResults(originalSource, originalTarget, 0 /* False */, !!(ts.getObjectFlags(originalSource) & 2048 /* JsxAttributes */));
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
+ }
return 0 /* False */;
}
// Normalize the source and target types: Turn fresh literal types into regular literal types,
@@ -63547,7 +63552,12 @@ var ts;
if (source === target)
return -1 /* True */;
if (relation === identityRelation) {
- return isIdenticalTo(source, target, recursionFlags);
+ if (source.flags !== target.flags)
+ return 0 /* False */;
+ if (source.flags & 67358815 /* Singleton */)
+ return -1 /* True */;
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
}
// We fastpath comparing a type parameter to exactly its constraint, as this is _super_ common,
// and otherwise, for type parameters in large unions, causes us to need to compare the union to itself,
@@ -63557,163 +63567,130 @@ var ts;
if (source.flags & 262144 /* TypeParameter */ && getConstraintOfType(source) === target) {
return -1 /* True */;
}
- // Try to see if we're relating something like `Foo` -> `Bar | null | undefined`.
- // If so, reporting the `null` and `undefined` in the type is hardly useful.
- // First, see if we're even relating an object type to a union.
- // Then see if the target is stripped down to a single non-union type.
- // Note
- // * We actually want to remove null and undefined naively here (rather than using getNonNullableType),
- // since we don't want to end up with a worse error like "`Foo` is not assignable to `NonNullable`"
- // when dealing with generics.
- // * We also don't deal with primitive source types, since we already halt elaboration below.
- if (target.flags & 1048576 /* Union */ && source.flags & 524288 /* Object */ &&
- target.types.length <= 3 && maybeTypeOfKind(target, 98304 /* Nullable */)) {
- var nullStrippedTarget = extractTypesOfKind(target, ~98304 /* Nullable */);
- if (!(nullStrippedTarget.flags & (1048576 /* Union */ | 131072 /* Never */))) {
- target = getNormalizedType(nullStrippedTarget, /*writing*/ true);
+ // See if we're relating a definitely non-nullable type to a union that includes null and/or undefined
+ // plus a single non-nullable type. If so, remove null and/or undefined from the target type.
+ if (source.flags & 470302716 /* DefinitelyNonNullable */ && target.flags & 1048576 /* Union */) {
+ var types = target.types;
+ var candidate = types.length === 2 && types[0].flags & 98304 /* Nullable */ ? types[1] :
+ types.length === 3 && types[0].flags & 98304 /* Nullable */ && types[1].flags & 98304 /* Nullable */ ? types[2] :
+ undefined;
+ if (candidate && !(candidate.flags & 98304 /* Nullable */)) {
+ target = getNormalizedType(candidate, /*writing*/ true);
+ if (source === target)
+ return -1 /* True */;
}
- if (source === nullStrippedTarget)
- return -1 /* True */;
}
if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) ||
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
return -1 /* True */;
- var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
- var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
- if (isPerformingExcessPropertyChecks) {
- if (hasExcessProperties(source, target, reportErrors)) {
+ if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {
+ var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
+ if (isPerformingExcessPropertyChecks) {
+ if (hasExcessProperties(source, target, reportErrors)) {
+ if (reportErrors) {
+ reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ }
+ return 0 /* False */;
+ }
+ }
+ var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
+ source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
+ target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
+ (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
+ var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
+ if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
if (reportErrors) {
- reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
+ var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
+ var calls = getSignaturesOfType(source, 0 /* Call */);
+ var constructs = getSignaturesOfType(source, 1 /* Construct */);
+ if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
+ constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
+ reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
+ }
+ else {
+ reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
+ }
}
return 0 /* False */;
}
- }
- var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
- source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
- target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
- (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
- if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
- if (reportErrors) {
- var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
- var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
- var calls = getSignaturesOfType(source, 0 /* Call */);
- var constructs = getSignaturesOfType(source, 1 /* Construct */);
- if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
- constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
- reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
- }
- else {
- reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
- }
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ var skipCaching = source.flags & 1048576 /* Union */ && source.types.length < 4 && !(target.flags & 1048576 /* Union */) ||
+ target.flags & 1048576 /* Union */ && target.types.length < 4 && !(source.flags & 469499904 /* StructuredOrInstantiable */);
+ var result_7 = skipCaching ?
+ unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
+ recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
+ // For certain combinations involving intersections and optional, excess, or mismatched properties we need
+ // an extra property check where the intersection is viewed as a single object. The following are motivating
+ // examples that all should be errors, but aren't without this extra property check:
+ //
+ // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
+ //
+ // declare let wrong: { a: { y: string } };
+ // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
+ //
+ // function foo(x: { a?: string }, y: T & { a: boolean }) {
+ // x = y; // Mismatched property in source intersection
+ // }
+ //
+ // We suppress recursive intersection property checks because they can generate lots of work when relating
+ // recursive intersections that are structurally similar but not exactly identical. See #37854.
+ if (result_7 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
+ isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
+ inPropertyCheck = true;
+ result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
+ inPropertyCheck = false;
}
- return 0 /* False */;
- }
- traceUnionsOrIntersectionsTooLarge(source, target);
- var result = 0 /* False */;
- var saveErrorInfo = captureErrorCalculationState();
- if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
- // We skip caching when source or target is a union with no more than three constituents.
- result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
- }
- else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
- result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
- }
- if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
- if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
- resetErrorInfo(saveErrorInfo);
+ if (result_7) {
+ return result_7;
}
}
- if (!result && source.flags & (2097152 /* Intersection */ | 262144 /* TypeParameter */)) {
- // The combined constraint of an intersection type is the intersection of the constraints of
- // the constituents. When an intersection type contains instantiable types with union type
- // constraints, there are situations where we need to examine the combined constraint. One is
- // when the target is a union type. Another is when the intersection contains types belonging
- // to one of the disjoint domains. For example, given type variables T and U, each with the
- // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
- // we need to check this constraint against a union on the target side. Also, given a type
- // variable V constrained to 'string | number', 'V & number' has a combined constraint of
- // 'string & number | number & number' which reduces to just 'number'.
- // This also handles type parameters, as a type parameter with a union constraint compared against a union
- // needs to have its constraint hoisted into an intersection with said type parameter, this way
- // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
- // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
- var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
- if (constraint && (source.flags & 2097152 /* Intersection */ || target.flags & 1048576 /* Union */)) {
- if (everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
- // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
- if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
- resetErrorInfo(saveErrorInfo);
- }
- }
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, source, target, headMessage);
+ }
+ return 0 /* False */;
+ }
+ function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
+ var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
+ var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
+ source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
+ target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
+ var maybeSuppress = overrideNextErrorInfo > 0;
+ if (maybeSuppress) {
+ overrideNextErrorInfo--;
+ }
+ if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
+ var currentError = errorInfo;
+ tryElaborateArrayLikeErrors(source, target, /*reportErrors*/ true);
+ if (errorInfo !== currentError) {
+ maybeSuppress = !!errorInfo;
}
}
- // For certain combinations involving intersections and optional, excess, or mismatched properties we need
- // an extra property check where the intersection is viewed as a single object. The following are motivating
- // examples that all should be errors, but aren't without this extra property check:
- //
- // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
- //
- // declare let wrong: { a: { y: string } };
- // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
- //
- // function foo(x: { a?: string }, y: T & { a: boolean }) {
- // x = y; // Mismatched property in source intersection
- // }
- //
- // We suppress recursive intersection property checks because they can generate lots of work when relating
- // recursive intersections that are structurally similar but not exactly identical. See #37854.
- if (result && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
- isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
- inPropertyCheck = true;
- result &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
- inPropertyCheck = false;
+ if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
+ tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
- reportErrorResults(source, target, result, isComparingJsxAttributes);
- return result;
- function reportErrorResults(source, target, result, isComparingJsxAttributes) {
- if (!result && reportErrors) {
- var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
- var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
- source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
- target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
- var maybeSuppress = overrideNextErrorInfo > 0;
- if (maybeSuppress) {
- overrideNextErrorInfo--;
- }
- if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
- var currentError = errorInfo;
- tryElaborateArrayLikeErrors(source, target, reportErrors);
- if (errorInfo !== currentError) {
- maybeSuppress = !!errorInfo;
- }
- }
- if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
- tryElaborateErrorsForPrimitivesAndObjects(source, target);
- }
- else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
- reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
- }
- else if (isComparingJsxAttributes && target.flags & 2097152 /* Intersection */) {
- var targetTypes = target.types;
- var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
- var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
- if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
- (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
- // do not report top error
- return result;
- }
- }
- else {
- errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
- }
- if (!headMessage && maybeSuppress) {
- lastSkippedInfo = [source, target];
- // Used by, eg, missing property checking to replace the top-level message with a more informative one
- return result;
- }
- reportRelationError(headMessage, source, target);
+ else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
+ reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
+ }
+ else if (ts.getObjectFlags(source) & 2048 /* JsxAttributes */ && target.flags & 2097152 /* Intersection */) {
+ var targetTypes = target.types;
+ var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
+ var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
+ if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
+ (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
+ // do not report top error
+ return;
}
}
+ else {
+ errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
+ }
+ if (!headMessage && maybeSuppress) {
+ lastSkippedInfo = [source, target];
+ // Used by, eg, missing property checking to replace the top-level message with a more informative one
+ return;
+ }
+ reportRelationError(headMessage, source, target);
}
function traceUnionsOrIntersectionsTooLarge(source, target) {
if (!ts.tracing) {
@@ -63740,21 +63717,6 @@ var ts;
}
}
}
- function isIdenticalTo(source, target, recursionFlags) {
- if (source.flags !== target.flags)
- return 0 /* False */;
- if (source.flags & 67358815 /* Singleton */)
- return -1 /* True */;
- traceUnionsOrIntersectionsTooLarge(source, target);
- if (source.flags & 3145728 /* UnionOrIntersection */) {
- var result_7 = eachTypeRelatedToSomeType(source, target);
- if (result_7) {
- result_7 &= eachTypeRelatedToSomeType(target, source);
- }
- return result_7;
- }
- return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
- }
function getTypeOfPropertyInTypes(types, name) {
var appendPropType = function (propTypes, type) {
var _a;
@@ -63853,6 +63815,41 @@ var ts;
function shouldCheckAsExcessProperty(prop, container) {
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
}
+ function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
+ // Note that these checks are specifically ordered to produce correct results. In particular,
+ // we need to deconstruct unions before intersections (because unions are always at the top),
+ // and we need to handle "each" relations before "some" relations for the same kind of type.
+ if (source.flags & 1048576 /* Union */) {
+ return relation === comparableRelation ?
+ someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) :
+ eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState);
+ }
+ if (target.flags & 1048576 /* Union */) {
+ return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
+ }
+ if (target.flags & 2097152 /* Intersection */) {
+ return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
+ }
+ // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
+ // constraints of all non-primitive types in the source into a new intersection. We do this because the
+ // intersection may further constrain the constraints of the non-primitive types. For example, given a type
+ // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
+ // appear to be comparable to '2'.
+ if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
+ var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
+ if (constraints !== source.types) {
+ source = getIntersectionType(constraints);
+ if (!(source.flags & 2097152 /* Intersection */)) {
+ return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
+ }
+ }
+ }
+ // Check to see if any constituents of the intersection are immediately related to the target.
+ // Don't report errors though. Elaborating on whether a source constituent is related to the target is
+ // not actually useful and leads to some confusing error messages. Instead, we rely on the caller
+ // checking whether the full intersection viewed as an object is related to the target.
+ return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
+ }
function eachTypeRelatedToSomeType(source, target) {
var result = -1 /* True */;
var sourceTypes = source.types;
@@ -63888,8 +63885,11 @@ var ts;
}
}
if (reportErrors) {
+ // Elaborate only if we can find a best matching type in the target union
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
- isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], 2 /* Target */, /*reportErrors*/ true);
+ if (bestMatchingType) {
+ isRelatedTo(source, bestMatchingType, 2 /* Target */, /*reportErrors*/ true);
+ }
}
return 0 /* False */;
}
@@ -64025,7 +64025,7 @@ var ts;
if (overflow) {
return 0 /* False */;
}
- var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0);
+ var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 /* InPropertyCheck */ : 0);
var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false);
var entry = relation.get(id);
if (entry !== undefined) {
@@ -64093,6 +64093,7 @@ var ts;
return originalHandler(onlyUnreliable);
};
}
+ var result;
if (expandingFlags === 3 /* Both */) {
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "recursiveTypeRelatedTo_DepthLimit", {
sourceId: source.id,
@@ -64102,8 +64103,13 @@ var ts;
depth: sourceDepth,
targetDepth: targetDepth
});
+ result = 3 /* Maybe */;
+ }
+ else {
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
+ result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
}
- var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */;
if (outofbandVarianceMarkerHandler) {
outofbandVarianceMarkerHandler = originalHandler;
}
@@ -64135,98 +64141,97 @@ var ts;
return result;
}
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
- var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
- return result;
- }
- function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
if (intersectionState & 4 /* PropertyCheck */) {
return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */);
}
- if (intersectionState & 8 /* UnionIntersectionCheck */) {
- // Note that these checks are specifically ordered to produce correct results. In particular,
- // we need to deconstruct unions before intersections (because unions are always at the top),
- // and we need to handle "each" relations before "some" relations for the same kind of type.
- if (source.flags & 1048576 /* Union */) {
- return relation === comparableRelation ?
- someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */) :
- eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */);
- }
- if (target.flags & 1048576 /* Union */) {
- return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
- }
- if (target.flags & 2097152 /* Intersection */) {
- return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
- }
- // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
- // constraints of all non-primitive types in the source into a new intersection. We do this because the
- // intersection may further constrain the constraints of the non-primitive types. For example, given a type
- // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
- // appear to be comparable to '2'.
- if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
- var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
- if (constraints !== source.types) {
- source = getIntersectionType(constraints);
- if (!(source.flags & 2097152 /* Intersection */)) {
- return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
- }
+ var result;
+ var originalErrorInfo;
+ var varianceCheckFailed = false;
+ var saveErrorInfo = captureErrorCalculationState();
+ var sourceFlags = source.flags;
+ var targetFlags = target.flags;
+ if (relation === identityRelation) {
+ // We've already checked that source.flags and target.flags are identical
+ if (sourceFlags & 3145728 /* UnionOrIntersection */) {
+ var result_8 = eachTypeRelatedToSomeType(source, target);
+ if (result_8) {
+ result_8 &= eachTypeRelatedToSomeType(target, source);
}
+ return result_8;
}
- // Check to see if any constituents of the intersection are immediately related to the target.
- //
- // Don't report errors though. Checking whether a constituent is related to the source is not actually
- // useful and leads to some confusing error messages. Instead it is better to let the below checks
- // take care of this, or to not elaborate at all. For instance,
- //
- // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors.
- //
- // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection
- // than to report that 'D' is not assignable to 'A' or 'B'.
- //
- // - For a primitive type or type parameter (such as 'number = A & B') there is no point in
- // breaking the intersection apart.
- return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
- }
- var flags = source.flags & target.flags;
- if (relation === identityRelation && !(flags & 524288 /* Object */)) {
- if (flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
return isRelatedTo(source.type, target.type, 3 /* Both */, /*reportErrors*/ false);
}
- var result_8 = 0 /* False */;
- if (flags & 8388608 /* IndexedAccess */) {
- if (result_8 = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
+ if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
- if (flags & 16777216 /* Conditional */) {
+ if (sourceFlags & 16777216 /* Conditional */) {
if (source.root.isDistributive === target.root.isDistributive) {
- if (result_8 = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (result = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
}
}
}
- if (flags & 33554432 /* Substitution */) {
+ if (sourceFlags & 33554432 /* Substitution */) {
return isRelatedTo(source.substitute, target.substitute, 3 /* Both */, /*reportErrors*/ false);
}
- return 0 /* False */;
+ if (!(sourceFlags & 524288 /* Object */)) {
+ return 0 /* False */;
+ }
+ }
+ else if (sourceFlags & 3145728 /* UnionOrIntersection */ || targetFlags & 3145728 /* UnionOrIntersection */) {
+ if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
+ return result;
+ }
+ if (source.flags & 2097152 /* Intersection */ || source.flags & 262144 /* TypeParameter */ && target.flags & 1048576 /* Union */) {
+ // The combined constraint of an intersection type is the intersection of the constraints of
+ // the constituents. When an intersection type contains instantiable types with union type
+ // constraints, there are situations where we need to examine the combined constraint. One is
+ // when the target is a union type. Another is when the intersection contains types belonging
+ // to one of the disjoint domains. For example, given type variables T and U, each with the
+ // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
+ // we need to check this constraint against a union on the target side. Also, given a type
+ // variable V constrained to 'string | number', 'V & number' has a combined constraint of
+ // 'string & number | number & number' which reduces to just 'number'.
+ // This also handles type parameters, as a type parameter with a union constraint compared against a union
+ // needs to have its constraint hoisted into an intersection with said type parameter, this way
+ // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
+ // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
+ var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
+ if (constraint && everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
+ // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
+ if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
+ resetErrorInfo(saveErrorInfo);
+ return result;
+ }
+ }
+ }
+ // The ordered decomposition above doesn't handle all cases. Specifically, we also need to handle:
+ // Source is instantiable (e.g. source has union or intersection constraint).
+ // Source is an object, target is a union (e.g. { a, b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target is an object (e.g. { a } & { b } <=> { a, b }).
+ // Source is an intersection, target is a union (e.g. { a } & { b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target instantiable (e.g. string & { tag } <=> T["a"] constrained to string & { tag }).
+ if (!(sourceFlags & 465829888 /* Instantiable */ ||
+ sourceFlags & 524288 /* Object */ && targetFlags & 1048576 /* Union */ ||
+ sourceFlags & 2097152 /* Intersection */ && targetFlags & (524288 /* Object */ | 1048576 /* Union */ | 465829888 /* Instantiable */))) {
+ return 0 /* False */;
+ }
}
- var result;
- var originalErrorInfo;
- var varianceCheckFailed = false;
- var saveErrorInfo = captureErrorCalculationState();
// We limit alias variance probing to only object and conditional types since their alias behavior
// is more predictable than other, interned types, which may or may not have an alias depending on
// the order in which things were checked.
- if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
+ if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
var variances = getAliasVariances(source.aliasSymbol);
@@ -64244,7 +64249,7 @@ var ts;
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2 /* Target */))) {
return result;
}
- if (target.flags & 262144 /* TypeParameter */) {
+ if (targetFlags & 262144 /* TypeParameter */) {
// A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q].
if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3 /* Both */)) {
if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) {
@@ -64256,10 +64261,10 @@ var ts;
}
}
}
- else if (target.flags & 4194304 /* Index */) {
+ else if (targetFlags & 4194304 /* Index */) {
var targetType_1 = target.type;
// A keyof S is related to a keyof T if T is related to S.
- if (source.flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(targetType_1, source.type, 3 /* Both */, /*reportErrors*/ false)) {
return result;
}
@@ -64310,8 +64315,8 @@ var ts;
}
}
}
- else if (target.flags & 8388608 /* IndexedAccess */) {
- if (source.flags & 8388608 /* IndexedAccess */) {
+ else if (targetFlags & 8388608 /* IndexedAccess */) {
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
// Relate components directly before falling back to constraint relationships
// A type S[K] is related to a type T[J] if S is related to T and K is related to J.
if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, reportErrors)) {
@@ -64417,7 +64422,7 @@ var ts;
}
}
}
- else if (target.flags & 16777216 /* Conditional */) {
+ else if (targetFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
@@ -64442,8 +64447,8 @@ var ts;
}
}
}
- else if (target.flags & 134217728 /* TemplateLiteral */) {
- if (source.flags & 134217728 /* TemplateLiteral */) {
+ else if (targetFlags & 134217728 /* TemplateLiteral */) {
+ if (sourceFlags & 134217728 /* TemplateLiteral */) {
if (relation === comparableRelation) {
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 /* False */ : -1 /* True */;
}
@@ -64455,11 +64460,11 @@ var ts;
return -1 /* True */;
}
}
- if (source.flags & 8650752 /* TypeVariable */) {
- // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
- if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
+ if (sourceFlags & 8650752 /* TypeVariable */) {
+ // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
+ if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
var constraint = getConstraintOfType(source);
- if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
+ if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
// A type variable with no constraint is not related to the non-primitive object type.
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
resetErrorInfo(saveErrorInfo);
@@ -64472,7 +64477,7 @@ var ts;
return result;
}
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(target.flags & source.flags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
+ else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
resetErrorInfo(saveErrorInfo);
return result;
}
@@ -64489,14 +64494,14 @@ var ts;
}
}
}
- else if (source.flags & 4194304 /* Index */) {
+ else if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(keyofConstraintType, target, 1 /* Source */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
}
}
- else if (source.flags & 134217728 /* TemplateLiteral */ && !(target.flags & 524288 /* Object */)) {
- if (!(target.flags & 134217728 /* TemplateLiteral */)) {
+ else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
+ if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
var constraint = getBaseConstraintOfType(source);
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1 /* Source */, reportErrors))) {
resetErrorInfo(saveErrorInfo);
@@ -64504,8 +64509,8 @@ var ts;
}
}
}
- else if (source.flags & 268435456 /* StringMapping */) {
- if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
+ else if (sourceFlags & 268435456 /* StringMapping */) {
+ if (targetFlags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
@@ -64519,14 +64524,14 @@ var ts;
}
}
}
- else if (source.flags & 16777216 /* Conditional */) {
+ else if (sourceFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
resetErrorInfo(saveErrorInfo);
return 3 /* Maybe */;
}
- if (target.flags & 16777216 /* Conditional */) {
+ if (targetFlags & 16777216 /* Conditional */) {
// Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if
// one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2,
// and Y1 is related to Y2.
@@ -64586,9 +64591,10 @@ var ts;
}
return 0 /* False */;
}
- var sourceIsPrimitive = !!(source.flags & 131068 /* Primitive */);
+ var sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */);
if (relation !== identityRelation) {
source = getApparentType(source);
+ sourceFlags = source.flags;
}
else if (isGenericMappedType(source)) {
return 0 /* False */;
@@ -64630,7 +64636,7 @@ var ts;
// In a check of the form X = A & B, we will have previously checked if A relates to X or B relates
// to X. Failing both of those we want to check if the aggregation of A and B's members structurally
// relates to X. Thus, we include intersection types on the source side here.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 524288 /* Object */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
// Report structural errors only if we haven't reported any errors yet
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined, intersectionState);
@@ -64654,7 +64660,7 @@ var ts;
// there exists a constituent of T for every combination of the discriminants of S
// with respect to T. We do not report errors here, as we will use the existing
// error result from checking each constituent of the union.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 1048576 /* Union */) {
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
if (objectOnlyTarget.flags & 1048576 /* Union */) {
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
@@ -65169,7 +65175,6 @@ var ts;
}
}
var result = -1 /* True */;
- var saveErrorInfo = captureErrorCalculationState();
var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
var sourceObjectFlags = ts.getObjectFlags(source);
var targetObjectFlags = ts.getObjectFlags(target);
@@ -65210,6 +65215,7 @@ var ts;
else {
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
var t = targetSignatures_1[_i];
+ var saveErrorInfo = captureErrorCalculationState();
// Only elaborate errors from the first failure
var shouldElaborateErrors = reportErrors;
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
@@ -65583,7 +65589,7 @@ var ts;
var constraintMarker = "";
var sourceId = getTypeReferenceId(source, 0);
var targetId = getTypeReferenceId(target, 0);
- return "" + constraintMarker + sourceId + "," + targetId + postFix;
+ return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
// getTypeReferenceId(A) returns "111=0-12=1"
// where A.id=111 and number.id=12
function getTypeReferenceId(type, depth) {
@@ -65627,7 +65633,7 @@ var ts;
var postFix = intersectionState ? ":" + intersectionState : "";
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
- source.id + "," + target.id + postFix;
+ "".concat(source.id, ",").concat(target.id).concat(postFix);
}
// Invoke the callback for each underlying property symbol of the given symbol and return the first
// value that isn't undefined.
@@ -67754,11 +67760,11 @@ var ts;
case 79 /* Identifier */:
if (!ts.isThisInTypeQuery(node)) {
var symbol = getResolvedSymbol(node);
- return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
+ return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
}
// falls through
case 108 /* ThisKeyword */:
- return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
+ return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
case 229 /* NonNullExpression */:
case 211 /* ParenthesizedExpression */:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
@@ -68380,9 +68386,6 @@ var ts;
getUnionType(ts.map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) :
mapType(type, mapper);
}
- function getConstituentCount(type) {
- return type.flags & 1048576 /* Union */ ? type.types.length : 1;
- }
function extractTypesOfKind(type, kind) {
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
}
@@ -69956,7 +69959,7 @@ var ts;
var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
+ return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
}
function isExportOrExportExpression(location) {
return !!ts.findAncestor(location, function (n) {
@@ -71647,7 +71650,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -76048,21 +76051,22 @@ var ts;
if (links.type === unknownType) {
links.type = getTypeFromBindingPattern(declaration.name);
}
- assignBindingElementTypes(declaration.name);
+ assignBindingElementTypes(declaration.name, links.type);
}
}
}
// When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push
// the destructured type into the contained binding elements.
- function assignBindingElementTypes(pattern) {
+ function assignBindingElementTypes(pattern, parentType) {
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
+ var type = getBindingElementTypeFromParentType(element, parentType);
if (element.name.kind === 79 /* Identifier */) {
- getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
+ getSymbolLinks(getSymbolOfNode(element)).type = type;
}
else {
- assignBindingElementTypes(element.name);
+ assignBindingElementTypes(element.name, type);
}
}
}
@@ -79803,28 +79807,24 @@ var ts;
if (returnType.flags & 1 /* Any */) {
return;
}
+ var headMessage;
var expectedReturnType;
- var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
- var errorInfo;
switch (node.parent.kind) {
case 256 /* ClassDeclaration */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 163 /* Parameter */:
- expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
- break;
case 166 /* PropertyDeclaration */:
+ case 163 /* Parameter */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
case 168 /* MethodDeclaration */:
case 171 /* GetAccessor */:
case 172 /* SetAccessor */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -79832,7 +79832,7 @@ var ts;
default:
return ts.Debug.fail();
}
- checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; });
+ checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
}
/**
* If a TypeNode can be resolved to a value symbol imported from an external module, it is
@@ -81514,7 +81514,7 @@ var ts;
function getPropertyNameForKnownSymbolName(symbolName) {
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
- return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
+ return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
}
/**
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
@@ -82105,9 +82105,9 @@ var ts;
var containsArguments = containsArgumentsReference(node);
if (containsArguments) {
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
- if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
+ if (isJs && lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
- errorOrSuggestion(isJs, lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
+ error(lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
}
}
else {
@@ -82117,7 +82117,9 @@ var ts;
return;
}
if (ts.isQualifiedName(name)) {
- errorOrSuggestion(isJs, name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ if (isJs) {
+ error(name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ }
}
else {
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
@@ -87296,29 +87298,28 @@ var ts;
}
function findMostOverlappyType(source, unionTarget) {
var bestMatch;
- var matchingCount = 0;
- for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
- var target = _a[_i];
- var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
- if (overlap.flags & 4194304 /* Index */) {
- // perfect overlap of keys
- bestMatch = target;
- matchingCount = Infinity;
- }
- else if (overlap.flags & 1048576 /* Union */) {
- // We only want to account for literal types otherwise.
- // If we have a union of index types, it seems likely that we
- // needed to elaborate between two generic mapped types anyway.
- var len = ts.length(ts.filter(overlap.types, isUnitType));
- if (len >= matchingCount) {
- bestMatch = target;
- matchingCount = len;
+ if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var matchingCount = 0;
+ for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
+ var target = _a[_i];
+ if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
+ if (overlap.flags & 4194304 /* Index */) {
+ // perfect overlap of keys
+ return target;
+ }
+ else if (isUnitType(overlap) || overlap.flags & 1048576 /* Union */) {
+ // We only want to account for literal types otherwise.
+ // If we have a union of index types, it seems likely that we
+ // needed to elaborate between two generic mapped types anyway.
+ var len = overlap.flags & 1048576 /* Union */ ? ts.countWhere(overlap.types, isUnitType) : 1;
+ if (len >= matchingCount) {
+ bestMatch = target;
+ matchingCount = len;
+ }
+ }
}
}
- else if (isUnitType(overlap) && 1 >= matchingCount) {
- bestMatch = target;
- matchingCount = 1;
- }
}
return bestMatch;
}
@@ -88566,7 +88567,7 @@ var ts;
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
value === 62 ? 43 /* plus */ :
value === 63 ? 47 /* slash */ :
- ts.Debug.fail(value + ": not a base64 value");
+ ts.Debug.fail("".concat(value, ": not a base64 value"));
}
function base64FormatDecode(ch) {
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
@@ -88641,7 +88642,7 @@ var ts;
var mappings = ts.arrayFrom(decoder, processMapping);
if (decoder.error !== undefined) {
if (host.log) {
- host.log("Encountered error while decoding sourcemap: " + decoder.error);
+ host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
}
decodedMappings = ts.emptyArray;
}
@@ -92316,7 +92317,7 @@ var ts;
var propertyName = ts.isPropertyAccessExpression(originalNode)
? ts.declarationNameToString(originalNode.name)
: ts.getTextOfNode(originalNode.argumentExpression);
- ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
+ ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
}
return substitute;
}
@@ -93792,8 +93793,8 @@ var ts;
}
function createHoistedVariableForClass(name, node) {
var className = getPrivateIdentifierEnvironment().className;
- var prefix = className ? "_" + className : "";
- var identifier = factory.createUniqueName(prefix + "_" + name, 16 /* Optimistic */);
+ var prefix = className ? "_".concat(className) : "";
+ var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
addBlockScopedVariable(identifier);
}
@@ -95798,7 +95799,7 @@ var ts;
specifierSourceImports = new ts.Map();
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
}
- var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
+ var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
generatedName.generatedImportReference = specifier;
specifierSourceImports.set(name, specifier);
@@ -96946,11 +96947,11 @@ var ts;
}
else {
if (node.kind === 245 /* BreakStatement */) {
- labelMarker = "break-" + label.escapedText;
+ labelMarker = "break-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
}
else {
- labelMarker = "continue-" + label.escapedText;
+ labelMarker = "continue-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
}
}
@@ -105807,7 +105808,7 @@ var ts;
return getTypeAliasDeclarationVisibilityError;
}
else {
- return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
+ return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
@@ -106018,7 +106019,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
- return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
+ return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
}
}
function getTypeParameterConstraintVisibilityError() {
@@ -106776,7 +106777,7 @@ var ts;
while (ts.length(lateMarkedStatements)) {
var i = lateMarkedStatements.shift();
if (!ts.isLateVisibilityPaintedStatement(i)) {
- return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
+ 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));
}
var priorNeedsDeclare = needsDeclare;
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
@@ -106965,7 +106966,7 @@ var ts;
return cleanup(input);
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));
}
- default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
+ default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
}
}
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
@@ -107256,7 +107257,7 @@ var ts;
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
// We must add a temporary declaration for the extends clause expression
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
- var newId_1 = factory.createUniqueName(oldId + "_base", 16 /* Optimistic */);
+ var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
getSymbolAccessibilityDiagnostic = function () { return ({
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
errorNode: extendsClause_1,
@@ -107297,7 +107298,7 @@ var ts;
}
}
// Anything left unhandled is an error, so this should be unreachable
- return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
+ return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
function cleanup(node) {
if (isEnclosingDeclaration(input)) {
enclosingDeclaration = previousEnclosingDeclaration;
@@ -108189,13 +108190,13 @@ var ts;
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
return;
if (js && configFile.options.sourceMap) {
- addOutput(js + ".map");
+ addOutput("".concat(js, ".map"));
}
if (ts.getEmitDeclarations(configFile.options)) {
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
addOutput(dts);
if (configFile.options.declarationMap) {
- addOutput(dts + ".map");
+ addOutput("".concat(dts, ".map"));
}
}
}
@@ -108264,7 +108265,7 @@ var ts;
function getFirstProjectOutput(configFile, ignoreCase) {
if (ts.outFile(configFile.options)) {
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
- return ts.Debug.checkDefined(jsFilePath, "project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
@@ -108283,7 +108284,7 @@ var ts;
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
if (buildInfoPath)
return buildInfoPath;
- return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
ts.getFirstProjectOutput = getFirstProjectOutput;
/*@internal*/
@@ -108509,7 +108510,7 @@ var ts;
if (sourceMappingURL) {
if (!writer.isAtStartOfLine())
writer.rawWrite(newLine);
- writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Tools can sometimes see this line as a source mapping url comment
+ writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
}
// Write the source map
if (sourceMapFilePath) {
@@ -108558,7 +108559,7 @@ var ts;
// Encode the sourceMap into the sourceMap url
var sourceMapText = sourceMapGenerator.toString();
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
- return "data:application/json;base64," + base64SourceMapText;
+ return "data:application/json;base64,".concat(base64SourceMapText);
}
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
if (mapOptions.mapRoot) {
@@ -108738,7 +108739,7 @@ var ts;
return;
break;
default:
- ts.Debug.fail("Unexpected path: " + name);
+ ts.Debug.fail("Unexpected path: ".concat(name));
}
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
},
@@ -109598,7 +109599,7 @@ var ts;
return writeTokenNode(node, writeKeyword);
if (ts.isTokenKind(node.kind))
return writeTokenNode(node, writePunctuation);
- ts.Debug.fail("Unhandled SyntaxKind: " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
}
function emitMappedTypeParameter(node) {
emit(node.name);
@@ -109768,16 +109769,16 @@ var ts;
}
}
function emitPlaceholder(hint, node, snippet) {
- nonEscapingWrite("${" + snippet.order + ":"); // `${2:`
+ nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
nonEscapingWrite("}"); // `}`
// `${2:...}`
}
function emitTabStop(hint, node, snippet) {
// A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
- ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
- nonEscapingWrite("$" + snippet.order);
+ nonEscapingWrite("$".concat(snippet.order));
}
//
// Identifiers
@@ -111539,17 +111540,17 @@ var ts;
writeLine();
}
if (currentSourceFile && currentSourceFile.moduleName) {
- writeComment("/// ");
+ writeComment("/// "));
writeLine();
}
if (currentSourceFile && currentSourceFile.amdDependencies) {
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
var dep = _b[_a];
if (dep.name) {
- writeComment("/// ");
+ writeComment("/// "));
}
else {
- writeComment("/// ");
+ writeComment("/// "));
}
writeLine();
}
@@ -111557,7 +111558,7 @@ var ts;
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
var directive = files_2[_c];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
writeLine();
@@ -111565,7 +111566,7 @@ var ts;
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
var directive = types_24[_d];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
writeLine();
@@ -111573,7 +111574,7 @@ var ts;
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
var directive = libs_1[_e];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
writeLine();
@@ -112353,9 +112354,9 @@ var ts;
var textSourceNode = node.textSourceNode;
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
- return jsxAttributeEscape ? "\"" + ts.escapeJsxAttributeString(text) + "\"" :
- neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"" + ts.escapeString(text) + "\"" :
- "\"" + ts.escapeNonAsciiString(text) + "\"";
+ return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
+ neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
+ "\"".concat(ts.escapeNonAsciiString(text), "\"");
}
else {
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
@@ -112832,8 +112833,8 @@ var ts;
}
function formatSynthesizedComment(comment) {
return comment.kind === 3 /* MultiLineCommentTrivia */
- ? "/*" + comment.text + "*/"
- : "//" + comment.text;
+ ? "/*".concat(comment.text, "*/")
+ : "//".concat(comment.text);
}
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
enterComment();
@@ -113554,7 +113555,7 @@ var ts;
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;
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
if (!newPath) {
- writeLog("Project: " + configFileName + " Detected ignored path: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
return true;
}
fileOrDirectoryPath = newPath;
@@ -113563,11 +113564,11 @@ var ts;
// If the the added or created file or directory is not supported file name, ignore the file
// But when watched directory is added/removed, we need to reload the file list
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
- writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
return true;
}
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
- writeLog("Project: " + configFileName + " Detected excluded file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
return true;
}
if (!program)
@@ -113591,7 +113592,7 @@ var ts;
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
- writeLog("Project: " + configFileName + " Detected output file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
return true;
}
return false;
@@ -113659,36 +113660,36 @@ var ts;
host.useCaseSensitiveFileNames();
}
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
- log("ExcludeWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
return {
- close: function () { return log("ExcludeWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }
+ close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
};
}
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- log("FileWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
return {
close: function () {
- log("FileWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
watcher.close();
}
};
}
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- var watchInfo = "DirectoryWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
return {
close: function () {
- var watchInfo = "DirectoryWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
watcher.close();
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
}
};
}
@@ -113698,16 +113699,16 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
- var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher") + ":: Triggered with " + args[0] + " " + (args[1] !== undefined ? args[1] : "") + ":: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ 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));
log(triggerredInfo);
var start = ts.timestamp();
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + triggerredInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
}, flags, options, detailInfo1, detailInfo2); };
}
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
- return "WatchInfo: " + file + " " + flags + " " + JSON.stringify(options) + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2);
+ return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
}
}
ts.getWatchFactory = getWatchFactory;
@@ -114014,12 +114015,12 @@ var ts;
}
ts.formatDiagnostics = formatDiagnostics;
function formatDiagnostic(diagnostic, host) {
- var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();
+ var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
if (diagnostic.file) {
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
var fileName = diagnostic.file.fileName;
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
- return relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): " + errorMessage;
+ return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
}
return errorMessage;
}
@@ -114107,9 +114108,9 @@ var ts;
var output = "";
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
output += ":";
- output += color("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
output += ":";
- output += color("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
return output;
}
ts.formatLocation = formatLocation;
@@ -114123,7 +114124,7 @@ var ts;
output += " - ";
}
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
- output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
+ output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
if (diagnostic.file) {
output += host.getNewLine();
@@ -114232,7 +114233,7 @@ var ts;
var result = void 0;
var mode = getModeForResolutionAtIndex(containingFile, i);
i++;
- var cacheKey = mode !== undefined ? mode + "|" + name : name;
+ var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
if (cache.has(cacheKey)) {
result = cache.get(cacheKey);
}
@@ -116421,7 +116422,7 @@ var ts;
path += (i === 2 ? "/" : "-") + components[i];
i++;
}
- var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
+ var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
return localOverrideModuleResult.resolvedModule.resolvedFileName;
@@ -117242,12 +117243,12 @@ var ts;
}
function directoryExistsIfProjectReferenceDeclDir(dir) {
var dirPath = host.toPath(dir);
- var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
+ var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
// Any parent directory of declaration dir
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
// Any directory inside declaration dir
- ts.startsWith(dirPath, declDirPath + "/"); });
+ ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
}
function handleDirectoryCouldBeSymlink(directory) {
var _a;
@@ -117300,7 +117301,7 @@ var ts;
if (isFile && result) {
// Store the real path for the file'
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
- symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), ""));
+ symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
}
return result;
}) || false;
@@ -117758,7 +117759,7 @@ var ts;
/*forceDtsEmit*/ true);
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
if (firstDts_1) {
- 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: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
+ 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; }))); });
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
if (exportedModulesMapCache && latestSignature !== prevSignature) {
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
@@ -118266,7 +118267,7 @@ var ts;
return;
}
else {
- 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: " + affectedFile.fileName);
+ 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));
}
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
@@ -119411,7 +119412,7 @@ var ts;
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
- ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: " + failedLookupLocation + " failedLookupLocationPath: " + failedLookupLocationPath);
+ ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
if (failedLookupPathSplit.length > rootSplitLength + 1) {
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
return {
@@ -120493,7 +120494,7 @@ var ts;
}
function getJSExtensionForFile(fileName, options) {
var _a;
- return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension " + ts.extensionFromPath(fileName) + " is unsupported:: FileName:: " + fileName);
+ return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
}
function tryGetJSExtensionForFile(fileName, options) {
var ext = ts.tryGetExtensionFromPath(fileName);
@@ -120596,8 +120597,8 @@ var ts;
return pretty ?
function (diagnostic, newLine, options) {
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
- var output = "[" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);
+ var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
system.write(output);
} :
function (diagnostic, newLine, options) {
@@ -120605,8 +120606,8 @@ var ts;
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
output += newLine;
}
- output += getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);
+ output += "".concat(getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
system.write(output);
};
}
@@ -120629,7 +120630,7 @@ var ts;
.map(function (errorDiagnostic) {
if (errorDiagnostic.file === undefined)
return;
- return "" + errorDiagnostic.file.fileName;
+ return "".concat(errorDiagnostic.file.fileName);
});
return filesInError.map(function (fileName) {
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
@@ -120662,7 +120663,7 @@ var ts;
if (errorCount === 0)
return "";
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
- var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return "".concat(fileInError.fileName, ":").concat(fileInError.line); })
.filter(function (value, index, self) { return self.indexOf(value) === index; });
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
var d = errorCount === 1 ?
@@ -120675,7 +120676,7 @@ var ts;
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
+ return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix);
}
ts.getErrorSummaryText = getErrorSummaryText;
function createTabularErrorsDisplay(filesInError, host) {
@@ -120698,7 +120699,7 @@ var ts;
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
: "";
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
- tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
+ tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n");
});
return tabularData;
}
@@ -120725,9 +120726,9 @@ var ts;
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
var file = _c[_i];
- write("" + toFileName(file, relativeFileName));
- (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" " + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });
- (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" " + d.messageText); });
+ write("".concat(toFileName(file, relativeFileName)));
+ (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
+ (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
}
}
ts.explainFiles = explainFiles;
@@ -120767,7 +120768,7 @@ var ts;
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
return false;
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
- return !!pattern && ts.getRegexFromPattern("(" + pattern + ")$", useCaseSensitiveFileNames).test(fileName);
+ return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
});
}
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
@@ -120776,7 +120777,7 @@ var ts;
var options = program.getCompilerOptions();
if (ts.isReferencedFile(reason)) {
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
- var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"" + referenceLocation.text + "\"";
+ var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
var message = void 0;
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
switch (reason.kind) {
@@ -120900,7 +120901,7 @@ var ts;
var currentDir_1 = program.getCurrentDirectory();
ts.forEach(emittedFiles, function (file) {
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
- write("TSFILE: " + filepath);
+ write("TSFILE: ".concat(filepath));
});
listFiles(program, write);
}
@@ -121229,7 +121230,7 @@ var ts;
}
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
- writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames);
+ writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
var configFileWatcher;
if (configFileName) {
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
@@ -121385,10 +121386,10 @@ var ts;
function createNewProgram(hasInvalidatedResolution) {
// Compile the program
writeLog("CreatingProgramWith::");
- writeLog(" roots: " + JSON.stringify(rootFileNames));
- writeLog(" options: " + JSON.stringify(compilerOptions));
+ writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
+ writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
if (projectReferences)
- writeLog(" projectReferences: " + JSON.stringify(projectReferences));
+ writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
hasChangedCompilerOptions = false;
hasChangedConfigFileParsingErrors = false;
@@ -121549,7 +121550,7 @@ var ts;
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
}
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
- writeLog("Scheduling invalidateFailedLookup" + (pending ? ", Cancelled earlier one" : ""));
+ writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
}
function invalidateResolutionsOfFailedLookup() {
@@ -121609,7 +121610,7 @@ var ts;
synchronizeProgram();
}
function reloadConfigFile() {
- writeLog("Reloading config file: " + configFileName);
+ writeLog("Reloading config file: ".concat(configFileName));
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
if (cachedDirectoryStructureHost) {
cachedDirectoryStructureHost.clearCache();
@@ -121650,7 +121651,7 @@ var ts;
return config.parsedCommandLine;
}
}
- writeLog("Loading config file: " + configFileName);
+ writeLog("Loading config file: ".concat(configFileName));
var parsedCommandLine = host.getParsedCommandLine ?
host.getParsedCommandLine(configFileName) :
getParsedCommandLineFromConfigFileHost(configFileName);
@@ -121954,8 +121955,8 @@ var ts;
*/
function createBuilderStatusReporter(system, pretty) {
return function (diagnostic) {
- var output = pretty ? "[" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] " : ts.getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);
+ var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
system.write(output);
};
}
@@ -122730,7 +122731,7 @@ var ts;
function listEmittedFile(_a, proj, file) {
var write = _a.write;
if (write && proj.options.listEmittedFiles) {
- write("TSFILE: " + file);
+ write("TSFILE: ".concat(file));
}
}
function getOldProgram(_a, proj, parsed) {
@@ -122759,7 +122760,7 @@ var ts;
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
reportAndStoreErrors(state, resolvedPath, diagnostics);
- state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
+ state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
if (canEmitBuildInfo)
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
afterProgramDone(state, program, config);
@@ -122787,7 +122788,7 @@ var ts;
if (!host.fileExists(inputFile)) {
return {
type: ts.UpToDateStatusType.Unbuildable,
- reason: inputFile + " does not exist"
+ reason: "".concat(inputFile, " does not exist")
};
}
if (!force) {
@@ -123146,7 +123147,7 @@ var ts;
}
}
if (filesToDelete) {
- reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ 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(""));
}
return ts.ExitStatus.Success;
}
@@ -125976,7 +125977,7 @@ var ts;
var prefix = ts.isJSDocLink(link) ? "link"
: ts.isJSDocLinkCode(link) ? "linkcode"
: "linkplain";
- var parts = [linkPart("{@" + prefix + " ")];
+ var parts = [linkPart("{@".concat(prefix, " "))];
if (!link.name) {
if (link.text)
parts.push(linkTextPart(link.text));
@@ -126224,7 +126225,7 @@ var ts;
function getUniqueName(baseName, sourceFile) {
var nameText = baseName;
for (var i = 1; !ts.isFileLevelUniqueName(sourceFile, nameText); i++) {
- nameText = baseName + "_" + i;
+ nameText = "".concat(baseName, "_").concat(i);
}
return nameText;
}
@@ -126334,7 +126335,7 @@ var ts;
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
var quotePreference = getQuotePreference(sourceFile, preferences);
var quoted = JSON.stringify(text);
- return quotePreference === 0 /* Single */ ? "'" + ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"') + "'" : quoted;
+ return quotePreference === 0 /* Single */ ? "'".concat(ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"'), "'") : quoted;
}
ts.quote = quote;
function isEqualityOperatorKind(kind) {
@@ -126718,7 +126719,7 @@ var ts;
var components = ts.getPathComponents(ts.getPackageNameFromTypesPackageName(fullSpecifier)).slice(1);
// Scoped packages
if (ts.startsWith(components[0], "@")) {
- return components[0] + "/" + components[1];
+ return "".concat(components[0], "/").concat(components[1]);
}
return components[0];
}
@@ -126845,13 +126846,13 @@ var ts;
}
function getSymbolParentOrFail(symbol) {
var _a;
- return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: " + ts.Debug.formatSymbolFlags(symbol.flags) + ". " +
- ("Declarations: " + ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
+ return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: ".concat(ts.Debug.formatSymbolFlags(symbol.flags), ". ") +
+ "Declarations: ".concat((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
var kind = ts.Debug.formatSyntaxKind(d.kind);
var inJS = ts.isInJSFile(d);
var expression = d.expression;
- return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: " + ts.Debug.formatSyntaxKind(expression.kind) + ")" : "");
- }).join(", ")) + "."));
+ return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: ".concat(ts.Debug.formatSyntaxKind(expression.kind), ")") : "");
+ }).join(", "), "."));
}
/**
* Useful to check whether a string contains another string at a specific index
@@ -127112,7 +127113,7 @@ var ts;
: checker.tryFindAmbientModule(info.moduleName));
var symbol = info.symbol || cachedSymbol || ts.Debug.checkDefined(exportKind === 2 /* ExportEquals */
? checker.resolveExternalModuleSymbol(moduleSymbol)
- : checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '" + info.symbolName + "' by key '" + info.symbolTableKey + "' in module " + moduleSymbol.name);
+ : checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '".concat(info.symbolName, "' by key '").concat(info.symbolTableKey, "' in module ").concat(moduleSymbol.name));
symbols.set(id, [symbol, moduleSymbol]);
return {
symbol: symbol,
@@ -127125,7 +127126,7 @@ var ts;
}
function key(importedName, symbol, ambientModuleName, checker) {
var moduleKey = ambientModuleName || "";
- return importedName + "|" + ts.getSymbolId(ts.skipAlias(symbol, checker)) + "|" + moduleKey;
+ return "".concat(importedName, "|").concat(ts.getSymbolId(ts.skipAlias(symbol, checker)), "|").concat(moduleKey);
}
function parseKey(key) {
var symbolName = key.substring(0, key.indexOf("|"));
@@ -127211,7 +127212,7 @@ var ts;
if (autoImportProvider) {
var start = ts.timestamp();
forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), function (module, file) { return cb(module, file, autoImportProvider, /*isFromPackageJson*/ true); });
- (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: " + (ts.timestamp() - start));
+ (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: ".concat(ts.timestamp() - start));
}
}
ts.forEachExternalModuleToImportFrom = forEachExternalModuleToImportFrom;
@@ -127264,7 +127265,7 @@ var ts;
}
});
});
- (_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in " + (ts.timestamp() - start) + " ms");
+ (_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in ".concat(ts.timestamp() - start, " ms"));
return cache;
}
ts.getExportInfoMap = getExportInfoMap;
@@ -127797,7 +127798,7 @@ var ts;
return { spans: spans, endOfLineState: 0 /* None */ };
function pushClassification(start, end, type) {
var length = end - start;
- ts.Debug.assert(length > 0, "Classification had non-positive length of " + length);
+ ts.Debug.assert(length > 0, "Classification had non-positive length of ".concat(length));
spans.push(start);
spans.push(length);
spans.push(type);
@@ -128669,7 +128670,7 @@ var ts;
case ".d.cts" /* Dcts */: return ".d.cts" /* dctsModifier */;
case ".cjs" /* Cjs */: return ".cjs" /* cjsModifier */;
case ".cts" /* Cts */: return ".cts" /* ctsModifier */;
- case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension " + ".tsbuildinfo" /* TsBuildInfo */ + " is unsupported.");
+ case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension ".concat(".tsbuildinfo" /* TsBuildInfo */, " is unsupported."));
case undefined: return "" /* none */;
default:
return ts.Debug.assertNever(extension);
@@ -129405,10 +129406,10 @@ var ts;
var resolvedFromCacheCount = 0;
var cacheAttemptCount = 0;
var result = cb({ tryResolve: tryResolve, resolutionLimitExceeded: function () { return resolutionLimitExceeded; } });
- var hitRateMessage = cacheAttemptCount ? " (" + (resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1) + "% hit rate)" : "";
- (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, logPrefix + ": resolved " + resolvedCount + " module specifiers, plus " + ambientCount + " ambient and " + resolvedFromCacheCount + " from cache" + hitRateMessage);
- (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, logPrefix + ": response is " + (resolutionLimitExceeded ? "incomplete" : "complete"));
- (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, logPrefix + ": " + (ts.timestamp() - start));
+ var hitRateMessage = cacheAttemptCount ? " (".concat((resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1), "% hit rate)") : "";
+ (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, "".concat(logPrefix, ": resolved ").concat(resolvedCount, " module specifiers, plus ").concat(ambientCount, " ambient and ").concat(resolvedFromCacheCount, " from cache").concat(hitRateMessage));
+ (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "".concat(logPrefix, ": response is ").concat(resolutionLimitExceeded ? "incomplete" : "complete"));
+ (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, "".concat(logPrefix, ": ").concat(ts.timestamp() - start));
return result;
function tryResolve(exportInfo, isFromAmbientModule) {
if (isFromAmbientModule) {
@@ -129741,15 +129742,15 @@ var ts;
var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess;
if (origin && originIsThisType(origin)) {
insertText = needsConvertPropertyAccess
- ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(sourceFile, preferences, name) + "]"
- : "this" + (insertQuestionDot ? "?." : ".") + name;
+ ? "this".concat(insertQuestionDot ? "?." : "", "[").concat(quotePropertyName(sourceFile, preferences, name), "]")
+ : "this".concat(insertQuestionDot ? "?." : ".").concat(name);
}
// We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790.
// Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro.
else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) {
- insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(sourceFile, preferences, name) + "]" : "[" + name + "]" : name;
+ insertText = useBraces ? needsConvertPropertyAccess ? "[".concat(quotePropertyName(sourceFile, preferences, name), "]") : "[".concat(name, "]") : name;
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
- insertText = "?." + insertText;
+ insertText = "?.".concat(insertText);
}
var dot = ts.findChildOfKind(propertyAccessToConvert, 24 /* DotToken */, sourceFile) ||
ts.findChildOfKind(propertyAccessToConvert, 28 /* QuestionDotToken */, sourceFile);
@@ -129763,7 +129764,7 @@ var ts;
if (isJsxInitializer) {
if (insertText === undefined)
insertText = name;
- insertText = "{" + insertText + "}";
+ insertText = "{".concat(insertText, "}");
if (typeof isJsxInitializer !== "boolean") {
replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile);
}
@@ -129776,8 +129777,8 @@ var ts;
if (precedingToken && ts.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) {
awaitText = ";";
}
- awaitText += "(await " + propertyAccessToConvert.expression.getText() + ")";
- insertText = needsConvertPropertyAccess ? "" + awaitText + insertText : "" + awaitText + (insertQuestionDot ? "?." : ".") + insertText;
+ awaitText += "(await ".concat(propertyAccessToConvert.expression.getText(), ")");
+ insertText = needsConvertPropertyAccess ? "".concat(awaitText).concat(insertText) : "".concat(awaitText).concat(insertQuestionDot ? "?." : ".").concat(insertText);
replacementSpan = ts.createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end);
}
if (originIsResolvedExport(origin)) {
@@ -129810,7 +129811,7 @@ var ts;
&& !(type.flags & 1048576 /* Union */ && ts.find(type.types, function (type) { return !!(type.flags & 528 /* BooleanLike */); }))) {
if (type.flags & 402653316 /* StringLike */ || (type.flags & 1048576 /* Union */ && ts.every(type.types, function (type) { return !!(type.flags & (402653316 /* StringLike */ | 32768 /* Undefined */)); }))) {
// If is string like or undefined use quotes
- insertText = ts.escapeSnippetText(name) + "=" + ts.quote(sourceFile, preferences, "$1");
+ insertText = "".concat(ts.escapeSnippetText(name), "=").concat(ts.quote(sourceFile, preferences, "$1"));
isSnippet = true;
}
else {
@@ -129819,7 +129820,7 @@ var ts;
}
}
if (useBraces_1) {
- insertText = ts.escapeSnippetText(name) + "={$1}";
+ insertText = "".concat(ts.escapeSnippetText(name), "={$1}");
isSnippet = true;
}
}
@@ -130104,14 +130105,14 @@ var ts;
var importKind = ts.codefix.getImportKind(sourceFile, exportKind, options, /*forceImportKeyword*/ true);
var isTopLevelTypeOnly = ((_b = (_a = ts.tryCast(importCompletionNode, ts.isImportDeclaration)) === null || _a === void 0 ? void 0 : _a.importClause) === null || _b === void 0 ? void 0 : _b.isTypeOnly) || ((_c = ts.tryCast(importCompletionNode, ts.isImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.isTypeOnly);
var isImportSpecifierTypeOnly = couldBeTypeOnlyImportSpecifier(importCompletionNode, contextToken);
- var topLevelTypeOnlyText = isTopLevelTypeOnly ? " " + ts.tokenToString(151 /* TypeKeyword */) + " " : " ";
- var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? ts.tokenToString(151 /* TypeKeyword */) + " " : "";
+ var topLevelTypeOnlyText = isTopLevelTypeOnly ? " ".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : " ";
+ var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? "".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : "";
var suffix = useSemicolons ? ";" : "";
switch (importKind) {
- case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " = require(" + quotedModuleSpecifier + ")" + suffix };
- case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " from " + quotedModuleSpecifier + suffix };
- case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "* as " + ts.escapeSnippetText(name) + " from " + quotedModuleSpecifier + suffix };
- case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "{ " + importSpecifierTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " } from " + quotedModuleSpecifier + suffix };
+ case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " = require(").concat(quotedModuleSpecifier, ")").concat(suffix) };
+ case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " from ").concat(quotedModuleSpecifier).concat(suffix) };
+ case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "* as ").concat(ts.escapeSnippetText(name), " from ").concat(quotedModuleSpecifier).concat(suffix) };
+ case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "{ ").concat(importSpecifierTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " } from ").concat(quotedModuleSpecifier).concat(suffix) };
}
}
function quotePropertyName(sourceFile, preferences, name) {
@@ -133073,7 +133074,7 @@ var ts;
}
function getDocumentRegistryEntry(bucketEntry, scriptKind) {
var entry = isDocumentRegistryEntry(bucketEntry) ? bucketEntry : bucketEntry.get(ts.Debug.checkDefined(scriptKind, "If there are more than one scriptKind's for same document the scriptKind should be provided"));
- ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:" + scriptKind + " and sourceFile.scriptKind: " + (entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind) + ", !entry: " + !entry);
+ ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:".concat(scriptKind, " and sourceFile.scriptKind: ").concat(entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind, ", !entry: ").concat(!entry));
return entry;
}
function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
@@ -134102,7 +134103,7 @@ var ts;
sourceFile: def.file,
name: def.reference.fileName,
kind: "string" /* string */,
- displayParts: [ts.displayPart("\"" + def.reference.fileName + "\"", ts.SymbolDisplayPartKind.stringLiteral)]
+ displayParts: [ts.displayPart("\"".concat(def.reference.fileName, "\""), ts.SymbolDisplayPartKind.stringLiteral)]
};
}
default:
@@ -134682,7 +134683,7 @@ var ts;
if (symbol.flags & 33554432 /* Transient */)
return undefined;
// Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here.
- ts.Debug.fail("Unexpected symbol at " + ts.Debug.formatSyntaxKind(node.kind) + ": " + ts.Debug.formatSymbol(symbol));
+ ts.Debug.fail("Unexpected symbol at ".concat(ts.Debug.formatSyntaxKind(node.kind), ": ").concat(ts.Debug.formatSymbol(symbol)));
}
return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent)
? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name)
@@ -135967,8 +135968,8 @@ var ts;
var end = pos + 6; /* "static".length */
var typeChecker = program.getTypeChecker();
var symbol = typeChecker.getSymbolAtLocation(node.parent);
- var prefix = symbol ? typeChecker.symbolToString(symbol, node.parent) + " " : "";
- return { text: prefix + "static {}", pos: pos, end: end };
+ var prefix = symbol ? "".concat(typeChecker.symbolToString(symbol, node.parent), " ") : "";
+ return { text: "".concat(prefix, "static {}"), pos: pos, end: end };
}
var declName = isConstNamedExpression(node) ? node.parent.name :
ts.Debug.checkDefined(ts.getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
@@ -137252,7 +137253,7 @@ var ts;
function getJSDocTagCompletions() {
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) {
return {
- name: "@" + tagName,
+ name: "@".concat(tagName),
kind: "keyword" /* keyword */,
kindModifiers: "",
sortText: ts.Completions.SortText.LocationPriority
@@ -137384,11 +137385,11 @@ var ts;
var name = _a.name, dotDotDotToken = _a.dotDotDotToken;
var paramName = name.kind === 79 /* Identifier */ ? name.text : "param" + i;
var type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : "";
- return indentationStr + " * @param " + type + paramName + newLine;
+ return "".concat(indentationStr, " * @param ").concat(type).concat(paramName).concat(newLine);
}).join("");
}
function returnsDocComment(indentationStr, newLine) {
- return indentationStr + " * @returns" + newLine;
+ return "".concat(indentationStr, " * @returns").concat(newLine);
}
function getCommentOwnerInfo(tokenAtPos, options) {
return ts.forEachAncestor(tokenAtPos, function (n) { return getCommentOwnerInfoWorker(n, options); });
@@ -138231,7 +138232,7 @@ var ts;
}
if (name) {
var text = ts.isIdentifier(name) ? name.text
- : ts.isElementAccessExpression(name) ? "[" + nodeText(name.argumentExpression) + "]"
+ : ts.isElementAccessExpression(name) ? "[".concat(nodeText(name.argumentExpression), "]")
: nodeText(name);
if (text.length > 0) {
return cleanText(text);
@@ -138241,7 +138242,7 @@ var ts;
case 303 /* SourceFile */:
var sourceFile = node;
return ts.isExternalModule(sourceFile)
- ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\""
+ ? "\"".concat(ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))), "\"")
: "";
case 270 /* ExportAssignment */:
return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
@@ -138437,10 +138438,10 @@ var ts;
if (name !== undefined) {
name = cleanText(name);
if (name.length > maxLength) {
- return name + " callback";
+ return "".concat(name, " callback");
}
var args = cleanText(ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined; }).join(", "));
- return name + "(" + args + ") callback";
+ return "".concat(name, "(").concat(args, ") callback");
}
}
return "";
@@ -138453,7 +138454,7 @@ var ts;
else if (ts.isPropertyAccessExpression(expr)) {
var left = getCalledExpressionName(expr.expression);
var right = expr.name.text;
- return left === undefined ? right : left + "." + right;
+ return left === undefined ? right : "".concat(left, ".").concat(right);
}
else {
return undefined;
@@ -140900,7 +140901,7 @@ var ts;
var _loop_9 = function (n) {
// If the node is not a subspan of its parent, this is a big problem.
// There have been crashes that might be caused by this violation.
- ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.formatSyntaxKind(n.kind) + ", parent: " + ts.Debug.formatSyntaxKind(n.parent.kind); });
+ ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: ".concat(ts.Debug.formatSyntaxKind(n.kind), ", parent: ").concat(ts.Debug.formatSyntaxKind(n.parent.kind)); });
var argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n, position, sourceFile, checker);
if (argumentInfo) {
return { value: argumentInfo };
@@ -141072,7 +141073,7 @@ var ts;
(function (InlayHints) {
var maxHintsLength = 30;
var leadingParameterNameCommentRegexFactory = function (name) {
- return new RegExp("^\\s?/\\*\\*?\\s?" + name + "\\s?\\*\\/\\s?$");
+ return new RegExp("^\\s?/\\*\\*?\\s?".concat(name, "\\s?\\*\\/\\s?$"));
};
function shouldShowParameterNameHints(preferences) {
return preferences.includeInlayParameterNameHints === "literals" || preferences.includeInlayParameterNameHints === "all";
@@ -141136,7 +141137,7 @@ var ts;
}
function addParameterHints(text, position, isFirstVariadicArgument) {
result.push({
- text: "" + (isFirstVariadicArgument ? "..." : "") + truncation(text, maxHintsLength) + ":",
+ text: "".concat(isFirstVariadicArgument ? "..." : "").concat(truncation(text, maxHintsLength), ":"),
position: position,
kind: "Parameter" /* Parameter */,
whitespaceAfter: true,
@@ -141144,7 +141145,7 @@ var ts;
}
function addTypeHints(text, position) {
result.push({
- text: ": " + truncation(text, maxHintsLength),
+ text: ": ".concat(truncation(text, maxHintsLength)),
position: position,
kind: "Type" /* Type */,
whitespaceBefore: true,
@@ -141152,7 +141153,7 @@ var ts;
}
function addEnumMemberValueHints(text, position) {
result.push({
- text: "= " + truncation(text, maxHintsLength),
+ text: "= ".concat(truncation(text, maxHintsLength)),
position: position,
kind: "Enum" /* Enum */,
whitespaceBefore: true,
@@ -141687,7 +141688,7 @@ var ts;
}
}
function getKeyFromNode(exp) {
- return exp.pos.toString() + ":" + exp.end.toString();
+ return "".concat(exp.pos.toString(), ":").concat(exp.end.toString());
}
function canBeConvertedToClass(node, checker) {
var _a, _b, _c, _d;
@@ -145836,7 +145837,7 @@ var ts;
var insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition);
var token = ts.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position);
var indent = sourceFile.text.slice(lineStartPosition, startPosition);
- var text = (insertAtLineStart ? "" : this.newLineCharacter) + "//" + commentText + this.newLineCharacter + indent;
+ var text = "".concat(insertAtLineStart ? "" : this.newLineCharacter, "//").concat(commentText).concat(this.newLineCharacter).concat(indent);
this.insertText(sourceFile, token.getStart(sourceFile), text);
};
ChangeTracker.prototype.insertJsdocCommentBefore = function (sourceFile, node, tag) {
@@ -146060,7 +146061,7 @@ var ts;
};
ChangeTracker.prototype.getInsertNodeAfterOptions = function (sourceFile, after) {
var options = this.getInsertNodeAfterOptionsWorker(after);
- return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n" + options.prefix : "\n") : options.prefix });
+ return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n".concat(options.prefix) : "\n") : options.prefix });
};
ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) {
switch (node.kind) {
@@ -146094,7 +146095,7 @@ var ts;
}
else {
// `x => {}` -> `function f(x) {}`
- this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function " + name + "(");
+ this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function ".concat(name, "("));
// Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)`
this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */));
}
@@ -146160,7 +146161,7 @@ var ts;
var nextNode = containingList[index + 1];
var startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart());
// write separator and leading trivia of the next element as suffix
- var suffix = "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, startPos);
+ var suffix = "".concat(ts.tokenToString(nextToken.kind)).concat(sourceFile.text.substring(nextToken.end, startPos));
this.insertNodesAt(sourceFile, startPos, [newNode], { suffix: suffix });
}
}
@@ -146205,7 +146206,7 @@ var ts;
this.replaceRange(sourceFile, ts.createRange(insertPos), newNode, { indentation: indentation, prefix: this.newLineCharacter });
}
else {
- this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + " " });
+ this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: "".concat(ts.tokenToString(separator), " ") });
}
}
};
@@ -146336,7 +146337,7 @@ var ts;
var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); });
var _loop_12 = function (i) {
ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () {
- return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range);
+ return "".concat(JSON.stringify(normalized[i].range), " and ").concat(JSON.stringify(normalized[i + 1].range));
});
};
// verify that change intervals do not overlap, except possibly at end points.
@@ -146427,7 +146428,7 @@ var ts;
function applyChanges(text, changes) {
for (var i = changes.length - 1; i >= 0; i--) {
var _a = changes[i], span = _a.span, newText = _a.newText;
- text = "" + text.substring(0, span.start) + newText + text.substring(ts.textSpanEnd(span));
+ text = "".concat(text.substring(0, span.start)).concat(newText).concat(text.substring(ts.textSpanEnd(span)));
}
return text;
}
@@ -148912,7 +148913,7 @@ var ts;
if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind)
|| checker.resolveName(text, node, 111551 /* Value */, /*excludeGlobals*/ true))) {
// Unconditionally add an underscore in case `text` is a keyword.
- res.set(text, makeUniqueName("_" + text, identifiers));
+ res.set(text, makeUniqueName("_".concat(text), identifiers));
}
});
return res;
@@ -149012,7 +149013,7 @@ var ts;
// `const a = require("b").c` --> `import { c as a } from "./b";
return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]);
default:
- return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form " + name.kind);
+ return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form ".concat(name.kind));
}
}
function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) {
@@ -149063,7 +149064,7 @@ var ts;
case 168 /* MethodDeclaration */:
return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(93 /* ExportKeyword */)], prop, useSitesToUnqualify);
default:
- ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind);
+ ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind ".concat(prop.kind));
}
});
return statements && [statements, false];
@@ -149195,7 +149196,7 @@ var ts;
case 79 /* Identifier */:
return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference);
default:
- return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind " + name.kind);
+ return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind ".concat(name.kind));
}
}
/**
@@ -149252,7 +149253,7 @@ var ts;
// Identifiers helpers
function makeUniqueName(name, identifiers) {
while (identifiers.original.has(name) || identifiers.additional.has(name)) {
- name = "_" + name;
+ name = "_".concat(name);
}
identifiers.additional.add(name);
return name;
@@ -149332,7 +149333,7 @@ var ts;
if (!qualifiedName)
return undefined;
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); });
- var newText = qualifiedName.left.text + "[\"" + qualifiedName.right.text + "\"]";
+ var newText = "".concat(qualifiedName.left.text, "[\"").concat(qualifiedName.right.text, "\"]");
return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, ts.Diagnostics.Rewrite_all_as_indexed_access_types)];
},
fixIds: [fixId],
@@ -149734,7 +149735,7 @@ var ts;
// Excluding from fix-all
break;
default:
- ts.Debug.assertNever(fix, "fix wasn't never - got kind " + fix.kind);
+ ts.Debug.assertNever(fix, "fix wasn't never - got kind ".concat(fix.kind));
}
function reduceAddAsTypeOnlyValues(prevValue, newValue) {
// `NotAllowed` overrides `Required` because one addition of a new import might be required to be type-only
@@ -149778,7 +149779,7 @@ var ts;
return newEntry;
}
function newImportsKey(moduleSpecifier, topLevelTypeOnly) {
- return (topLevelTypeOnly ? 1 : 0) + "|" + moduleSpecifier;
+ return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier);
}
}
function writeFixes(changeTracker) {
@@ -150276,7 +150277,7 @@ var ts;
case ts.ModuleKind.NodeNext:
return importingFile.impliedNodeFormat === ts.ModuleKind.ESNext ? 2 /* Namespace */ : 3 /* CommonJS */;
default:
- return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind " + moduleKind);
+ return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind ".concat(moduleKind));
}
}
function getFixesInfoForNonUMDImport(_a, symbolToken, useAutoImportProvider) {
@@ -150399,7 +150400,7 @@ var ts;
switch (fix.kind) {
case 0 /* UseNamespace */:
addNamespaceQualifier(changes, sourceFile, fix);
- return [ts.Diagnostics.Change_0_to_1, symbolName, fix.namespacePrefix + "." + symbolName];
+ return [ts.Diagnostics.Change_0_to_1, symbolName, "".concat(fix.namespacePrefix, ".").concat(symbolName)];
case 1 /* JsdocTypeImport */:
addImportType(changes, sourceFile, fix, quotePreference);
return [ts.Diagnostics.Change_0_to_1, symbolName, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName];
@@ -150430,7 +150431,7 @@ var ts;
: [ts.Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
}
default:
- return ts.Debug.assertNever(fix, "Unexpected fix kind " + fix.kind);
+ return ts.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind));
}
}
function getModuleSpecifierText(promotedDeclaration) {
@@ -150583,7 +150584,7 @@ var ts;
}
function getImportTypePrefix(moduleSpecifier, quotePreference) {
var quote = ts.getQuoteFromPreference(quotePreference);
- return "import(" + quote + moduleSpecifier + quote + ").";
+ return "import(".concat(quote).concat(moduleSpecifier).concat(quote, ").");
}
function needsTypeOnly(_a) {
var addAsTypeOnly = _a.addAsTypeOnly;
@@ -150679,7 +150680,7 @@ var ts;
lastCharWasValid = isValid;
}
// Need `|| "_"` to ensure result isn't empty.
- return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res;
+ return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_".concat(res);
}
codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier;
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -151935,7 +151936,7 @@ var ts;
break;
}
default:
- ts.Debug.fail("Bad fixId: " + context.fixId);
+ ts.Debug.fail("Bad fixId: ".concat(context.fixId));
}
});
},
@@ -152383,7 +152384,7 @@ var ts;
if (!isValidCharacter(character)) {
return;
}
- var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(sourceFile, preferences, character) + "}";
+ var replacement = useHtmlEntity ? htmlEntity[character] : "{".concat(ts.quote(sourceFile, preferences, character), "}");
changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement);
}
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -152663,11 +152664,11 @@ var ts;
token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name;
}
if (ts.isIdentifier(token) && canPrefix(token)) {
- changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_" + token.text));
+ changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_".concat(token.text)));
if (ts.isParameter(token.parent)) {
ts.getJSDocParameterTags(token.parent).forEach(function (tag) {
if (ts.isIdentifier(tag.name)) {
- changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_" + tag.name.text));
+ changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_".concat(tag.name.text)));
}
});
}
@@ -153009,7 +153010,7 @@ var ts;
}); }
});
function doChange(changes, sourceFile, name) {
- changes.replaceNodeWithText(sourceFile, name, name.text + "()");
+ changes.replaceNodeWithText(sourceFile, name, "".concat(name.text, "()"));
}
function getCallName(sourceFile, start) {
var token = ts.getTokenAtPosition(sourceFile, start);
@@ -154133,7 +154134,7 @@ var ts;
var parameters = [];
var length = Math.max.apply(Math, calls.map(function (c) { return c.argumentTypes.length; }));
var _loop_16 = function (i) {
- var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg" + i));
+ var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg".concat(i)));
symbol.type = combineTypes(calls.map(function (call) { return call.argumentTypes[i] || checker.getUndefinedType(); }));
if (calls.some(function (call) { return call.argumentTypes[i] === undefined; })) {
symbol.flags |= 16777216 /* Optional */;
@@ -154236,7 +154237,7 @@ var ts;
codefix.createCodeFixActionWithoutFixAll(fixName, [codefix.createFileTextChanges(sourceFile.fileName, [
ts.createTextChange(sourceFile.checkJsDirective
? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end)
- : ts.createTextSpan(0, 0), "// @ts-nocheck" + newLineCharacter),
+ : ts.createTextSpan(0, 0), "// @ts-nocheck".concat(newLineCharacter)),
])], ts.Diagnostics.Disable_checking_for_this_file),
];
if (ts.textChanges.isValidLocationToAddComment(sourceFile, span.start)) {
@@ -154502,7 +154503,7 @@ var ts;
var typeParameters = isJs || typeArguments === undefined
? undefined
: ts.map(typeArguments, function (_, i) {
- return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T" + i);
+ return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T".concat(i));
});
var parameters = createDummyParameters(args.length, names, types, /*minArgumentCount*/ undefined, isJs);
var type = isJs || contextualType === undefined
@@ -154537,7 +154538,7 @@ var ts;
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
- /*name*/ names && names[i] || "arg" + i,
+ /*name*/ names && names[i] || "arg".concat(i),
/*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.factory.createToken(57 /* QuestionToken */) : undefined,
/*type*/ inJs ? undefined : types && types[i] || ts.factory.createKeywordTypeNode(130 /* AnyKeyword */),
/*initializer*/ undefined);
@@ -154788,7 +154789,7 @@ var ts;
}
var name = declaration.name.text;
var startWithUnderscore = ts.startsWithUnderscore(name);
- var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file), declaration.name);
+ var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_".concat(name), file), declaration.name);
var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name);
return {
isStatic: ts.hasStaticModifier(declaration),
@@ -155827,7 +155828,7 @@ var ts;
changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text)));
break;
default:
- ts.Debug.fail("Unexpected exportNode kind " + exportNode.kind);
+ ts.Debug.fail("Unexpected exportNode kind ".concat(exportNode.kind));
}
}
}
@@ -155915,7 +155916,7 @@ var ts;
break;
}
default:
- ts.Debug.assertNever(parent, "Unexpected parent kind " + parent.kind);
+ ts.Debug.assertNever(parent, "Unexpected parent kind ".concat(parent.kind));
}
}
function makeImportSpecifier(propertyName, name) {
@@ -156498,7 +156499,7 @@ var ts;
var newComment = ts.displayPartsToString(parameterDocComment);
if (newComment.length) {
ts.setSyntheticLeadingComments(result, [{
- text: "*\n" + newComment.split("\n").map(function (c) { return " * " + c; }).join("\n") + "\n ",
+ text: "*\n".concat(newComment.split("\n").map(function (c) { return " * ".concat(c); }).join("\n"), "\n "),
kind: 3 /* MultiLineCommentTrivia */,
pos: -1,
end: -1,
@@ -156643,7 +156644,7 @@ var ts;
usedFunctionNames.set(description, true);
functionActions.push({
description: description,
- name: "function_scope_" + i,
+ name: "function_scope_".concat(i),
kind: extractFunctionAction.kind
});
}
@@ -156651,7 +156652,7 @@ var ts;
else if (!innermostErrorFunctionAction) {
innermostErrorFunctionAction = {
description: description,
- name: "function_scope_" + i,
+ name: "function_scope_".concat(i),
notApplicableReason: getStringError(functionExtraction.errors),
kind: extractFunctionAction.kind
};
@@ -156667,7 +156668,7 @@ var ts;
usedConstantNames.set(description_1, true);
constantActions.push({
description: description_1,
- name: "constant_scope_" + i,
+ name: "constant_scope_".concat(i),
kind: extractConstantAction.kind
});
}
@@ -156675,7 +156676,7 @@ var ts;
else if (!innermostErrorConstantAction) {
innermostErrorConstantAction = {
description: description,
- name: "constant_scope_" + i,
+ name: "constant_scope_".concat(i),
notApplicableReason: getStringError(constantExtraction.errors),
kind: extractConstantAction.kind
};
@@ -156817,7 +156818,7 @@ var ts;
// cannot find either start or end node
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };
}
- if (ts.isJSDoc(start)) {
+ if (start.flags & 4194304 /* JSDoc */) {
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractJSDoc)] };
}
if (start.parent !== end.parent) {
@@ -157259,28 +157260,28 @@ var ts;
case 212 /* FunctionExpression */:
case 255 /* FunctionDeclaration */:
return scope.name
- ? "function '" + scope.name.text + "'"
+ ? "function '".concat(scope.name.text, "'")
: ts.ANONYMOUS;
case 213 /* ArrowFunction */:
return "arrow function";
case 168 /* MethodDeclaration */:
- return "method '" + scope.name.getText() + "'";
+ return "method '".concat(scope.name.getText(), "'");
case 171 /* GetAccessor */:
- return "'get " + scope.name.getText() + "'";
+ return "'get ".concat(scope.name.getText(), "'");
case 172 /* SetAccessor */:
- return "'set " + scope.name.getText() + "'";
+ return "'set ".concat(scope.name.getText(), "'");
default:
- throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind);
+ throw ts.Debug.assertNever(scope, "Unexpected scope kind ".concat(scope.kind));
}
}
function getDescriptionForClassLikeDeclaration(scope) {
return scope.kind === 256 /* ClassDeclaration */
- ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration"
- : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression";
+ ? scope.name ? "class '".concat(scope.name.text, "'") : "anonymous class declaration"
+ : scope.name ? "class expression '".concat(scope.name.text, "'") : "anonymous class expression";
}
function getDescriptionForModuleLikeDeclaration(scope) {
return scope.kind === 261 /* ModuleBlock */
- ? "namespace '" + scope.parent.name.getText() + "'"
+ ? "namespace '".concat(scope.parent.name.getText(), "'")
: scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */;
}
var SpecialScope;
@@ -158756,7 +158757,7 @@ var ts;
case 253 /* VariableDeclaration */:
return ts.tryCast(node.name, ts.isIdentifier);
default:
- return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
+ return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
}
}
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) {
@@ -158793,7 +158794,7 @@ var ts;
case 253 /* VariableDeclaration */:
return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString));
default:
- return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
+ return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
}
}
function moduleSpecifierFromImport(i) {
@@ -158880,7 +158881,7 @@ var ts;
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
break;
default:
- ts.Debug.assertNever(importDecl, "Unexpected import decl kind " + importDecl.kind);
+ ts.Debug.assertNever(importDecl, "Unexpected import decl kind ".concat(importDecl.kind));
}
}
function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused) {
@@ -158980,7 +158981,7 @@ var ts;
var name = ts.combinePaths(inDirectory, newModuleName + extension);
if (!host.fileExists(name))
return newModuleName; // TODO: GH#18217
- newModuleName = moduleName + "." + i;
+ newModuleName = "".concat(moduleName, ".").concat(i);
}
}
function getNewModuleName(movedSymbols) {
@@ -159087,7 +159088,7 @@ var ts;
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined;
}
default:
- return ts.Debug.assertNever(i, "Unexpected import kind " + i.kind);
+ return ts.Debug.assertNever(i, "Unexpected import kind ".concat(i.kind));
}
}
function filterNamedBindings(namedBindings, keep) {
@@ -159202,7 +159203,7 @@ var ts;
case 200 /* ObjectBindingPattern */:
return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); });
default:
- return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind);
+ return ts.Debug.assertNever(name, "Unexpected name kind ".concat(name.kind));
}
}
function nameOfTopLevelDeclaration(d) {
@@ -159263,7 +159264,7 @@ var ts;
case 237 /* ExpressionStatement */:
return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...`
default:
- return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind);
+ return ts.Debug.assertNever(d, "Unexpected declaration kind ".concat(d.kind));
}
}
function addCommonjsExport(decl) {
@@ -159285,7 +159286,7 @@ var ts;
case 237 /* ExpressionStatement */:
return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...`
default:
- return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind);
+ return ts.Debug.assertNever(decl, "Unexpected decl kind ".concat(decl.kind));
}
}
/** Creates `exports.x = x;` */
@@ -159923,7 +159924,7 @@ var ts;
return [functionDeclaration.name, functionDeclaration.parent.name];
return [functionDeclaration.parent.name];
default:
- return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind " + functionDeclaration.kind);
+ return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind ".concat(functionDeclaration.kind));
}
}
})(convertParamsToDestructuredObject = refactor.convertParamsToDestructuredObject || (refactor.convertParamsToDestructuredObject = {}));
@@ -160627,7 +160628,7 @@ var ts;
var textPos = ts.scanner.getTextPos();
if (textPos <= end) {
if (token === 79 /* Identifier */) {
- ts.Debug.fail("Did not expect " + ts.Debug.formatSyntaxKind(parent.kind) + " to have an Identifier in its trivia");
+ ts.Debug.fail("Did not expect ".concat(ts.Debug.formatSyntaxKind(parent.kind), " to have an Identifier in its trivia"));
}
nodes.push(createNode(token, pos, textPos, parent));
}
@@ -161557,7 +161558,7 @@ var ts;
function getValidSourceFile(fileName) {
var sourceFile = program.getSourceFile(fileName);
if (!sourceFile) {
- var error = new Error("Could not find source file: '" + fileName + "'.");
+ var error = new Error("Could not find source file: '".concat(fileName, "'."));
// We've been having trouble debugging this, so attach sidecar data for the tsserver log.
// See https://github.com/microsoft/TypeScript/issues/30180.
error.ProgramFiles = program.getSourceFiles().map(function (f) { return f.fileName; });
@@ -162233,7 +162234,7 @@ var ts;
var element = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningElement(token.parent) ? token.parent.parent
: ts.isJsxText(token) && ts.isJsxElement(token.parent) ? token.parent : undefined;
if (element && isUnclosedTag(element)) {
- return { newText: "" + element.openingElement.tagName.getText(sourceFile) + ">" };
+ return { newText: "".concat(element.openingElement.tagName.getText(sourceFile), ">") };
}
var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent
: ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined;
@@ -162339,7 +162340,7 @@ var ts;
pos = commentRange.end + 1;
}
else { // If it's not in a comment range, then we need to comment the uncommented portions.
- var newPos = text.substring(pos, textRange.end).search("(" + openMultilineRegex + ")|(" + closeMultilineRegex + ")");
+ var newPos = text.substring(pos, textRange.end).search("(".concat(openMultilineRegex, ")|(").concat(closeMultilineRegex, ")"));
isCommenting = insertComment !== undefined
? insertComment
: isCommenting || !ts.isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); // If isCommenting is already true we don't need to check whitespace again.
@@ -162734,14 +162735,14 @@ var ts;
case ts.LanguageServiceMode.PartialSemantic:
invalidOperationsInPartialSemanticMode.forEach(function (key) {
return ls[key] = function () {
- throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.PartialSemantic");
+ throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.PartialSemantic"));
};
});
break;
case ts.LanguageServiceMode.Syntactic:
invalidOperationsInSyntacticMode.forEach(function (key) {
return ls[key] = function () {
- throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.Syntactic");
+ throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.Syntactic"));
};
});
break;
@@ -163723,13 +163724,13 @@ var ts;
var result = action();
if (logPerformance) {
var end = ts.timestamp();
- logger.log(actionDescription + " completed in " + (end - start) + " msec");
+ logger.log("".concat(actionDescription, " completed in ").concat(end - start, " msec"));
if (ts.isString(result)) {
var str = result;
if (str.length > 128) {
str = str.substring(0, 128) + "...";
}
- logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'");
+ logger.log(" result.length=".concat(str.length, ", result='").concat(JSON.stringify(str), "'"));
}
}
return result;
@@ -163811,7 +163812,7 @@ var ts;
* Update the list of scripts known to the compiler
*/
LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
- this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; } // eslint-disable-line no-null/no-null
+ this.forwardJSONCall("refresh(".concat(throwOnError, ")"), function () { return null; } // eslint-disable-line no-null/no-null
);
};
LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
@@ -163827,43 +163828,43 @@ var ts;
};
LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
+ return this.forwardJSONCall("getSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
};
LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
+ return this.forwardJSONCall("getSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
};
LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")",
+ return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
// directly serialize the spans out to a string. This is much faster to decode
// on the managed side versus a full JSON array.
function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
};
LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")",
+ return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
// directly serialize the spans out to a string. This is much faster to decode
// on the managed side versus a full JSON array.
function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
};
LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () {
+ return this.forwardJSONCall("getSyntacticDiagnostics('".concat(fileName, "')"), function () {
var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
return _this.realizeDiagnostics(diagnostics);
});
};
LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () {
+ return this.forwardJSONCall("getSemanticDiagnostics('".concat(fileName, "')"), function () {
var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
return _this.realizeDiagnostics(diagnostics);
});
};
LanguageServiceShimObject.prototype.getSuggestionDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSuggestionDiagnostics('" + fileName + "')", function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
+ return this.forwardJSONCall("getSuggestionDiagnostics('".concat(fileName, "')"), function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
};
LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
var _this = this;
@@ -163879,7 +163880,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
+ return this.forwardJSONCall("getQuickInfoAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
};
/// NAMEORDOTTEDNAMESPAN
/**
@@ -163888,7 +163889,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
var _this = this;
- return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
+ return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(fileName, "', ").concat(startPos, ", ").concat(endPos, ")"), function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
};
/**
* STATEMENTSPAN
@@ -163896,12 +163897,12 @@ var ts;
*/
LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
+ return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
};
/// SIGNATUREHELP
LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
+ return this.forwardJSONCall("getSignatureHelpItems('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
};
/// GOTO DEFINITION
/**
@@ -163910,7 +163911,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
+ return this.forwardJSONCall("getDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
};
/**
* Computes the definition location and file for the symbol
@@ -163918,7 +163919,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getDefinitionAndBoundSpan = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getDefinitionAndBoundSpan('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
+ return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
};
/// GOTO Type
/**
@@ -163927,7 +163928,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
+ return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
};
/// GOTO Implementation
/**
@@ -163936,37 +163937,37 @@ var ts;
*/
LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
+ return this.forwardJSONCall("getImplementationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position, options); });
+ return this.forwardJSONCall("getRenameInfo('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getRenameInfo(fileName, position, options); });
};
LanguageServiceShimObject.prototype.getSmartSelectionRange = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getSmartSelectionRange('" + fileName + "', " + position + ")", function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
+ return this.forwardJSONCall("getSmartSelectionRange('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
};
LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) {
var _this = this;
- return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ", " + providePrefixAndSuffixTextForRename + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
+ return this.forwardJSONCall("findRenameLocations('".concat(fileName, "', ").concat(position, ", ").concat(findInStrings, ", ").concat(findInComments, ", ").concat(providePrefixAndSuffixTextForRename, ")"), function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
};
/// GET BRACE MATCHING
LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
+ return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
var _this = this;
- return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
+ return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(openingBrace, ")"), function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
};
LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) {
var _this = this;
- return this.forwardJSONCall("getSpanOfEnclosingComment('" + fileName + "', " + position + ")", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
+ return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
};
/// GET SMART INDENT
LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) {
var _this = this;
- return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () {
+ return this.forwardJSONCall("getIndentationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
});
@@ -163974,23 +163975,23 @@ var ts;
/// GET REFERENCES
LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
+ return this.forwardJSONCall("getReferencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); });
+ return this.forwardJSONCall("findReferences('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.findReferences(fileName, position); });
};
LanguageServiceShimObject.prototype.getFileReferences = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getFileReferences('" + fileName + ")", function () { return _this.languageService.getFileReferences(fileName); });
+ return this.forwardJSONCall("getFileReferences('".concat(fileName, ")"), function () { return _this.languageService.getFileReferences(fileName); });
};
LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
+ return this.forwardJSONCall("getOccurrencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
var _this = this;
- return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () {
+ return this.forwardJSONCall("getDocumentHighlights('".concat(fileName, "', ").concat(position, ")"), function () {
var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
// workaround for VS document highlighting issue - keep only items from the initial file
var normalizedName = ts.toFileNameLowerCase(ts.normalizeSlashes(fileName));
@@ -164005,108 +164006,108 @@ var ts;
*/
LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences, formattingSettings) {
var _this = this;
- return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ", " + formattingSettings + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
+ return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ", ").concat(formattingSettings, ")"), function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
};
/** Get a string based representation of a completion list entry details */
LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, formatOptions, source, preferences, data) {
var _this = this;
- return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () {
+ return this.forwardJSONCall("getCompletionEntryDetails('".concat(fileName, "', ").concat(position, ", '").concat(entryName, "')"), function () {
var localOptions = formatOptions === undefined ? undefined : JSON.parse(formatOptions);
return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () {
+ return this.forwardJSONCall("getFormattingEditsForRange('".concat(fileName, "', ").concat(start, ", ").concat(end, ")"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () {
+ return this.forwardJSONCall("getFormattingEditsForDocument('".concat(fileName, "')"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () {
+ return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(fileName, "', ").concat(position, ", '").concat(key, "')"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
});
};
LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
+ return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
};
/// NAVIGATE TO
/** Return a list of symbols that are interesting to navigate to */
LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ", " + fileName + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
+ return this.forwardJSONCall("getNavigateToItems('".concat(searchValue, "', ").concat(maxResultCount, ", ").concat(fileName, ")"), function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
};
LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); });
+ return this.forwardJSONCall("getNavigationBarItems('".concat(fileName, "')"), function () { return _this.languageService.getNavigationBarItems(fileName); });
};
LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
+ return this.forwardJSONCall("getNavigationTree('".concat(fileName, "')"), function () { return _this.languageService.getNavigationTree(fileName); });
};
LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
+ return this.forwardJSONCall("getOutliningSpans('".concat(fileName, "')"), function () { return _this.languageService.getOutliningSpans(fileName); });
};
LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
var _this = this;
- return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
+ return this.forwardJSONCall("getTodoComments('".concat(fileName, "')"), function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
};
/// CALL HIERARCHY
LanguageServiceShimObject.prototype.prepareCallHierarchy = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("prepareCallHierarchy('" + fileName + "', " + position + ")", function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
+ return this.forwardJSONCall("prepareCallHierarchy('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
};
LanguageServiceShimObject.prototype.provideCallHierarchyIncomingCalls = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("provideCallHierarchyIncomingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
+ return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
};
LanguageServiceShimObject.prototype.provideCallHierarchyOutgoingCalls = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
+ return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
};
LanguageServiceShimObject.prototype.provideInlayHints = function (fileName, span, preference) {
var _this = this;
- return this.forwardJSONCall("provideInlayHints('" + fileName + "', '" + JSON.stringify(span) + "', " + JSON.stringify(preference) + ")", function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
+ return this.forwardJSONCall("provideInlayHints('".concat(fileName, "', '").concat(JSON.stringify(span), "', ").concat(JSON.stringify(preference), ")"), function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
};
/// Emit
LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () {
+ return this.forwardJSONCall("getEmitOutput('".concat(fileName, "')"), function () {
var _a = _this.languageService.getEmitOutput(fileName), diagnostics = _a.diagnostics, rest = __rest(_a, ["diagnostics"]);
return __assign(__assign({}, rest), { diagnostics: _this.realizeDiagnostics(diagnostics) });
});
};
LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
var _this = this;
- return forwardCall(this.logger, "getEmitOutput('" + fileName + "')",
+ return forwardCall(this.logger, "getEmitOutput('".concat(fileName, "')"),
/*returnJson*/ false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
};
LanguageServiceShimObject.prototype.toggleLineComment = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("toggleLineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleLineComment(fileName, textRange); });
+ return this.forwardJSONCall("toggleLineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleLineComment(fileName, textRange); });
};
LanguageServiceShimObject.prototype.toggleMultilineComment = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("toggleMultilineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
+ return this.forwardJSONCall("toggleMultilineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
};
LanguageServiceShimObject.prototype.commentSelection = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("commentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.commentSelection(fileName, textRange); });
+ return this.forwardJSONCall("commentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.commentSelection(fileName, textRange); });
};
LanguageServiceShimObject.prototype.uncommentSelection = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("uncommentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.uncommentSelection(fileName, textRange); });
+ return this.forwardJSONCall("uncommentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.uncommentSelection(fileName, textRange); });
};
return LanguageServiceShimObject;
}(ShimBase));
@@ -164156,7 +164157,7 @@ var ts;
};
CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("resolveModuleName('" + fileName + "')", function () {
+ return this.forwardJSONCall("resolveModuleName('".concat(fileName, "')"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;
@@ -164171,7 +164172,7 @@ var ts;
};
CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("resolveTypeReferenceDirective(" + fileName + ")", function () {
+ return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(fileName, ")"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
return {
@@ -164183,7 +164184,7 @@ var ts;
};
CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
var _this = this;
- return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () {
+ return this.forwardJSONCall("getPreProcessedFileInfo('".concat(fileName, "')"), function () {
// for now treat files as JavaScript
var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true);
return {
@@ -164198,7 +164199,7 @@ var ts;
};
CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("getAutomaticTypeDirectiveNames('" + compilerOptionsJson + "')", function () {
+ return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(compilerOptionsJson, "')"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
});
@@ -164220,7 +164221,7 @@ var ts;
};
CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
var _this = this;
- return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () {
+ return this.forwardJSONCall("getTSConfigFileInfo('".concat(fileName, "')"), function () {
var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot));
var normalizedFileName = ts.normalizeSlashes(fileName);
var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName);
@@ -164420,7 +164421,7 @@ var ts;
function nowString() {
// E.g. "12:34:56.789"
var d = new Date();
- return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0");
+ 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"));
}
server.nowString = nowString;
})(server = ts.server || (ts.server = {}));
@@ -164431,7 +164432,7 @@ var ts;
var JsTyping;
(function (JsTyping) {
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
- var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest"));
+ var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
return availableVersion.compareTo(cachedTyping.version) <= 0;
}
JsTyping.isTypingUpToDate = isTypingUpToDate;
@@ -164484,7 +164485,7 @@ var ts;
"worker_threads",
"zlib"
];
- JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:" + name; });
+ JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
function nonRelativeModuleNameForTypingCache(moduleName) {
@@ -164557,7 +164558,7 @@ var ts;
var excludeTypingName = exclude_1[_i];
var didDelete = inferredTypings.delete(excludeTypingName);
if (didDelete && log)
- log("Typing for " + excludeTypingName + " is in exclude list, will be ignored.");
+ log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
}
var newTypingNames = [];
var cachedTypingPaths = [];
@@ -164571,7 +164572,7 @@ var ts;
});
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
if (log)
- log("Result: " + JSON.stringify(result));
+ log("Result: ".concat(JSON.stringify(result)));
return result;
function addInferredTyping(typingName) {
if (!inferredTypings.has(typingName)) {
@@ -164580,7 +164581,7 @@ var ts;
}
function addInferredTypings(typingNames, message) {
if (log)
- log(message + ": " + JSON.stringify(typingNames));
+ log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
ts.forEach(typingNames, addInferredTyping);
}
/**
@@ -164602,7 +164603,7 @@ var ts;
filesToWatch.push(manifestPath);
manifest = ts.readConfigFile(manifestPath, function (path) { return host.readFile(path); }).config;
manifestTypingNames = ts.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts.getOwnKeys);
- addInferredTypings(manifestTypingNames, "Typing names in '" + manifestPath + "' dependencies");
+ addInferredTypings(manifestTypingNames, "Typing names in '".concat(manifestPath, "' dependencies"));
}
// Now we scan the directories for typing information in
// already-installed dependencies (if present). Note that this
@@ -164646,7 +164647,7 @@ var ts;
!isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; // `node_modules/foo`
});
if (log)
- log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(dependencyManifestNames));
+ log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(dependencyManifestNames)));
// Once we have the names of things to look up, we iterate over
// and either collect their included typings, or add them to the
// list of typings we need to look up separately.
@@ -164665,12 +164666,12 @@ var ts;
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
if (host.fileExists(absolutePath)) {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types."));
inferredTypings.set(manifest_1.name, absolutePath);
}
else {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types but they are missing.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types but they are missing."));
}
}
else {
@@ -164766,15 +164767,15 @@ var ts;
var kind = isScopeName ? "Scope" : "Package";
switch (result) {
case 1 /* EmptyName */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot be empty";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
case 2 /* NameTooLong */:
- return "'" + typing + "':: " + kind + " name '" + name + "' should be less than " + maxPackageNameLength + " characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
case 3 /* NameStartsWithDot */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '.'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
case 4 /* NameStartsWithUnderscore */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '_'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
case 5 /* NameContainsNonURISafeCharacters */:
- return "'" + typing + "':: " + kind + " name '" + name + "' contains non URI safe characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
case 0 /* Ok */:
return ts.Debug.fail(); // Shouldn't have called this.
default:
@@ -164827,7 +164828,7 @@ var ts;
}
Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled;
function ThrowProjectDoesNotContainDocument(fileName, project) {
- throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'");
+ throw new Error("Project '".concat(project.getProjectName(), "' does not contain document '").concat(fileName, "'"));
}
Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument;
})(Errors = server.Errors || (server.Errors = {}));
@@ -164868,12 +164869,12 @@ var ts;
}
server.isInferredProjectName = isInferredProjectName;
function makeInferredProjectName(counter) {
- return "/dev/null/inferredProject" + counter + "*";
+ return "/dev/null/inferredProject".concat(counter, "*");
}
server.makeInferredProjectName = makeInferredProjectName;
/*@internal*/
function makeAutoImportProviderProjectName(counter) {
- return "/dev/null/autoImportProviderProject" + counter + "*";
+ return "/dev/null/autoImportProviderProject".concat(counter, "*");
}
server.makeAutoImportProviderProjectName = makeAutoImportProviderProjectName;
function createSortedArray() {
@@ -164908,7 +164909,7 @@ var ts;
// schedule new operation, pass arguments
this.pendingTimeouts.set(operationId, this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb));
if (this.logger) {
- this.logger.info("Scheduled: " + operationId + (pendingTimeout ? ", Cancelled earlier one" : ""));
+ this.logger.info("Scheduled: ".concat(operationId).concat(pendingTimeout ? ", Cancelled earlier one" : ""));
}
};
ThrottledOperations.prototype.cancel = function (operationId) {
@@ -164922,7 +164923,7 @@ var ts;
ts.perfLogger.logStartScheduledOperation(operationId);
self.pendingTimeouts.delete(operationId);
if (self.logger) {
- self.logger.info("Running: " + operationId);
+ self.logger.info("Running: ".concat(operationId));
}
cb();
ts.perfLogger.logStopScheduledOperation();
@@ -164951,7 +164952,7 @@ var ts;
self.host.gc(); // TODO: GH#18217
if (log) {
var after = self.host.getMemoryUsage(); // TODO: GH#18217
- self.logger.perftrc("GC::before " + before + ", after " + after);
+ self.logger.perftrc("GC::before ".concat(before, ", after ").concat(after));
}
ts.perfLogger.logStopScheduledOperation();
};
@@ -165304,8 +165305,8 @@ var ts;
}
TextStorage.prototype.getVersion = function () {
return this.svc
- ? "SVC-" + this.version.svc + "-" + this.svc.getSnapshotVersion()
- : "Text-" + this.version.text;
+ ? "SVC-".concat(this.version.svc, "-").concat(this.svc.getSnapshotVersion())
+ : "Text-".concat(this.version.text);
};
TextStorage.prototype.hasScriptVersionCache_TestOnly = function () {
return this.svc !== undefined;
@@ -165448,7 +165449,7 @@ var ts;
if (fileSize > server.maxFileSize) {
ts.Debug.assert(!!this.info.containingProjects.length);
var service = this.info.containingProjects[0].projectService;
- service.logger.info("Skipped loading contents of large file " + fileName + " for info " + this.info.fileName + ": fileSize: " + fileSize);
+ service.logger.info("Skipped loading contents of large file ".concat(fileName, " for info ").concat(this.info.fileName, ": fileSize: ").concat(fileSize));
this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(fileName, fileSize);
return { text: "", fileSize: fileSize };
}
@@ -165824,14 +165825,14 @@ var ts;
return project;
}
function failIfInvalidPosition(position) {
- ts.Debug.assert(typeof position === "number", "Expected position " + position + " to be a number.");
+ ts.Debug.assert(typeof position === "number", "Expected position ".concat(position, " to be a number."));
ts.Debug.assert(position >= 0, "Expected position to be non-negative.");
}
function failIfInvalidLocation(location) {
- ts.Debug.assert(typeof location.line === "number", "Expected line " + location.line + " to be a number.");
- ts.Debug.assert(typeof location.offset === "number", "Expected offset " + location.offset + " to be a number.");
- ts.Debug.assert(location.line > 0, "Expected line to be non-" + (location.line === 0 ? "zero" : "negative"));
- ts.Debug.assert(location.offset > 0, "Expected offset to be non-" + (location.offset === 0 ? "zero" : "negative"));
+ ts.Debug.assert(typeof location.line === "number", "Expected line ".concat(location.line, " to be a number."));
+ ts.Debug.assert(typeof location.offset === "number", "Expected offset ".concat(location.offset, " to be a number."));
+ ts.Debug.assert(location.line > 0, "Expected line to be non-".concat(location.line === 0 ? "zero" : "negative"));
+ ts.Debug.assert(location.offset > 0, "Expected offset to be non-".concat(location.offset === 0 ? "zero" : "negative"));
}
})(server = ts.server || (ts.server = {}));
})(ts || (ts = {}));
@@ -166143,11 +166144,11 @@ var ts;
};
Project.resolveModule = function (moduleName, initialDir, host, log, logErrors) {
var resolvedPath = ts.normalizeSlashes(host.resolvePath(ts.combinePaths(initialDir, "node_modules")));
- log("Loading " + moduleName + " from " + initialDir + " (resolved to " + resolvedPath + ")");
+ log("Loading ".concat(moduleName, " from ").concat(initialDir, " (resolved to ").concat(resolvedPath, ")"));
var result = host.require(resolvedPath, moduleName); // TODO: GH#18217
if (result.error) {
var err = result.error.stack || result.error.message || JSON.stringify(result.error);
- (logErrors || log)("Failed to load module '" + moduleName + "' from " + resolvedPath + ": " + err);
+ (logErrors || log)("Failed to load module '".concat(moduleName, "' from ").concat(resolvedPath, ": ").concat(err));
return undefined;
}
return result.module;
@@ -166298,12 +166299,12 @@ var ts;
};
/*@internal*/
Project.prototype.clearInvalidateResolutionOfFailedLookupTimer = function () {
- return this.projectService.throttledOperations.cancel(this.getProjectName() + "FailedLookupInvalidation");
+ return this.projectService.throttledOperations.cancel("".concat(this.getProjectName(), "FailedLookupInvalidation"));
};
/*@internal*/
Project.prototype.scheduleInvalidateResolutionsOfFailedLookupLocations = function () {
var _this = this;
- this.projectService.throttledOperations.schedule(this.getProjectName() + "FailedLookupInvalidation", /*delay*/ 1000, function () {
+ this.projectService.throttledOperations.schedule("".concat(this.getProjectName(), "FailedLookupInvalidation"), /*delay*/ 1000, function () {
if (_this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()) {
_this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(_this);
}
@@ -166481,7 +166482,7 @@ var ts;
return plugin.module.getExternalFiles(_this);
}
catch (e) {
- _this.projectService.logger.info("A plugin threw an exception in getExternalFiles: " + e);
+ _this.projectService.logger.info("A plugin threw an exception in getExternalFiles: ".concat(e));
if (e.stack) {
_this.projectService.logger.info(e.stack);
}
@@ -166584,7 +166585,7 @@ var ts;
}
return ts.map(this.program.getSourceFiles(), function (sourceFile) {
var scriptInfo = _this.projectService.getScriptInfoForPath(sourceFile.resolvedPath);
- ts.Debug.assert(!!scriptInfo, "getScriptInfo", function () { return "scriptInfo for a file '" + sourceFile.fileName + "' Path: '" + sourceFile.path + "' / '" + sourceFile.resolvedPath + "' is missing."; });
+ ts.Debug.assert(!!scriptInfo, "getScriptInfo", function () { return "scriptInfo for a file '".concat(sourceFile.fileName, "' Path: '").concat(sourceFile.path, "' / '").concat(sourceFile.resolvedPath, "' is missing."); });
return scriptInfo;
});
};
@@ -166827,7 +166828,7 @@ var ts;
var _this = this;
var oldProgram = this.program;
ts.Debug.assert(!this.isClosed(), "Called update graph worker of closed project");
- this.writeLog("Starting updateGraphWorker: Project: " + this.getProjectName());
+ this.writeLog("Starting updateGraphWorker: Project: ".concat(this.getProjectName()));
var start = ts.timestamp();
this.hasInvalidatedResolution = this.resolutionCache.createHasInvalidatedResolution();
this.resolutionCache.startCachingPerDirectoryResolution();
@@ -166929,7 +166930,7 @@ var ts;
}, function (removed) { return _this.detachScriptInfoFromProject(removed); });
var elapsed = ts.timestamp() - start;
this.sendPerformanceEvent("UpdateGraph", elapsed);
- this.writeLog("Finishing updateGraphWorker: Project: " + this.getProjectName() + " Version: " + this.getProjectVersion() + " structureChanged: " + hasNewProgram + (this.program ? " structureIsReused:: " + ts.StructureIsReused[this.program.structureIsReused] : "") + " Elapsed: " + elapsed + "ms");
+ this.writeLog("Finishing updateGraphWorker: Project: ".concat(this.getProjectName(), " Version: ").concat(this.getProjectVersion(), " structureChanged: ").concat(hasNewProgram).concat(this.program ? " structureIsReused:: ".concat(ts.StructureIsReused[this.program.structureIsReused]) : "", " Elapsed: ").concat(elapsed, "ms"));
if (this.hasAddedorRemovedFiles) {
this.print(/*writeProjectFileNames*/ true);
}
@@ -166989,7 +166990,7 @@ var ts;
var path = this.toPath(sourceFile);
if (this.generatedFilesMap) {
if (isGeneratedFileWatcher(this.generatedFilesMap)) {
- ts.Debug.fail(this.projectName + " Expected to not have --out watcher for generated file with options: " + JSON.stringify(this.compilerOptions));
+ ts.Debug.fail("".concat(this.projectName, " Expected to not have --out watcher for generated file with options: ").concat(JSON.stringify(this.compilerOptions)));
return;
}
if (this.generatedFilesMap.has(path))
@@ -167041,20 +167042,20 @@ var ts;
if (!this.program)
return "\tFiles (0) NoProgram\n";
var sourceFiles = this.program.getSourceFiles();
- var strBuilder = "\tFiles (" + sourceFiles.length + ")\n";
+ var strBuilder = "\tFiles (".concat(sourceFiles.length, ")\n");
if (writeProjectFileNames) {
for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) {
var file = sourceFiles_1[_i];
- strBuilder += "\t" + file.fileName + "\n";
+ strBuilder += "\t".concat(file.fileName, "\n");
}
strBuilder += "\n\n";
- ts.explainFiles(this.program, function (s) { return strBuilder += "\t" + s + "\n"; });
+ ts.explainFiles(this.program, function (s) { return strBuilder += "\t".concat(s, "\n"); });
}
return strBuilder;
};
/*@internal*/
Project.prototype.print = function (writeProjectFileNames) {
- this.writeLog("Project '" + this.projectName + "' (" + ProjectKind[this.projectKind] + ")");
+ this.writeLog("Project '".concat(this.projectName, "' (").concat(ProjectKind[this.projectKind], ")"));
this.writeLog(this.filesToString(writeProjectFileNames && this.projectService.logger.hasLevel(server.LogLevel.verbose)));
this.writeLog("-----------------------------------------------");
if (this.autoImportProviderHost) {
@@ -167216,7 +167217,7 @@ var ts;
if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; }))
return "continue";
// Provide global: true so plugins can detect why they can't find their config
- this_1.projectService.logger.info("Loading global plugin " + globalPluginName);
+ this_1.projectService.logger.info("Loading global plugin ".concat(globalPluginName));
this_1.enablePlugin({ name: globalPluginName, global: true }, searchPaths, pluginConfigOverrides);
};
var this_1 = this;
@@ -167229,9 +167230,9 @@ var ts;
};
Project.prototype.enablePlugin = function (pluginConfigEntry, searchPaths, pluginConfigOverrides) {
var _this = this;
- this.projectService.logger.info("Enabling plugin " + pluginConfigEntry.name + " from candidate paths: " + searchPaths.join(","));
+ this.projectService.logger.info("Enabling plugin ".concat(pluginConfigEntry.name, " from candidate paths: ").concat(searchPaths.join(",")));
if (!pluginConfigEntry.name || ts.parsePackageName(pluginConfigEntry.name).rest) {
- this.projectService.logger.info("Skipped loading plugin " + (pluginConfigEntry.name || JSON.stringify(pluginConfigEntry)) + " because only package name is allowed plugin name");
+ this.projectService.logger.info("Skipped loading plugin ".concat(pluginConfigEntry.name || JSON.stringify(pluginConfigEntry), " because only package name is allowed plugin name"));
return;
}
var log = function (message) { return _this.projectService.logger.info(message); };
@@ -167254,13 +167255,13 @@ var ts;
}
else {
ts.forEach(errorLogs, log);
- this.projectService.logger.info("Couldn't find " + pluginConfigEntry.name);
+ this.projectService.logger.info("Couldn't find ".concat(pluginConfigEntry.name));
}
};
Project.prototype.enableProxy = function (pluginModuleFactory, configEntry) {
try {
if (typeof pluginModuleFactory !== "function") {
- this.projectService.logger.info("Skipped loading plugin " + configEntry.name + " because it did not expose a proper factory function");
+ this.projectService.logger.info("Skipped loading plugin ".concat(configEntry.name, " because it did not expose a proper factory function"));
return;
}
var info = {
@@ -167277,7 +167278,7 @@ var ts;
var k = _a[_i];
// eslint-disable-next-line no-in-operator
if (!(k in newLS)) {
- this.projectService.logger.info("Plugin activation warning: Missing proxied method " + k + " in created LS. Patching.");
+ this.projectService.logger.info("Plugin activation warning: Missing proxied method ".concat(k, " in created LS. Patching."));
newLS[k] = this.languageService[k];
}
}
@@ -167286,7 +167287,7 @@ var ts;
this.plugins.push({ name: configEntry.name, module: pluginModule });
}
catch (e) {
- this.projectService.logger.info("Plugin activation failed: " + e);
+ this.projectService.logger.info("Plugin activation failed: ".concat(e));
}
};
/*@internal*/
@@ -167551,7 +167552,7 @@ var ts;
var name = _d[_c];
// Avoid creating a large project that would significantly slow down time to editor interactivity
if (dependencySelection === 2 /* Auto */ && dependenciesAdded > this.maxDependencies) {
- hostProject.log("AutoImportProviderProject: attempted to add more than " + this.maxDependencies + " dependencies. Aborting.");
+ hostProject.log("AutoImportProviderProject: attempted to add more than ".concat(this.maxDependencies, " dependencies. Aborting."));
return ts.emptyArray;
}
// 1. Try to load from the implementation package. For many dependencies, the
@@ -167568,7 +167569,7 @@ var ts;
}
}
// 2. Try to load from the @types package.
- var typesPackageJson = ts.resolvePackageNameToPackageJson("@types/" + name, hostProject.currentDirectory, compilerOptions, moduleResolutionHost, program.getModuleResolutionCache());
+ var typesPackageJson = ts.resolvePackageNameToPackageJson("@types/".concat(name), hostProject.currentDirectory, compilerOptions, moduleResolutionHost, program.getModuleResolutionCache());
if (typesPackageJson) {
var entrypoints = getRootNamesFromPackageJson(typesPackageJson, program, symlinkCache);
rootNames = ts.concatenate(rootNames, entrypoints);
@@ -167586,7 +167587,7 @@ var ts;
}
}
if (rootNames === null || rootNames === void 0 ? void 0 : rootNames.length) {
- hostProject.log("AutoImportProviderProject: found " + rootNames.length + " root files in " + dependenciesAdded + " dependencies in " + (ts.timestamp() - start) + " ms");
+ hostProject.log("AutoImportProviderProject: found ".concat(rootNames.length, " root files in ").concat(dependenciesAdded, " dependencies in ").concat(ts.timestamp() - start, " ms"));
}
return rootNames || ts.emptyArray;
function addDependency(dependency) {
@@ -167843,7 +167844,7 @@ var ts;
var searchPaths = __spreadArray([ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")], this.projectService.pluginProbeLocations, true);
if (this.projectService.allowLocalPluginLoads) {
var local = ts.getDirectoryPath(this.canonicalConfigFilePath);
- this.projectService.logger.info("Local plugin loading enabled; adding " + local + " to search paths");
+ this.projectService.logger.info("Local plugin loading enabled; adding ".concat(local, " to search paths"));
searchPaths.unshift(local);
}
// Enable tsconfig-specified plugins
@@ -168269,7 +168270,7 @@ var ts;
return forEachAnyProjectReferenceKind(project, function (resolvedRef) { return callbackRefProject(project, cb, resolvedRef.sourceFile.path); }, function (projectRef) { return callbackRefProject(project, cb, project.toPath(ts.resolveProjectReferencePath(projectRef))); }, function (potentialProjectRef) { return callbackRefProject(project, cb, potentialProjectRef); });
}
function getDetailWatchInfo(watchType, project) {
- return (ts.isString(project) ? "Config: " + project + " " : project ? "Project: " + project.getProjectName() + " " : "") + "WatchType: " + watchType;
+ return "".concat(ts.isString(project) ? "Config: ".concat(project, " ") : project ? "Project: ".concat(project.getProjectName(), " ") : "", "WatchType: ").concat(watchType);
}
function isScriptInfoWatchedFromNodeModules(info) {
return !info.isScriptOpen() && info.mTime !== undefined;
@@ -168474,7 +168475,7 @@ var ts;
try {
var fileContent = this.host.readFile(this.typesMapLocation); // TODO: GH#18217
if (fileContent === undefined) {
- this.logger.info("Provided types map file \"" + this.typesMapLocation + "\" doesn't exist");
+ this.logger.info("Provided types map file \"".concat(this.typesMapLocation, "\" doesn't exist"));
return;
}
var raw = JSON.parse(fileContent);
@@ -168492,7 +168493,7 @@ var ts;
}
}
catch (e) {
- this.logger.info("Error loading types map: " + e);
+ this.logger.info("Error loading types map: ".concat(e));
this.safelist = defaultTypeSafeList;
this.legacySafelist.clear();
}
@@ -168814,7 +168815,7 @@ var ts;
var fsResult = config.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
if (ts.getBaseFileName(fileOrDirectoryPath) === "package.json" && !ts.isInsideNodeModules(fileOrDirectoryPath) &&
(fsResult && fsResult.fileExists || !fsResult && _this.host.fileExists(fileOrDirectoryPath))) {
- _this.logger.info("Config: " + configFileName + " Detected new package.json: " + fileOrDirectory);
+ _this.logger.info("Config: ".concat(configFileName, " Detected new package.json: ").concat(fileOrDirectory));
_this.onAddPackageJson(fileOrDirectoryPath);
}
var configuredProjectForConfig = _this.findConfiguredProjectByProjectName(configFileName);
@@ -168937,13 +168938,13 @@ var ts;
project.print(/*writeProjectFileNames*/ true);
project.close();
if (ts.Debug.shouldAssert(1 /* Normal */)) {
- this.filenameToScriptInfo.forEach(function (info) { return ts.Debug.assert(!info.isAttached(project), "Found script Info still attached to project", function () { return project.projectName + ": ScriptInfos still attached: " + JSON.stringify(ts.arrayFrom(ts.mapDefinedIterator(_this.filenameToScriptInfo.values(), function (info) { return info.isAttached(project) ?
+ this.filenameToScriptInfo.forEach(function (info) { return ts.Debug.assert(!info.isAttached(project), "Found script Info still attached to project", function () { return "".concat(project.projectName, ": ScriptInfos still attached: ").concat(JSON.stringify(ts.arrayFrom(ts.mapDefinedIterator(_this.filenameToScriptInfo.values(), function (info) { return info.isAttached(project) ?
{
fileName: info.fileName,
projects: info.containingProjects.map(function (p) { return p.projectName; }),
hasMixedContent: info.hasMixedContent
} : undefined; })),
- /*replacer*/ undefined, " "); }); });
+ /*replacer*/ undefined, " ")); }); });
}
// Remove the project from pending project updates
this.pendingProjectUpdates.delete(project.getProjectName());
@@ -169344,15 +169345,15 @@ var ts;
if (result !== undefined)
return result || undefined;
}
- this.logger.info("Search path: " + ts.getDirectoryPath(info.fileName));
+ this.logger.info("Search path: ".concat(ts.getDirectoryPath(info.fileName)));
var configFileName = this.forEachConfigFileLocation(info, function (canonicalConfigFilePath, configFileName) {
return _this.configFileExists(configFileName, canonicalConfigFilePath, info);
});
if (configFileName) {
- this.logger.info("For info: " + info.fileName + " :: Config file name: " + configFileName);
+ this.logger.info("For info: ".concat(info.fileName, " :: Config file name: ").concat(configFileName));
}
else {
- this.logger.info("For info: " + info.fileName + " :: No config files found.");
+ this.logger.info("For info: ".concat(info.fileName, " :: No config files found."));
}
if (isOpenScriptInfo(info)) {
this.configFileForOpenFiles.set(info.path, configFileName || false);
@@ -169371,8 +169372,8 @@ var ts;
this.logger.info("Open files: ");
this.openFiles.forEach(function (projectRootPath, path) {
var info = _this.getScriptInfoForPath(path);
- _this.logger.info("\tFileName: " + info.fileName + " ProjectRootPath: " + projectRootPath);
- _this.logger.info("\t\tProjects: " + info.containingProjects.map(function (p) { return p.getProjectName(); }));
+ _this.logger.info("\tFileName: ".concat(info.fileName, " ProjectRootPath: ").concat(projectRootPath));
+ _this.logger.info("\t\tProjects: ".concat(info.containingProjects.map(function (p) { return p.getProjectName(); })));
});
this.logger.endGroup();
};
@@ -169411,7 +169412,7 @@ var ts;
.map(function (name) { return ({ name: name, size: _this.host.getFileSize(name) }); })
.sort(function (a, b) { return b.size - a.size; })
.slice(0, 5);
- this.logger.info("Non TS file size exceeded limit (" + totalNonTsFileSize + "). Largest files: " + top5LargestFiles.map(function (file) { return file.name + ":" + file.size; }).join(", "));
+ this.logger.info("Non TS file size exceeded limit (".concat(totalNonTsFileSize, "). Largest files: ").concat(top5LargestFiles.map(function (file) { return "".concat(file.name, ":").concat(file.size); }).join(", ")));
// Keep the size as zero since it's disabled
return fileName;
}
@@ -169480,7 +169481,7 @@ var ts;
};
/* @internal */
ProjectService.prototype.createConfiguredProject = function (configFileName) {
- this.logger.info("Creating configuration project " + configFileName);
+ this.logger.info("Creating configuration project ".concat(configFileName));
var canonicalConfigFilePath = server.asNormalizedPath(this.toCanonicalFileName(configFileName));
var configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
// We could be in this scenario if project is the configured project tracked by external project
@@ -169591,12 +169592,12 @@ var ts;
if (parsedCommandLine.errors.length) {
configFileErrors.push.apply(configFileErrors, parsedCommandLine.errors);
}
- this.logger.info("Config: " + configFilename + " : " + JSON.stringify({
+ this.logger.info("Config: ".concat(configFilename, " : ").concat(JSON.stringify({
rootNames: parsedCommandLine.fileNames,
options: parsedCommandLine.options,
watchOptions: parsedCommandLine.watchOptions,
projectReferences: parsedCommandLine.projectReferences
- }, /*replacer*/ undefined, " "));
+ }, /*replacer*/ undefined, " ")));
var oldCommandLine = (_b = configFileExistenceInfo.config) === null || _b === void 0 ? void 0 : _b.parsedCommandLine;
if (!configFileExistenceInfo.config) {
configFileExistenceInfo.config = { parsedCommandLine: parsedCommandLine, cachedDirectoryStructureHost: cachedDirectoryStructureHost, projects: new ts.Map() };
@@ -169626,7 +169627,7 @@ var ts;
// Update projects
var ensureProjectsForOpenFiles = false;
(_a = _this.sharedExtendedConfigFileWatchers.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (canonicalPath) {
- ensureProjectsForOpenFiles = _this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalPath, "Change in extended config file " + extendedConfigFileName + " detected") || ensureProjectsForOpenFiles;
+ ensureProjectsForOpenFiles = _this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalPath, "Change in extended config file ".concat(extendedConfigFileName, " detected")) || ensureProjectsForOpenFiles;
});
if (ensureProjectsForOpenFiles)
_this.delayEnsureProjectForOpenFiles();
@@ -169782,7 +169783,7 @@ var ts;
// Clear the cache since we are reloading the project from disk
host.clearCache();
var configFileName = project.getConfigFilePath();
- this.logger.info((isInitialLoad ? "Loading" : "Reloading") + " configured project " + configFileName);
+ this.logger.info("".concat(isInitialLoad ? "Loading" : "Reloading", " configured project ").concat(configFileName));
// Load project from the disk
this.loadConfiguredProject(project, reason);
project.updateGraph();
@@ -169921,7 +169922,7 @@ var ts;
var path = _a[0], scriptInfo = _a[1];
return ({ path: path, fileName: scriptInfo.fileName });
});
- this.logger.msg("Could not find file " + JSON.stringify(fileName) + ".\nAll files are: " + JSON.stringify(names), server.Msg.Err);
+ this.logger.msg("Could not find file ".concat(JSON.stringify(fileName), ".\nAll files are: ").concat(JSON.stringify(names)), server.Msg.Err);
};
/**
* Returns the projects that contain script info through SymLink
@@ -170105,9 +170106,9 @@ var ts;
var info = this.getScriptInfoForPath(path);
if (!info) {
var isDynamic = server.isDynamicFileName(fileName);
- ts.Debug.assert(ts.isRootedDiskPath(fileName) || isDynamic || openedByClient, "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nScript info with non-dynamic relative file name can only be open script info or in context of host currentDirectory"; });
- ts.Debug.assert(!ts.isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nOpen script files with non rooted disk path opened with current directory context cannot have same canonical names"; });
- ts.Debug.assert(!isDynamic || this.currentDirectory === currentDirectory || this.useInferredProjectPerProjectRoot, "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nDynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath."; });
+ ts.Debug.assert(ts.isRootedDiskPath(fileName) || isDynamic || openedByClient, "", function () { return "".concat(JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }), "\nScript info with non-dynamic relative file name can only be open script info or in context of host currentDirectory"); });
+ ts.Debug.assert(!ts.isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "", function () { return "".concat(JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }), "\nOpen script files with non rooted disk path opened with current directory context cannot have same canonical names"); });
+ ts.Debug.assert(!isDynamic || this.currentDirectory === currentDirectory || this.useInferredProjectPerProjectRoot, "", function () { return "".concat(JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }), "\nDynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath."); });
// If the file is not opened by client and the file doesnot exist on the disk, return
if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) {
return;
@@ -170286,13 +170287,13 @@ var ts;
var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(args.file));
if (info) {
info.setOptions(convertFormatOptions(args.formatOptions), args.preferences);
- this.logger.info("Host configuration update for file " + args.file);
+ this.logger.info("Host configuration update for file ".concat(args.file));
}
}
else {
if (args.hostInfo !== undefined) {
this.hostConfiguration.hostInfo = args.hostInfo;
- this.logger.info("Host information " + args.hostInfo);
+ this.logger.info("Host information ".concat(args.hostInfo));
}
if (args.formatOptions) {
this.hostConfiguration.formatCodeOptions = __assign(__assign({}, this.hostConfiguration.formatCodeOptions), convertFormatOptions(args.formatOptions));
@@ -170324,7 +170325,7 @@ var ts;
}
if (args.watchOptions) {
this.hostConfiguration.watchOptions = (_a = convertWatchOptions(args.watchOptions)) === null || _a === void 0 ? void 0 : _a.watchOptions;
- this.logger.info("Host watch options changed to " + JSON.stringify(this.hostConfiguration.watchOptions) + ", it will be take effect for next watches.");
+ this.logger.info("Host watch options changed to ".concat(JSON.stringify(this.hostConfiguration.watchOptions), ", it will be take effect for next watches."));
}
}
};
@@ -170536,7 +170537,7 @@ var ts;
? originalLocation
: location;
}
- configuredProject = this.createAndLoadConfiguredProject(configFileName, "Creating project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : ""));
+ configuredProject = this.createAndLoadConfiguredProject(configFileName, "Creating project for original file: ".concat(originalFileInfo.fileName).concat(location !== originalLocation ? " for location: " + location.fileName : ""));
}
updateProjectIfDirty(configuredProject);
var projectContainsOriginalInfo = function (project) {
@@ -170548,7 +170549,7 @@ var ts;
configuredProject = forEachResolvedProjectReferenceProject(configuredProject, fileName, function (child) {
updateProjectIfDirty(child);
return projectContainsOriginalInfo(child) ? child : undefined;
- }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + configuredProject.projectName + " to find possible configured project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : ""));
+ }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution ".concat(configuredProject.projectName, " to find possible configured project for original file: ").concat(originalFileInfo.fileName).concat(location !== originalLocation ? " for location: " + location.fileName : ""));
if (!configuredProject)
return undefined;
if (configuredProject === project)
@@ -170602,7 +170603,7 @@ var ts;
if (configFileName) {
project = this.findConfiguredProjectByProjectName(configFileName);
if (!project) {
- project = this.createLoadAndUpdateConfiguredProject(configFileName, "Creating possible configured project for " + info.fileName + " to open");
+ project = this.createLoadAndUpdateConfiguredProject(configFileName, "Creating possible configured project for ".concat(info.fileName, " to open"));
defaultConfigProjectIsCreated = true;
}
else {
@@ -170632,7 +170633,7 @@ var ts;
if (!projectForConfigFileDiag && child.containsScriptInfo(info)) {
projectForConfigFileDiag = child;
}
- }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + project.projectName + " to find possible configured project for " + info.fileName + " to open");
+ }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution ".concat(project.projectName, " to find possible configured project for ").concat(info.fileName, " to open"));
}
// Send the event only if the project got created as part of this open request and info is part of the project
if (projectForConfigFileDiag) {
@@ -170694,7 +170695,7 @@ var ts;
return;
// find or delay load the project
var ancestor = this.findConfiguredProjectByProjectName(configFileName) ||
- this.createConfiguredProjectWithDelayLoad(configFileName, "Creating project possibly referencing default composite project " + project.getProjectName() + " of open file " + info.fileName);
+ this.createConfiguredProjectWithDelayLoad(configFileName, "Creating project possibly referencing default composite project ".concat(project.getProjectName(), " of open file ").concat(info.fileName));
if (ancestor.isInitialLoadPending()) {
// Set a potential project reference
ancestor.setPotentialProjectReference(project.canonicalConfigFilePath);
@@ -170737,7 +170738,7 @@ var ts;
// Load this project,
var configFileName = server.toNormalizedPath(child.sourceFile.fileName);
var childProject = project.projectService.findConfiguredProjectByProjectName(configFileName) ||
- project.projectService.createAndLoadConfiguredProject(configFileName, "Creating project referenced by : " + project.projectName + " as it references project " + referencedProject.sourceFile.fileName);
+ project.projectService.createAndLoadConfiguredProject(configFileName, "Creating project referenced by : ".concat(project.projectName, " as it references project ").concat(referencedProject.sourceFile.fileName));
updateProjectIfDirty(childProject);
// Ensure children for this project
this.ensureProjectChildren(childProject, forProjects, seenProjects);
@@ -171038,7 +171039,7 @@ var ts;
for (var _b = 0, normalizedNames_1 = normalizedNames; _b < normalizedNames_1.length; _b++) {
var root = normalizedNames_1[_b];
if (rule.match.test(root)) {
- this_2.logger.info("Excluding files based on rule " + name + " matching file '" + root + "'");
+ this_2.logger.info("Excluding files based on rule ".concat(name, " matching file '").concat(root, "'"));
// If the file matches, collect its types packages and exclude rules
if (rule.types) {
for (var _c = 0, _d = rule.types; _c < _d.length; _c++) {
@@ -171063,7 +171064,7 @@ var ts;
if (typeof groupNumberOrString === "number") {
if (!ts.isString(groups[groupNumberOrString])) {
// Specification was wrong - exclude nothing!
- _this.logger.info("Incorrect RegExp specification in safelist rule " + name + " - not enough groups");
+ _this.logger.info("Incorrect RegExp specification in safelist rule ".concat(name, " - not enough groups"));
// * can't appear in a filename; escape it because it's feeding into a RegExp
return "\\*";
}
@@ -171111,7 +171112,7 @@ var ts;
var cleanedTypingName = ts.removeMinAndVersionNumbers(inferredTypingName);
var typeName = this_3.legacySafelist.get(cleanedTypingName);
if (typeName !== undefined) {
- this_3.logger.info("Excluded '" + normalizedNames[i] + "' because it matched " + cleanedTypingName + " from the legacy safelist");
+ this_3.logger.info("Excluded '".concat(normalizedNames[i], "' because it matched ").concat(cleanedTypingName, " from the legacy safelist"));
excludedFiles.push(normalizedNames[i]);
// *exclude* it from the project...
exclude = true;
@@ -171241,8 +171242,8 @@ var ts;
if (!project) {
// errors are stored in the project, do not need to update the graph
project = this.getHostPreferences().lazyConfiguredProjectsFromExternalProject ?
- this.createConfiguredProjectWithDelayLoad(tsconfigFile, "Creating configured project in external project: " + proj.projectFileName) :
- this.createLoadAndUpdateConfiguredProject(tsconfigFile, "Creating configured project in external project: " + proj.projectFileName);
+ this.createConfiguredProjectWithDelayLoad(tsconfigFile, "Creating configured project in external project: ".concat(proj.projectFileName)) :
+ this.createLoadAndUpdateConfiguredProject(tsconfigFile, "Creating configured project in external project: ".concat(proj.projectFileName));
}
if (project && !ts.contains(exisingConfigFiles, tsconfigFile)) {
// keep project alive even if no documents are opened - its lifetime is bound to the lifetime of containing external project
@@ -171480,7 +171481,7 @@ var ts;
return cache || (cache = new ts.Map());
}
function key(fromFileName, preferences) {
- return fromFileName + "," + preferences.importModuleSpecifierEnding + "," + preferences.importModuleSpecifierPreference;
+ return "".concat(fromFileName, ",").concat(preferences.importModuleSpecifierEnding, ",").concat(preferences.importModuleSpecifierPreference);
}
function createInfo(modulePaths, moduleSpecifiers, isAutoImportable) {
return { modulePaths: modulePaths, moduleSpecifiers: moduleSpecifiers, isAutoImportable: isAutoImportable };
@@ -171639,10 +171640,10 @@ var ts;
var verboseLogging = logger.hasLevel(server.LogLevel.verbose);
var json = JSON.stringify(msg);
if (verboseLogging) {
- logger.info(msg.type + ":" + server.indent(json));
+ logger.info("".concat(msg.type, ":").concat(server.indent(json)));
}
var len = byteLength(json, "utf8");
- return "Content-Length: " + (1 + len) + "\r\n\r\n" + json + newLine;
+ return "Content-Length: ".concat(1 + len, "\r\n\r\n").concat(json).concat(newLine);
}
server.formatMessage = formatMessage;
/**
@@ -171707,7 +171708,7 @@ var ts;
}
else {
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("session" /* Session */, "stepError", { seq: this.requestId, message: e.message });
- this.operationHost.logError(e, "delayed processing of request " + this.requestId);
+ this.operationHost.logError(e, "delayed processing of request ".concat(this.requestId));
}
}
if (stop || !this.hasPendingWork()) {
@@ -171808,7 +171809,7 @@ var ts;
function combineProjectOutputForReferences(projects, defaultProject, initialLocation, logger) {
var outputs = [];
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, getMappedLocation) {
- logger.info("Finding references to " + location.fileName + " position " + location.pos + " in project " + project.getProjectName());
+ logger.info("Finding references to ".concat(location.fileName, " position ").concat(location.pos, " in project ").concat(project.getProjectName()));
var _loop_8 = function (outputReferencedSymbol) {
var mappedDefinitionFile = getMappedLocation(project, documentSpanLocation(outputReferencedSymbol.definition));
var definition = mappedDefinitionFile === undefined ?
@@ -172493,14 +172494,14 @@ var ts;
case ts.LanguageServiceMode.PartialSemantic:
invalidPartialSemanticModeCommands.forEach(function (commandName) {
return _this.handlers.set(commandName, function (request) {
- throw new Error("Request: " + request.command + " not allowed in LanguageServiceMode.PartialSemantic");
+ throw new Error("Request: ".concat(request.command, " not allowed in LanguageServiceMode.PartialSemantic"));
});
});
break;
case ts.LanguageServiceMode.Syntactic:
invalidSyntacticModeCommands.forEach(function (commandName) {
return _this.handlers.set(commandName, function (request) {
- throw new Error("Request: " + request.command + " not allowed in LanguageServiceMode.Syntactic");
+ throw new Error("Request: ".concat(request.command, " not allowed in LanguageServiceMode.Syntactic"));
});
});
break;
@@ -172575,7 +172576,7 @@ var ts;
};
Session.prototype.projectsUpdatedInBackgroundEvent = function (openFiles) {
var _this = this;
- this.projectService.logger.info("got projects updated in background, updating diagnostics for " + openFiles);
+ this.projectService.logger.info("got projects updated in background, updating diagnostics for ".concat(openFiles));
if (openFiles.length) {
if (!this.suppressDiagnosticEvents && !this.noGetErrOnBackgroundUpdate) {
// For now only queue error checking for open files. We can change this to include non open files as well
@@ -172605,17 +172606,17 @@ var ts;
var scriptInfo = project.getScriptInfoForNormalizedPath(file);
if (scriptInfo) {
var text = ts.getSnapshotText(scriptInfo.getSnapshot());
- msg += "\n\nFile text of " + fileRequest.file + ":" + server.indent(text) + "\n";
+ msg += "\n\nFile text of ".concat(fileRequest.file, ":").concat(server.indent(text), "\n");
}
}
catch (_b) { } // eslint-disable-line no-empty
}
if (err.ProgramFiles) {
- msg += "\n\nProgram files: " + JSON.stringify(err.ProgramFiles) + "\n";
+ msg += "\n\nProgram files: ".concat(JSON.stringify(err.ProgramFiles), "\n");
msg += "\n\nProjects::\n";
var counter_1 = 0;
var addProjectInfo = function (project) {
- msg += "\nProject '" + project.projectName + "' (" + server.ProjectKind[project.projectKind] + ") " + counter_1 + "\n";
+ msg += "\nProject '".concat(project.projectName, "' (").concat(server.ProjectKind[project.projectKind], ") ").concat(counter_1, "\n");
msg += project.filesToString(/*writeProjectFileNames*/ true);
msg += "\n-----------------------------------------------\n";
counter_1++;
@@ -172630,7 +172631,7 @@ var ts;
Session.prototype.send = function (msg) {
if (msg.type === "event" && !this.canUseEvents) {
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("Session does not support events: ignored event: " + JSON.stringify(msg));
+ this.logger.info("Session does not support events: ignored event: ".concat(JSON.stringify(msg)));
}
return;
}
@@ -172638,7 +172639,7 @@ var ts;
};
Session.prototype.writeMessage = function (msg) {
var msgText = formatMessage(msg, this.logger, this.byteLength, this.host.newLine);
- ts.perfLogger.logEvent("Response message size: " + msgText.length);
+ ts.perfLogger.logEvent("Response message size: ".concat(msgText.length));
this.host.write(msgText);
};
Session.prototype.event = function (body, eventName) {
@@ -172776,7 +172777,7 @@ var ts;
if (!projects) {
return;
}
- this.logger.info("cleaning " + caption);
+ this.logger.info("cleaning ".concat(caption));
for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) {
var p = projects_4[_i];
p.getLanguageService(/*ensureSynchronized*/ false).cleanupSemanticCache();
@@ -173190,7 +173191,7 @@ var ts;
var refs = references.map(function (entry) { return referenceEntryToReferencesResponseItem(_this.projectService, entry); });
return {
refs: refs,
- symbolName: "\"" + args.file + "\""
+ symbolName: "\"".concat(args.file, "\"")
};
};
/**
@@ -173734,7 +173735,7 @@ var ts;
});
var badCode = args.errorCodes.find(function (c) { return !existingDiagCodes_1.includes(c); });
if (badCode !== undefined) {
- e.message = "BADCLIENT: Bad error code, " + badCode + " not found in range " + startPosition + ".." + endPosition + " (found: " + existingDiagCodes_1.join(", ") + "); could have caused this error:\n" + e.message;
+ e.message = "BADCLIENT: Bad error code, ".concat(badCode, " not found in range ").concat(startPosition, "..").concat(endPosition, " (found: ").concat(existingDiagCodes_1.join(", "), "); could have caused this error:\n").concat(e.message);
}
throw e;
}
@@ -174011,7 +174012,7 @@ var ts;
};
Session.prototype.addProtocolHandler = function (command, handler) {
if (this.handlers.has(command)) {
- throw new Error("Protocol handler already exists for command \"" + command + "\"");
+ throw new Error("Protocol handler already exists for command \"".concat(command, "\""));
}
this.handlers.set(command, handler);
};
@@ -174040,8 +174041,8 @@ var ts;
return this.executeWithRequestId(request.seq, function () { return handler(request); });
}
else {
- this.logger.msg("Unrecognized JSON command:" + server.stringifyIndented(request), server.Msg.Err);
- this.doOutput(/*info*/ undefined, server.CommandNames.Unknown, request.seq, /*success*/ false, "Unrecognized JSON command: " + request.command);
+ this.logger.msg("Unrecognized JSON command:".concat(server.stringifyIndented(request)), server.Msg.Err);
+ this.doOutput(/*info*/ undefined, server.CommandNames.Unknown, request.seq, /*success*/ false, "Unrecognized JSON command: ".concat(request.command));
return { responseRequired: false };
}
};
@@ -174052,7 +174053,7 @@ var ts;
if (this.logger.hasLevel(server.LogLevel.requestTime)) {
start = this.hrtime();
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("request:" + server.indent(this.toStringMessage(message)));
+ this.logger.info("request:".concat(server.indent(this.toStringMessage(message))));
}
}
var request;
@@ -174068,10 +174069,10 @@ var ts;
if (this.logger.hasLevel(server.LogLevel.requestTime)) {
var elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4);
if (responseRequired) {
- this.logger.perftrc(request.seq + "::" + request.command + ": elapsed time (in milliseconds) " + elapsedTime);
+ this.logger.perftrc("".concat(request.seq, "::").concat(request.command, ": elapsed time (in milliseconds) ").concat(elapsedTime));
}
else {
- this.logger.perftrc(request.seq + "::" + request.command + ": async elapsed time (in milliseconds) " + elapsedTime);
+ this.logger.perftrc("".concat(request.seq, "::").concat(request.command, ": async elapsed time (in milliseconds) ").concat(elapsedTime));
}
}
// Note: Log before writing the response, else the editor can complete its activity before the server does
@@ -175007,7 +175008,7 @@ var ts;
}
if (!this.canWrite())
return;
- s = "[" + server.nowString() + "] " + s + "\n";
+ s = "[".concat(server.nowString(), "] ").concat(s, "\n");
if (!this.inGroup || this.firstInGroup) {
var prefix = BaseLogger.padStringRight(type + " " + this.seq.toString(), " ");
s = prefix + s;
@@ -175124,12 +175125,12 @@ var ts;
WorkerSession.prototype.send = function (msg) {
if (msg.type === "event" && !this.canUseEvents) {
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("Session does not support events: ignored event: " + JSON.stringify(msg));
+ this.logger.info("Session does not support events: ignored event: ".concat(JSON.stringify(msg)));
}
return;
}
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info(msg.type + ":" + server.indent(JSON.stringify(msg)));
+ this.logger.info("".concat(msg.type, ":").concat(server.indent(JSON.stringify(msg))));
}
this.webHost.writeMessage(msg);
};
@@ -176192,23 +176193,23 @@ var ts;
var status = cacheKey && statusCache_1.get(cacheKey);
if (status === undefined) {
if (logger.hasLevel(server.LogLevel.verbose)) {
- logger.info(cacheKey + " for path " + path + " not found in cache...");
+ logger.info("".concat(cacheKey, " for path ").concat(path, " not found in cache..."));
}
try {
var args = [ts.combinePaths(__dirname, "watchGuard.js"), path];
if (logger.hasLevel(server.LogLevel.verbose)) {
- logger.info("Starting " + process.execPath + " with args:" + server.stringifyIndented(args));
+ logger.info("Starting ".concat(process.execPath, " with args:").concat(server.stringifyIndented(args)));
}
childProcess.execFileSync(process.execPath, args, { stdio: "ignore", env: { ELECTRON_RUN_AS_NODE: "1" } });
status = true;
if (logger.hasLevel(server.LogLevel.verbose)) {
- logger.info("WatchGuard for path " + path + " returned: OK");
+ logger.info("WatchGuard for path ".concat(path, " returned: OK"));
}
}
catch (e) {
status = false;
if (logger.hasLevel(server.LogLevel.verbose)) {
- logger.info("WatchGuard for path " + path + " returned: " + e.message);
+ logger.info("WatchGuard for path ".concat(path, " returned: ").concat(e.message));
}
}
if (cacheKey) {
@@ -176216,7 +176217,7 @@ var ts;
}
}
else if (logger.hasLevel(server.LogLevel.verbose)) {
- logger.info("watchDirectory for " + path + " uses cached drive information.");
+ logger.info("watchDirectory for ".concat(path, " uses cached drive information."));
}
if (status) {
// this drive is safe to use - call real 'watchDirectory'
@@ -176359,7 +176360,7 @@ var ts;
return originalWatchDirectory(path, callback, recursive, options);
}
catch (e) {
- logger.info("Exception when creating directory watcher: " + e.message);
+ logger.info("Exception when creating directory watcher: ".concat(e.message));
return ts.noopFileWatcher;
}
}
@@ -176428,7 +176429,7 @@ var ts;
args.push(server.Arguments.EnableTelemetry);
}
if (this.logger.loggingEnabled() && this.logger.getLogFileName()) {
- args.push(server.Arguments.LogFile, ts.combinePaths(ts.getDirectoryPath(ts.normalizeSlashes(this.logger.getLogFileName())), "ti-" + process.pid + ".log"));
+ args.push(server.Arguments.LogFile, ts.combinePaths(ts.getDirectoryPath(ts.normalizeSlashes(this.logger.getLogFileName())), "ti-".concat(process.pid, ".log")));
}
if (this.typingSafeListLocation) {
args.push(server.Arguments.TypingSafeListLocation, this.typingSafeListLocation);
@@ -176452,7 +176453,7 @@ var ts;
var currentPort = match[2] !== undefined
? +match[2]
: match[1].charAt(0) === "d" ? 5858 : 9229;
- execArgv.push("--" + match[1] + "=" + (currentPort + 1));
+ execArgv.push("--".concat(match[1], "=").concat(currentPort + 1));
break;
}
}
@@ -176478,13 +176479,13 @@ var ts;
var request = server.createInstallTypingsRequest(project, typeAcquisition, unresolvedImports);
if (this.logger.hasLevel(server.LogLevel.verbose)) {
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("Scheduling throttled operation:" + server.stringifyIndented(request));
+ this.logger.info("Scheduling throttled operation:".concat(server.stringifyIndented(request)));
}
}
var operationId = project.getProjectName();
var operation = function () {
if (_this.logger.hasLevel(server.LogLevel.verbose)) {
- _this.logger.info("Sending request:" + server.stringifyIndented(request));
+ _this.logger.info("Sending request:".concat(server.stringifyIndented(request)));
}
_this.send(request);
};
@@ -176494,7 +176495,7 @@ var ts;
}
else {
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("Deferring request for: " + operationId);
+ this.logger.info("Deferring request for: ".concat(operationId));
}
this.requestQueue.push(queuedRequest);
this.requestMap.set(operationId, queuedRequest);
@@ -176502,7 +176503,7 @@ var ts;
};
NodeTypingsInstaller.prototype.handleMessage = function (response) {
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("Received response:" + server.stringifyIndented(response));
+ this.logger.info("Received response:".concat(server.stringifyIndented(response)));
}
switch (response.kind) {
case server.EventTypesRegistry:
@@ -176580,7 +176581,7 @@ var ts;
break;
}
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("Skipping defunct request for: " + queuedRequest.operationId);
+ this.logger.info("Skipping defunct request for: ".concat(queuedRequest.operationId));
}
}
this.projectService.updateTypingsForProject(response);
@@ -176593,7 +176594,7 @@ var ts;
};
NodeTypingsInstaller.prototype.scheduleRequest = function (request) {
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("Scheduling request for: " + request.operationId);
+ this.logger.info("Scheduling request for: ".concat(request.operationId));
}
this.activeRequestCount++;
this.host.setTimeout(request.operation, NodeTypingsInstaller.requestDelayMillis);
@@ -176641,7 +176642,7 @@ var ts;
if (this.canUseEvents && this.eventPort) {
if (!this.eventSocket) {
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("eventPort: event \"" + eventName + "\" queued, but socket not yet initialized");
+ this.logger.info("eventPort: event \"".concat(eventName, "\" queued, but socket not yet initialized"));
}
(this.socketEventQueue || (this.socketEventQueue = [])).push({ body: body, eventName: eventName });
return;
@@ -176685,7 +176686,7 @@ var ts;
var verboseLogging = logger.hasLevel(server.LogLevel.verbose);
if (verboseLogging) {
var json = JSON.stringify(msg);
- logger.info(msg.type + ":" + server.indent(json));
+ logger.info("".concat(msg.type, ":").concat(server.indent(json)));
}
process.send(msg);
};
@@ -176747,7 +176748,7 @@ var ts;
return ts.combinePaths(ts.combinePaths(cacheLocation, "typescript"), ts.versionMajorMinor);
}
default:
- return ts.Debug.fail("unsupported platform '" + process.platform + "'");
+ return ts.Debug.fail("unsupported platform '".concat(process.platform, "'"));
}
}
function getNonWindowsCacheLocation(platformIsDarwin) {
@@ -176757,7 +176758,7 @@ var ts;
var usersDir = platformIsDarwin ? "Users" : "home";
var homePath = (os.homedir && os.homedir()) ||
process.env.HOME ||
- ((process.env.LOGNAME || process.env.USER) && "/" + usersDir + "/" + (process.env.LOGNAME || process.env.USER)) ||
+ ((process.env.LOGNAME || process.env.USER) && "/".concat(usersDir, "/").concat(process.env.LOGNAME || process.env.USER)) ||
os.tmpdir();
var cacheFolder = platformIsDarwin
? "Library/Caches"
@@ -176915,10 +176916,10 @@ var ts;
var args = _a.args, logger = _a.logger, cancellationToken = _a.cancellationToken, serverMode = _a.serverMode, unknownServerMode = _a.unknownServerMode, startServer = _a.startSession;
var syntaxOnly = server.hasArgument("--syntaxOnly");
logger.info("Starting TS Server");
- logger.info("Version: " + ts.version);
- logger.info("Arguments: " + args.join(" "));
- logger.info("Platform: " + platform + " NodeVersion: " + ts.getNodeMajorVersion() + " CaseSensitive: " + ts.sys.useCaseSensitiveFileNames);
- logger.info("ServerMode: " + serverMode + " syntaxOnly: " + syntaxOnly + " hasUnknownServerMode: " + unknownServerMode);
+ logger.info("Version: ".concat(ts.version));
+ logger.info("Arguments: ".concat(args.join(" ")));
+ logger.info("Platform: ".concat(platform, " NodeVersion: ").concat(ts.getNodeMajorVersion(), " CaseSensitive: ").concat(ts.sys.useCaseSensitiveFileNames));
+ logger.info("ServerMode: ".concat(serverMode, " syntaxOnly: ").concat(syntaxOnly, " hasUnknownServerMode: ").concat(unknownServerMode));
ts.setStackTraceLimit();
if (ts.Debug.isDebugging) {
ts.Debug.enableDebugInfo();
diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js
index ea5f393e4ce..b020575e409 100644
--- a/lib/tsserverlibrary.js
+++ b/lib/tsserverlibrary.js
@@ -21,7 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
ar[i] = from[i];
}
}
- return to.concat(ar || from);
+ return to.concat(ar || Array.prototype.slice.call(from));
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
@@ -294,7 +294,7 @@ var ts;
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
- ts.version = ts.versionMajorMinor + ".1-rc";
+ ts.version = "4.6.2";
/* @internal */
var Comparison;
(function (Comparison) {
@@ -341,7 +341,7 @@ var ts;
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
if (constructor)
return constructor;
- throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
+ throw new Error("TypeScript requires an environment that provides a compatible native ".concat(name, " implementation."));
}
})(ts || (ts = {}));
/* @internal */
@@ -1691,7 +1691,7 @@ var ts;
function cast(value, test) {
if (value !== undefined && test(value))
return value;
- return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'.");
+ return ts.Debug.fail("Invalid cast. The supplied value ".concat(value, " did not pass the test '").concat(ts.Debug.getFunctionName(test), "'."));
}
ts.cast = cast;
/** Does nothing. */
@@ -1782,7 +1782,7 @@ var ts;
function memoizeOne(callback) {
var map = new ts.Map();
return function (arg) {
- var key = typeof arg + ":" + arg;
+ var key = "".concat(typeof arg, ":").concat(arg);
var value = map.get(key);
if (value === undefined && !map.has(key)) {
value = callback(arg);
@@ -2232,7 +2232,7 @@ var ts;
ts.createGetCanonicalFileName = createGetCanonicalFileName;
function patternText(_a) {
var prefix = _a.prefix, suffix = _a.suffix;
- return prefix + "*" + suffix;
+ return "".concat(prefix, "*").concat(suffix);
}
ts.patternText = patternText;
/**
@@ -2545,7 +2545,7 @@ var ts;
}
function fail(message, stackCrawlMark) {
debugger;
- var e = new Error(message ? "Debug Failure. " + message : "Debug Failure.");
+ var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");
if (Error.captureStackTrace) {
Error.captureStackTrace(e, stackCrawlMark || fail);
}
@@ -2553,12 +2553,12 @@ var ts;
}
Debug.fail = fail;
function failBadSyntaxKind(node, message, stackCrawlMark) {
- return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", stackCrawlMark || failBadSyntaxKind);
+ return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind);
}
Debug.failBadSyntaxKind = failBadSyntaxKind;
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
if (!expression) {
- message = message ? "False expression: " + message : "False expression.";
+ message = message ? "False expression: ".concat(message) : "False expression.";
if (verboseDebugInfo) {
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
}
@@ -2568,26 +2568,26 @@ var ts;
Debug.assert = assert;
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
if (a !== b) {
- var message = msg ? msg2 ? msg + " " + msg2 : msg : "";
- fail("Expected " + a + " === " + b + ". " + message, stackCrawlMark || assertEqual);
+ var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
+ fail("Expected ".concat(a, " === ").concat(b, ". ").concat(message), stackCrawlMark || assertEqual);
}
}
Debug.assertEqual = assertEqual;
function assertLessThan(a, b, msg, stackCrawlMark) {
if (a >= b) {
- fail("Expected " + a + " < " + b + ". " + (msg || ""), stackCrawlMark || assertLessThan);
+ fail("Expected ".concat(a, " < ").concat(b, ". ").concat(msg || ""), stackCrawlMark || assertLessThan);
}
}
Debug.assertLessThan = assertLessThan;
function assertLessThanOrEqual(a, b, stackCrawlMark) {
if (a > b) {
- fail("Expected " + a + " <= " + b, stackCrawlMark || assertLessThanOrEqual);
+ fail("Expected ".concat(a, " <= ").concat(b), stackCrawlMark || assertLessThanOrEqual);
}
}
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
if (a < b) {
- fail("Expected " + a + " >= " + b, stackCrawlMark || assertGreaterThanOrEqual);
+ fail("Expected ".concat(a, " >= ").concat(b), stackCrawlMark || assertGreaterThanOrEqual);
}
}
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
@@ -2618,42 +2618,42 @@ var ts;
function assertNever(member, message, stackCrawlMark) {
if (message === void 0) { message = "Illegal value:"; }
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
- return fail(message + " " + detail, stackCrawlMark || assertNever);
+ return fail("".concat(message, " ").concat(detail), stackCrawlMark || assertNever);
}
Debug.assertNever = assertNever;
function assertEachNode(nodes, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) {
- assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertEachNode);
+ assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '".concat(getFunctionName(test), "'."); }, stackCrawlMark || assertEachNode);
}
}
Debug.assertEachNode = assertEachNode;
function assertNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNode")) {
- assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNode);
+ 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);
}
}
Debug.assertNode = assertNode;
function assertNotNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) {
- assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " should not have passed test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNotNode);
+ 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);
}
}
Debug.assertNotNode = assertNotNode;
function assertOptionalNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) {
- assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertOptionalNode);
+ 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);
}
}
Debug.assertOptionalNode = assertOptionalNode;
function assertOptionalToken(node, kind, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) {
- assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, stackCrawlMark || assertOptionalToken);
+ 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);
}
}
Debug.assertOptionalToken = assertOptionalToken;
function assertMissingNode(node, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) {
- assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, stackCrawlMark || assertMissingNode);
+ assert(node === undefined, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); }, stackCrawlMark || assertMissingNode);
}
}
Debug.assertMissingNode = assertMissingNode;
@@ -2674,7 +2674,7 @@ var ts;
}
Debug.getFunctionName = getFunctionName;
function formatSymbol(symbol) {
- return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }";
+ return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");
}
Debug.formatSymbol = formatSymbol;
/**
@@ -2695,7 +2695,7 @@ var ts;
break;
}
if (enumValue !== 0 && enumValue & value) {
- result = "" + result + (result ? "|" : "") + enumName;
+ result = "".concat(result).concat(result ? "|" : "").concat(enumName);
remainingFlags &= ~enumValue;
}
}
@@ -2805,7 +2805,7 @@ var ts;
this.flags & 1 /* Unreachable */ ? "FlowUnreachable" :
"UnknownFlow";
var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);
- return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : "");
+ return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : "");
}
},
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },
@@ -2844,7 +2844,7 @@ var ts;
// We don't care, this is debug code that's only enabled with a debugger attached -
// we're just taking note of it for anyone checking regex performance in the future.
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
- return "NodeArray " + defaultValue;
+ return "NodeArray ".concat(defaultValue);
}
}
});
@@ -2899,7 +2899,7 @@ var ts;
var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" :
"Symbol";
var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;
- return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : "");
+ return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
@@ -2909,11 +2909,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" :
- this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) :
- this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" :
+ this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType ".concat(JSON.stringify(this.value)) :
+ this.flags & 2048 /* BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") :
this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" :
this.flags & 32 /* Enum */ ? "EnumType" :
- this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName :
+ this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType ".concat(this.intrinsicName) :
this.flags & 1048576 /* Union */ ? "UnionType" :
this.flags & 2097152 /* Intersection */ ? "IntersectionType" :
this.flags & 4194304 /* Index */ ? "IndexType" :
@@ -2932,7 +2932,7 @@ var ts;
"ObjectType" :
"Type";
var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
- return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : "");
+ return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
@@ -2968,11 +2968,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
- ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" :
- ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" :
- ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") :
- ts.isNumericLiteral(this) ? "NumericLiteral " + this.text :
- ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" :
+ ts.isIdentifier(this) ? "Identifier '".concat(ts.idText(this), "'") :
+ ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
+ ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
+ ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
+ ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") :
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
ts.isParameter(this) ? "ParameterDeclaration" :
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
@@ -3004,7 +3004,7 @@ var ts;
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
ts.isImportTypeNode(this) ? "ImportTypeNode" :
formatSyntaxKind(this.kind);
- return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : "");
+ return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : "");
}
},
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
@@ -3051,10 +3051,10 @@ var ts;
Debug.enableDebugInfo = enableDebugInfo;
function formatDeprecationMessage(name, error, errorAfter, since, message) {
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
- deprecationMessage += "'" + name + "' ";
- deprecationMessage += since ? "has been deprecated since v" + since : "is deprecated";
- deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v" + errorAfter + "." : ".";
- deprecationMessage += message ? " " + ts.formatStringFromArgs(message, [name], 0) : "";
+ deprecationMessage += "'".concat(name, "' ");
+ deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
+ deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
+ deprecationMessage += message ? " ".concat(ts.formatStringFromArgs(message, [name], 0)) : "";
return deprecationMessage;
}
function createErrorDeprecation(name, errorAfter, since, message) {
@@ -3185,11 +3185,11 @@ var ts;
}
};
Version.prototype.toString = function () {
- var result = this.major + "." + this.minor + "." + this.patch;
+ var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
if (ts.some(this.prerelease))
- result += "-" + this.prerelease.join(".");
+ result += "-".concat(this.prerelease.join("."));
if (ts.some(this.build))
- result += "+" + this.build.join(".");
+ result += "+".concat(this.build.join("."));
return result;
};
Version.zero = new Version(0, 0, 0);
@@ -3456,7 +3456,7 @@ var ts;
return ts.map(comparators, formatComparator).join(" ");
}
function formatComparator(comparator) {
- return "" + comparator.operator + comparator.operand;
+ return "".concat(comparator.operator).concat(comparator.operand);
}
})(ts || (ts = {}));
/*@internal*/
@@ -3754,7 +3754,7 @@ var ts;
fs = require("fs");
}
catch (e) {
- throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
+ throw new Error("tracing requires having fs\n(original error: ".concat(e.message || e, ")"));
}
}
mode = tracingMode;
@@ -3766,11 +3766,11 @@ var ts;
if (!fs.existsSync(traceDir)) {
fs.mkdirSync(traceDir, { recursive: true });
}
- var countPart = mode === "build" ? "." + process.pid + "-" + ++traceCount
- : mode === "server" ? "." + process.pid
+ var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount)
+ : mode === "server" ? ".".concat(process.pid)
: "";
- var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
- var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
+ var tracePath = ts.combinePaths(traceDir, "trace".concat(countPart, ".json"));
+ var typesPath = ts.combinePaths(traceDir, "types".concat(countPart, ".json"));
legend.push({
configFilePath: configFilePath,
tracePath: tracePath,
@@ -3860,7 +3860,7 @@ var ts;
}
// test if [time,endTime) straddles a sampling point
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
- writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
+ writeEvent("X", phase, name, args, "\"dur\":".concat(endTime - time), time);
}
}
function writeEvent(eventType, phase, name, args, extras, time) {
@@ -3869,11 +3869,11 @@ var ts;
if (mode === "server" && phase === "checkTypes" /* CheckTypes */)
return;
ts.performance.mark("beginTracing");
- fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\"");
+ fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
if (extras)
- fs.writeSync(traceFd, "," + extras);
+ fs.writeSync(traceFd, ",".concat(extras));
if (args)
- fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args));
+ fs.writeSync(traceFd, ",\"args\":".concat(JSON.stringify(args)));
fs.writeSync(traceFd, "}");
ts.performance.mark("endTracing");
ts.performance.measure("Tracing", "beginTracing", "endTracing");
@@ -5034,6 +5034,8 @@ var ts;
TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike";
TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike";
/* @internal */
+ TypeFlags[TypeFlags["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable";
+ /* @internal */
TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains";
TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection";
TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType";
@@ -5986,7 +5988,7 @@ var ts;
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
function getLevel(envVar, level) {
- return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase());
+ return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
}
function getCustomLevels(baseVariable) {
var customLevels;
@@ -6455,7 +6457,7 @@ var ts;
}
function onTimerToUpdateChildWatches() {
timerToUpdateChildWatches = undefined;
- sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
var start = ts.timestamp();
var invokeMap = new ts.Map();
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
@@ -6468,7 +6470,7 @@ var ts;
var hasChanges = updateChildWatches(dirName, dirPath, options);
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
}
- sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
callbackCache.forEach(function (callbacks, rootDirName) {
var existing = invokeMap.get(rootDirName);
if (existing) {
@@ -6484,7 +6486,7 @@ var ts;
}
});
var elapsed = ts.timestamp() - start;
- sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
+ sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
}
function removeChildWatches(parentWatcher) {
if (!parentWatcher)
@@ -6944,7 +6946,7 @@ var ts;
var remappedPaths = new ts.Map();
var normalizedDir = ts.normalizeSlashes(__dirname);
// Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
- var fileUrlRoot = "file://" + (ts.getRootLength(normalizedDir) === 1 ? "" : "/") + normalizedDir;
+ var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
var node = _a[_i];
if (node.callFrame.url) {
@@ -6953,7 +6955,7 @@ var ts;
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
}
else if (!nativePattern.test(url)) {
- node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external" + externalFileCounter + ".js")).get(url);
+ node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
externalFileCounter++;
}
}
@@ -6969,7 +6971,7 @@ var ts;
if (!err) {
try {
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
- profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
+ profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
}
}
catch (_c) {
@@ -7071,7 +7073,7 @@ var ts;
* @param createWatcher
*/
function invokeCallbackAndUpdateWatcher(createWatcher) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
// Call the callback for current directory
callback("rename", "");
// If watcher is not closed, update it
@@ -7096,7 +7098,7 @@ var ts;
}
}
if (hitSystemWatcherLimit) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
@@ -7112,7 +7114,7 @@ var ts;
// 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
// so instead of throwing error, use fs.watchFile
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
}
@@ -8275,6 +8277,8 @@ var ts;
Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),
+ Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, ts.DiagnosticCategory.Error, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."),
+ Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, ts.DiagnosticCategory.Error, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
@@ -10127,7 +10131,7 @@ var ts;
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
}
else {
- ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
+ 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"));
}
}
var res = lineStarts[line] + character;
@@ -13017,7 +13021,7 @@ var ts;
: "linkplain";
var name = link.name ? ts.entityNameToString(link.name) : "";
var space = link.name && link.text.startsWith("://") ? "" : " ";
- return "{@" + kind + " " + name + space + link.text + "}";
+ return "{@".concat(kind, " ").concat(name).concat(space).concat(link.text, "}");
}
/**
* Gets the effective type parameters. If the node was parsed in a
@@ -14274,11 +14278,11 @@ var ts;
}
function packageIdToPackageName(_a) {
var name = _a.name, subModuleName = _a.subModuleName;
- return subModuleName ? name + "/" + subModuleName : name;
+ return subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
}
ts.packageIdToPackageName = packageIdToPackageName;
function packageIdToString(packageId) {
- return packageIdToPackageName(packageId) + "@" + packageId.version;
+ return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version);
}
ts.packageIdToString = packageIdToString;
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
@@ -14361,7 +14365,7 @@ var ts;
function nodePosToString(node) {
var file = getSourceFileOfNode(node);
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
- return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
+ return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
}
ts.nodePosToString = nodePosToString;
function getEndLinePosition(line, sourceFile) {
@@ -14500,7 +14504,7 @@ var ts;
ts.isPinnedComment = isPinnedComment;
function createCommentDirectivesMap(sourceFile, commentDirectives) {
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
- "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,
+ "".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
commentDirective,
]); }));
var usedLines = new ts.Map();
@@ -14517,10 +14521,10 @@ var ts;
});
}
function markUsed(line) {
- if (!directivesByLine.has("" + line)) {
+ if (!directivesByLine.has("".concat(line))) {
return false;
}
- usedLines.set("" + line, true);
+ usedLines.set("".concat(line), true);
return true;
}
}
@@ -14750,7 +14754,7 @@ var ts;
}
return node.text;
}
- return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
+ return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
}
ts.getLiteralText = getLiteralText;
function canUseOriginalText(node, flags) {
@@ -17331,11 +17335,11 @@ var ts;
}
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
function getPropertyNameForUniqueESSymbol(symbol) {
- return "__@" + ts.getSymbolId(symbol) + "@" + symbol.escapedName;
+ return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
}
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
- return "__#" + ts.getSymbolId(containingClassSymbol) + "@" + description;
+ return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
}
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
function isKnownSymbol(symbol) {
@@ -20037,7 +20041,7 @@ var ts;
}
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
function getJSXRuntimeImport(base, options) {
- return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
+ return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
}
ts.getJSXRuntimeImport = getJSXRuntimeImport;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -20144,7 +20148,7 @@ var ts;
}
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
- var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))";
+ var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
var filesMatcher = {
/**
* Matches any single directory segment unless it is the last segment and a .min.js file
@@ -20157,7 +20161,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
};
var directoriesMatcher = {
@@ -20166,7 +20170,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
};
var excludeMatcher = {
@@ -20184,10 +20188,10 @@ var ts;
if (!patterns || !patterns.length) {
return undefined;
}
- var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|");
+ var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
var terminator = usage === "exclude" ? "($|/)" : "$";
- return "^(" + pattern + ")" + terminator;
+ return "^(".concat(pattern, ")").concat(terminator);
}
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
function getRegularExpressionsForWildcards(specs, basePath, usage) {
@@ -20209,7 +20213,7 @@ var ts;
ts.isImplicitGlob = isImplicitGlob;
function getPatternFromSpec(spec, basePath, usage) {
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
- return pattern && "^(" + pattern + ")" + (usage === "exclude" ? "($|/)" : "$");
+ return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
}
ts.getPatternFromSpec = getPatternFromSpec;
function getSubPatternFromSpec(spec, basePath, usage, _a) {
@@ -20287,7 +20291,7 @@ var ts;
currentDirectory = ts.normalizePath(currentDirectory);
var absolutePath = ts.combinePaths(currentDirectory, path);
return {
- includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
+ includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
@@ -20568,7 +20572,7 @@ var ts;
*/
function extensionFromPath(path) {
var ext = tryGetExtensionFromPath(path);
- return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension.");
+ return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
}
ts.extensionFromPath = extensionFromPath;
function isAnySupportedFileExtension(path) {
@@ -26651,7 +26655,7 @@ var ts;
case 326 /* JSDocAugmentsTag */: return "augments";
case 327 /* JSDocImplementsTag */: return "implements";
default:
- return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
+ return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
}
}
var rawTextScanner;
@@ -26979,7 +26983,7 @@ var ts;
};
var definedTextGetter_1 = function (path) {
var result = textGetter_1(path);
- return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
+ return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
};
var buildInfo_1;
var getAndCacheBuildInfo_1 = function (getText) {
@@ -31517,7 +31521,7 @@ var ts;
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
var keyword = viableKeywordSuggestions_1[_i];
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
- return keyword + " " + expressionText.slice(keyword.length);
+ return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
}
}
return undefined;
@@ -38287,7 +38291,7 @@ var ts;
if (namedArgRegExCache.has(name)) {
return namedArgRegExCache.get(name);
}
- var result = new RegExp("(\\s" + name + "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))", "im");
+ var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
namedArgRegExCache.set(name, result);
return result;
}
@@ -39765,8 +39769,8 @@ var ts;
}
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
- var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
- return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
+ var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
+ return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
}
/* @internal */
function parseCustomTypeOption(opt, value, errors) {
@@ -40560,10 +40564,10 @@ var ts;
var newValue = compilerOptionsMap.get(cmd.name);
var defaultValue = getDefaultValueForOption(cmd);
if (newValue !== defaultValue) {
- result.push("" + tab + cmd.name + ": " + newValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
}
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
- result.push("" + tab + cmd.name + ": " + defaultValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
}
});
return result.join(newLine) + newLine;
@@ -40614,19 +40618,19 @@ var ts;
if (entries.length !== 0) {
entries.push({ value: "" });
}
- entries.push({ value: "/* " + category + " */" });
+ entries.push({ value: "/* ".concat(category, " */") });
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
var option = options_1[_i];
var optionName = void 0;
if (compilerOptionsMap.has(option.name)) {
- optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
+ optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
}
else {
- optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ",";
+ optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
}
entries.push({
value: optionName,
- description: "/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"
+ description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
});
marginLength = Math.max(optionName.length, marginLength);
}
@@ -40635,25 +40639,25 @@ var ts;
var tab = makePadding(2);
var result = [];
result.push("{");
- result.push(tab + "\"compilerOptions\": {");
- result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + " */");
+ result.push("".concat(tab, "\"compilerOptions\": {"));
+ 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), " */"));
result.push("");
// Print out each row, aligning all the descriptions on the same column.
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
var entry = entries_2[_a];
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
- result.push(value && "" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));
+ result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
}
if (fileNames.length) {
- result.push(tab + "},");
- result.push(tab + "\"files\": [");
+ result.push("".concat(tab, "},"));
+ result.push("".concat(tab, "\"files\": ["));
for (var i = 0; i < fileNames.length; i++) {
- result.push("" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? "" : ","));
+ result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
}
- result.push(tab + "]");
+ result.push("".concat(tab, "]"));
}
else {
- result.push(tab + "}");
+ result.push("".concat(tab, "}"));
}
result.push("}");
return result.join(newLine) + newLine;
@@ -41051,7 +41055,7 @@ var ts;
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
- extendedConfigPath = extendedConfigPath + ".json";
+ extendedConfigPath = "".concat(extendedConfigPath, ".json");
if (!host.fileExists(extendedConfigPath)) {
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
return undefined;
@@ -41296,7 +41300,7 @@ var ts;
// Valid only if *.json specified
if (!jsonOnlyIncludeRegexes) {
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
- var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^" + pattern + "$"; });
+ var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
}
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
@@ -41732,7 +41736,7 @@ var ts;
var bestVersionKey = result.version, bestVersionPaths = result.paths;
if (typeof bestVersionPaths !== "object") {
if (state.traceEnabled) {
- trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['" + bestVersionKey + "']", "object", typeof bestVersionPaths);
+ trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
}
return;
}
@@ -42139,7 +42143,7 @@ var ts;
};
return cache;
function getUnderlyingCacheKey(specifier, mode) {
- var result = mode === undefined ? specifier : mode + "|" + specifier;
+ var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
memoizedReverseKeys.set(result, [specifier, mode]);
return result;
}
@@ -42170,7 +42174,7 @@ var ts;
}
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
- return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode + "|" + nonRelativeModuleName, createPerModuleNameCache);
+ return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
}
function createPerModuleNameCache() {
var directoryPathMap = new ts.Map();
@@ -42317,10 +42321,10 @@ var ts;
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
break;
default:
- return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
+ return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
}
if (result && result.resolvedModule)
- ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
+ ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
if (perFolderCache) {
perFolderCache.set(moduleName, resolutionMode, result);
@@ -42523,7 +42527,7 @@ var ts;
function resolveJSModule(moduleName, initialDir, host) {
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
if (!resolvedModule) {
- throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", "));
+ throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
}
return resolvedModule.resolvedFileName;
}
@@ -42633,7 +42637,7 @@ var ts;
if (traceEnabled) {
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
}
- ts.Debug.assert(host.fileExists(real), path + " linked to nonexistent file " + real);
+ ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
return real;
}
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
@@ -43110,7 +43114,7 @@ var ts;
return undefined;
}
var trailingParts = parts.slice(nameParts.length);
- return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
+ return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
}
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
if (!scope.packageJsonContent.exports) {
@@ -43438,7 +43442,7 @@ var ts;
}
/* @internal */
function getTypesPackageName(packageName) {
- return "@types/" + mangleScopedPackageName(packageName);
+ return "@types/".concat(mangleScopedPackageName(packageName));
}
ts.getTypesPackageName = getTypesPackageName;
/* @internal */
@@ -43839,7 +43843,7 @@ var ts;
if (name) {
if (ts.isAmbientModule(node)) {
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
- return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
+ return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
}
if (name.kind === 161 /* ComputedPropertyName */) {
var nameExpression = name.expression;
@@ -43896,7 +43900,7 @@ var ts;
case 163 /* Parameter */:
// Parameters with names are handled at the top of this function. Parameters
// without names can only come from JSDocFunctionTypes.
- ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ 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"); });
var functionType = node.parent;
var index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -44008,7 +44012,7 @@ var ts;
var relatedInformation_1 = [];
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
// export type T; - may have meant export type { T }?
- relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { " + ts.unescapeLeadingUnderscores(node.name.escapedText) + " }"));
+ relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
}
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
ts.forEach(symbol.declarations, function (declaration, index) {
@@ -46084,7 +46088,7 @@ var ts;
}
}
function bindSourceFileAsExternalModule() {
- bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\"");
+ bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
}
function bindExportAssignment(node) {
if (!container.symbol || !container.symbol.exports) {
@@ -47135,8 +47139,7 @@ var ts;
IntersectionState[IntersectionState["Source"] = 1] = "Source";
IntersectionState[IntersectionState["Target"] = 2] = "Target";
IntersectionState[IntersectionState["PropertyCheck"] = 4] = "PropertyCheck";
- IntersectionState[IntersectionState["UnionIntersectionCheck"] = 8] = "UnionIntersectionCheck";
- IntersectionState[IntersectionState["InPropertyCheck"] = 16] = "InPropertyCheck";
+ IntersectionState[IntersectionState["InPropertyCheck"] = 8] = "InPropertyCheck";
})(IntersectionState || (IntersectionState = {}));
var RecursionFlags;
(function (RecursionFlags) {
@@ -48184,7 +48187,7 @@ var ts;
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
- var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + "|" + secondFile_1.path, function () {
+ var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
});
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
@@ -50837,7 +50840,7 @@ var ts;
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
- var key = (useOnlyExternalAliasing ? 0 : 1) + "|" + (firstRelevantLocation && getNodeId(firstRelevantLocation)) + "|" + meaning;
+ var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
if (cache.has(key)) {
return cache.get(key);
}
@@ -51686,7 +51689,7 @@ var ts;
context.symbolDepth = new ts.Map();
}
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
- var key = getTypeId(type) + "|" + context.flags;
+ var key = "".concat(getTypeId(type), "|").concat(context.flags);
if (links) {
links.serializedTypes || (links.serializedTypes = new ts.Map());
}
@@ -51955,7 +51958,7 @@ var ts;
}
}
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
- typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... " + (properties.length - i) + " more ...", /*questionToken*/ undefined, /*type*/ undefined));
+ typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
break;
}
@@ -52070,7 +52073,7 @@ var ts;
else if (types.length > 2) {
return [
typeToTypeNodeHelper(types[0], context),
- ts.factory.createTypeReferenceNode("... " + (types.length - 2) + " more ...", /*typeArguments*/ undefined),
+ ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
typeToTypeNodeHelper(types[types.length - 1], context)
];
}
@@ -52084,7 +52087,7 @@ var ts;
var type = types_2[_i];
i++;
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
- result_5.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined));
+ result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
if (typeNode_1) {
result_5.push(typeNode_1);
@@ -52607,7 +52610,7 @@ var ts;
var text = rawtext;
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
i++;
- text = rawtext + "_" + i;
+ text = "".concat(rawtext, "_").concat(i);
}
if (text !== rawtext) {
result = ts.factory.createIdentifier(text, result.typeArguments);
@@ -52927,7 +52930,7 @@ var ts;
function getNameForJSDocFunctionParameter(p, index) {
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
: getEffectiveDotDotDotForParameter(p) ? "args"
- : "arg" + index;
+ : "arg".concat(index);
}
function rewriteModuleSpecifier(parent, lit) {
if (bundled) {
@@ -54012,7 +54015,7 @@ var ts;
return results_1;
}
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
- return ts.Debug.fail("Unhandled class member kind! " + (p.__debugFlags || p.flags));
+ return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
};
}
function serializePropertySymbolForInterface(p, baseType) {
@@ -54087,7 +54090,7 @@ var ts;
if (ref) {
return ref;
}
- var tempName = getUnusedName(rootName + "_base");
+ var tempName = getUnusedName("".concat(rootName, "_base"));
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
], 2 /* Const */));
@@ -54134,7 +54137,7 @@ var ts;
var original = input;
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
i++;
- input = original + "_" + i;
+ input = "".concat(original, "_").concat(i);
}
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
if (id) {
@@ -54242,15 +54245,15 @@ var ts;
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
var name = "" + nameType.value;
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
- return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\"";
+ return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
}
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
- return "[" + name + "]";
+ return "[".concat(name, "]");
}
return name;
}
if (nameType.flags & 8192 /* UniqueESSymbol */) {
- return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
+ return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
}
}
}
@@ -57081,7 +57084,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -59032,7 +59035,7 @@ var ts;
return result;
}
function getAliasId(aliasSymbol, aliasTypeArguments) {
- return aliasSymbol ? "@" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? ":" + getTypeListId(aliasTypeArguments) : "") : "";
+ return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
}
// This function is used to propagate certain flags when creating new object type references and union types.
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
@@ -59218,7 +59221,7 @@ var ts;
return undefined;
}
function getSymbolPath(symbol) {
- return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
+ return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
@@ -59229,7 +59232,7 @@ var ts;
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
undefined;
- var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
+ var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
var result = unresolvedSymbols.get(path);
if (!result) {
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
@@ -59302,7 +59305,7 @@ var ts;
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
return baseType;
}
- var id = getTypeId(baseType) + ">" + getTypeId(substitute);
+ var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
var cached = substitutionTypes.get(id);
if (cached) {
return cached;
@@ -60226,9 +60229,9 @@ var ts;
return types[0];
}
var typeKey = !origin ? getTypeListId(types) :
- origin.flags & 1048576 /* Union */ ? "|" + getTypeListId(origin.types) :
- origin.flags & 2097152 /* Intersection */ ? "&" + getTypeListId(origin.types) :
- "#" + origin.type.id + "|" + getTypeListId(types); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
+ origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
+ origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
+ "#".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
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
var type = unionTypes.get(id);
if (!type) {
@@ -60750,7 +60753,7 @@ var ts;
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
return stringType;
}
- var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join("");
+ var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
var type = templateLiteralTypes.get(id);
if (!type) {
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
@@ -60810,7 +60813,7 @@ var ts;
return str;
}
function getStringMappingTypeForGenericType(symbol, type) {
- var id = getSymbolId(symbol) + "," + getTypeId(type);
+ var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
var result = stringMappingTypes.get(id);
if (!result) {
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
@@ -61827,7 +61830,7 @@ var ts;
function createUniqueESSymbolType(symbol) {
var type = createType(8192 /* UniqueESSymbol */);
type.symbol = symbol;
- type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
+ type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
return type;
}
function getESSymbolLikeTypeForNode(node) {
@@ -63422,11 +63425,11 @@ var ts;
var overflow = false;
var overrideNextErrorInfo = 0; // How many `reportRelationError` calls should be skipped in the elaboration pyramid
var lastSkippedInfo;
- var incompatibleStack = [];
+ var incompatibleStack;
var inPropertyCheck = false;
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
var result = isRelatedTo(source, target, 3 /* Both */, /*reportErrors*/ !!errorNode, headMessage);
- if (incompatibleStack.length) {
+ if (incompatibleStack) {
reportIncompatibleStack();
}
if (overflow) {
@@ -63483,19 +63486,19 @@ var ts;
return {
errorInfo: errorInfo,
lastSkippedInfo: lastSkippedInfo,
- incompatibleStack: incompatibleStack.slice(),
+ incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
overrideNextErrorInfo: overrideNextErrorInfo,
- relatedInfo: !relatedInfo ? undefined : relatedInfo.slice()
+ relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
};
}
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
overrideNextErrorInfo++; // Suppress the next relation error
lastSkippedInfo = undefined; // Reset skipped info cache
- incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
+ (incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
}
function reportIncompatibleStack() {
- var stack = incompatibleStack;
- incompatibleStack = [];
+ var stack = incompatibleStack || [];
+ incompatibleStack = undefined;
var info = lastSkippedInfo;
lastSkippedInfo = undefined;
if (stack.length === 1) {
@@ -63516,24 +63519,24 @@ var ts;
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
// Parenthesize a `new` if there is one
if (path.indexOf("new ") === 0) {
- path = "(" + path + ")";
+ path = "(".concat(path, ")");
}
var str = "" + args[0];
// If leading, just print back the arg (irrespective of if it's a valid identifier)
if (path.length === 0) {
- path = "" + str;
+ path = "".concat(str);
}
// Otherwise write a dotted name if possible
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
- path = path + "." + str;
+ path = "".concat(path, ".").concat(str);
}
// Failing that, check if the name is already a computed name
else if (str[0] === "[" && str[str.length - 1] === "]") {
- path = "" + path + str;
+ path = "".concat(path).concat(str);
}
// And finally write out a computed name as a last resort
else {
- path = path + "[" + str + "]";
+ path = "".concat(path, "[").concat(str, "]");
}
break;
}
@@ -63562,7 +63565,7 @@ var ts;
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
? ""
: "...";
- path = "" + prefix + path + "(" + params + ")";
+ path = "".concat(prefix).concat(path, "(").concat(params, ")");
}
break;
}
@@ -63575,7 +63578,7 @@ var ts;
break;
}
default:
- return ts.Debug.fail("Unhandled Diagnostic: " + msg.code);
+ return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
}
}
if (path) {
@@ -63601,7 +63604,7 @@ var ts;
}
function reportError(message, arg0, arg1, arg2, arg3) {
ts.Debug.assert(!!errorNode);
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
if (message.elidedInCompatabilityPyramid)
return;
@@ -63617,7 +63620,7 @@ var ts;
}
}
function reportRelationError(message, source, target) {
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
var generalizedSource = source;
@@ -63729,7 +63732,9 @@ var ts;
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
return -1 /* True */;
}
- reportErrorResults(originalSource, originalTarget, 0 /* False */, !!(ts.getObjectFlags(originalSource) & 2048 /* JsxAttributes */));
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
+ }
return 0 /* False */;
}
// Normalize the source and target types: Turn fresh literal types into regular literal types,
@@ -63741,7 +63746,12 @@ var ts;
if (source === target)
return -1 /* True */;
if (relation === identityRelation) {
- return isIdenticalTo(source, target, recursionFlags);
+ if (source.flags !== target.flags)
+ return 0 /* False */;
+ if (source.flags & 67358815 /* Singleton */)
+ return -1 /* True */;
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
}
// We fastpath comparing a type parameter to exactly its constraint, as this is _super_ common,
// and otherwise, for type parameters in large unions, causes us to need to compare the union to itself,
@@ -63751,163 +63761,130 @@ var ts;
if (source.flags & 262144 /* TypeParameter */ && getConstraintOfType(source) === target) {
return -1 /* True */;
}
- // Try to see if we're relating something like `Foo` -> `Bar | null | undefined`.
- // If so, reporting the `null` and `undefined` in the type is hardly useful.
- // First, see if we're even relating an object type to a union.
- // Then see if the target is stripped down to a single non-union type.
- // Note
- // * We actually want to remove null and undefined naively here (rather than using getNonNullableType),
- // since we don't want to end up with a worse error like "`Foo` is not assignable to `NonNullable`"
- // when dealing with generics.
- // * We also don't deal with primitive source types, since we already halt elaboration below.
- if (target.flags & 1048576 /* Union */ && source.flags & 524288 /* Object */ &&
- target.types.length <= 3 && maybeTypeOfKind(target, 98304 /* Nullable */)) {
- var nullStrippedTarget = extractTypesOfKind(target, ~98304 /* Nullable */);
- if (!(nullStrippedTarget.flags & (1048576 /* Union */ | 131072 /* Never */))) {
- target = getNormalizedType(nullStrippedTarget, /*writing*/ true);
+ // See if we're relating a definitely non-nullable type to a union that includes null and/or undefined
+ // plus a single non-nullable type. If so, remove null and/or undefined from the target type.
+ if (source.flags & 470302716 /* DefinitelyNonNullable */ && target.flags & 1048576 /* Union */) {
+ var types = target.types;
+ var candidate = types.length === 2 && types[0].flags & 98304 /* Nullable */ ? types[1] :
+ types.length === 3 && types[0].flags & 98304 /* Nullable */ && types[1].flags & 98304 /* Nullable */ ? types[2] :
+ undefined;
+ if (candidate && !(candidate.flags & 98304 /* Nullable */)) {
+ target = getNormalizedType(candidate, /*writing*/ true);
+ if (source === target)
+ return -1 /* True */;
}
- if (source === nullStrippedTarget)
- return -1 /* True */;
}
if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) ||
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
return -1 /* True */;
- var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
- var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
- if (isPerformingExcessPropertyChecks) {
- if (hasExcessProperties(source, target, reportErrors)) {
+ if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {
+ var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
+ if (isPerformingExcessPropertyChecks) {
+ if (hasExcessProperties(source, target, reportErrors)) {
+ if (reportErrors) {
+ reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ }
+ return 0 /* False */;
+ }
+ }
+ var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
+ source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
+ target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
+ (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
+ var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
+ if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
if (reportErrors) {
- reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
+ var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
+ var calls = getSignaturesOfType(source, 0 /* Call */);
+ var constructs = getSignaturesOfType(source, 1 /* Construct */);
+ if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
+ constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
+ reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
+ }
+ else {
+ reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
+ }
}
return 0 /* False */;
}
- }
- var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
- source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
- target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
- (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
- if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
- if (reportErrors) {
- var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
- var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
- var calls = getSignaturesOfType(source, 0 /* Call */);
- var constructs = getSignaturesOfType(source, 1 /* Construct */);
- if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
- constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
- reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
- }
- else {
- reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
- }
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ var skipCaching = source.flags & 1048576 /* Union */ && source.types.length < 4 && !(target.flags & 1048576 /* Union */) ||
+ target.flags & 1048576 /* Union */ && target.types.length < 4 && !(source.flags & 469499904 /* StructuredOrInstantiable */);
+ var result_7 = skipCaching ?
+ unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
+ recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
+ // For certain combinations involving intersections and optional, excess, or mismatched properties we need
+ // an extra property check where the intersection is viewed as a single object. The following are motivating
+ // examples that all should be errors, but aren't without this extra property check:
+ //
+ // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
+ //
+ // declare let wrong: { a: { y: string } };
+ // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
+ //
+ // function foo(x: { a?: string }, y: T & { a: boolean }) {
+ // x = y; // Mismatched property in source intersection
+ // }
+ //
+ // We suppress recursive intersection property checks because they can generate lots of work when relating
+ // recursive intersections that are structurally similar but not exactly identical. See #37854.
+ if (result_7 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
+ isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
+ inPropertyCheck = true;
+ result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
+ inPropertyCheck = false;
}
- return 0 /* False */;
- }
- traceUnionsOrIntersectionsTooLarge(source, target);
- var result = 0 /* False */;
- var saveErrorInfo = captureErrorCalculationState();
- if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
- // We skip caching when source or target is a union with no more than three constituents.
- result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
- }
- else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
- result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
- }
- if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
- if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
- resetErrorInfo(saveErrorInfo);
+ if (result_7) {
+ return result_7;
}
}
- if (!result && source.flags & (2097152 /* Intersection */ | 262144 /* TypeParameter */)) {
- // The combined constraint of an intersection type is the intersection of the constraints of
- // the constituents. When an intersection type contains instantiable types with union type
- // constraints, there are situations where we need to examine the combined constraint. One is
- // when the target is a union type. Another is when the intersection contains types belonging
- // to one of the disjoint domains. For example, given type variables T and U, each with the
- // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
- // we need to check this constraint against a union on the target side. Also, given a type
- // variable V constrained to 'string | number', 'V & number' has a combined constraint of
- // 'string & number | number & number' which reduces to just 'number'.
- // This also handles type parameters, as a type parameter with a union constraint compared against a union
- // needs to have its constraint hoisted into an intersection with said type parameter, this way
- // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
- // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
- var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
- if (constraint && (source.flags & 2097152 /* Intersection */ || target.flags & 1048576 /* Union */)) {
- if (everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
- // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
- if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
- resetErrorInfo(saveErrorInfo);
- }
- }
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, source, target, headMessage);
+ }
+ return 0 /* False */;
+ }
+ function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
+ var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
+ var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
+ source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
+ target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
+ var maybeSuppress = overrideNextErrorInfo > 0;
+ if (maybeSuppress) {
+ overrideNextErrorInfo--;
+ }
+ if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
+ var currentError = errorInfo;
+ tryElaborateArrayLikeErrors(source, target, /*reportErrors*/ true);
+ if (errorInfo !== currentError) {
+ maybeSuppress = !!errorInfo;
}
}
- // For certain combinations involving intersections and optional, excess, or mismatched properties we need
- // an extra property check where the intersection is viewed as a single object. The following are motivating
- // examples that all should be errors, but aren't without this extra property check:
- //
- // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
- //
- // declare let wrong: { a: { y: string } };
- // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
- //
- // function foo(x: { a?: string }, y: T & { a: boolean }) {
- // x = y; // Mismatched property in source intersection
- // }
- //
- // We suppress recursive intersection property checks because they can generate lots of work when relating
- // recursive intersections that are structurally similar but not exactly identical. See #37854.
- if (result && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
- isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
- inPropertyCheck = true;
- result &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
- inPropertyCheck = false;
+ if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
+ tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
- reportErrorResults(source, target, result, isComparingJsxAttributes);
- return result;
- function reportErrorResults(source, target, result, isComparingJsxAttributes) {
- if (!result && reportErrors) {
- var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
- var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
- source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
- target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
- var maybeSuppress = overrideNextErrorInfo > 0;
- if (maybeSuppress) {
- overrideNextErrorInfo--;
- }
- if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
- var currentError = errorInfo;
- tryElaborateArrayLikeErrors(source, target, reportErrors);
- if (errorInfo !== currentError) {
- maybeSuppress = !!errorInfo;
- }
- }
- if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
- tryElaborateErrorsForPrimitivesAndObjects(source, target);
- }
- else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
- reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
- }
- else if (isComparingJsxAttributes && target.flags & 2097152 /* Intersection */) {
- var targetTypes = target.types;
- var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
- var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
- if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
- (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
- // do not report top error
- return result;
- }
- }
- else {
- errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
- }
- if (!headMessage && maybeSuppress) {
- lastSkippedInfo = [source, target];
- // Used by, eg, missing property checking to replace the top-level message with a more informative one
- return result;
- }
- reportRelationError(headMessage, source, target);
+ else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
+ reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
+ }
+ else if (ts.getObjectFlags(source) & 2048 /* JsxAttributes */ && target.flags & 2097152 /* Intersection */) {
+ var targetTypes = target.types;
+ var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
+ var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
+ if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
+ (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
+ // do not report top error
+ return;
}
}
+ else {
+ errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
+ }
+ if (!headMessage && maybeSuppress) {
+ lastSkippedInfo = [source, target];
+ // Used by, eg, missing property checking to replace the top-level message with a more informative one
+ return;
+ }
+ reportRelationError(headMessage, source, target);
}
function traceUnionsOrIntersectionsTooLarge(source, target) {
if (!ts.tracing) {
@@ -63934,21 +63911,6 @@ var ts;
}
}
}
- function isIdenticalTo(source, target, recursionFlags) {
- if (source.flags !== target.flags)
- return 0 /* False */;
- if (source.flags & 67358815 /* Singleton */)
- return -1 /* True */;
- traceUnionsOrIntersectionsTooLarge(source, target);
- if (source.flags & 3145728 /* UnionOrIntersection */) {
- var result_7 = eachTypeRelatedToSomeType(source, target);
- if (result_7) {
- result_7 &= eachTypeRelatedToSomeType(target, source);
- }
- return result_7;
- }
- return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
- }
function getTypeOfPropertyInTypes(types, name) {
var appendPropType = function (propTypes, type) {
var _a;
@@ -64047,6 +64009,41 @@ var ts;
function shouldCheckAsExcessProperty(prop, container) {
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
}
+ function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
+ // Note that these checks are specifically ordered to produce correct results. In particular,
+ // we need to deconstruct unions before intersections (because unions are always at the top),
+ // and we need to handle "each" relations before "some" relations for the same kind of type.
+ if (source.flags & 1048576 /* Union */) {
+ return relation === comparableRelation ?
+ someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) :
+ eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState);
+ }
+ if (target.flags & 1048576 /* Union */) {
+ return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
+ }
+ if (target.flags & 2097152 /* Intersection */) {
+ return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
+ }
+ // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
+ // constraints of all non-primitive types in the source into a new intersection. We do this because the
+ // intersection may further constrain the constraints of the non-primitive types. For example, given a type
+ // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
+ // appear to be comparable to '2'.
+ if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
+ var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
+ if (constraints !== source.types) {
+ source = getIntersectionType(constraints);
+ if (!(source.flags & 2097152 /* Intersection */)) {
+ return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
+ }
+ }
+ }
+ // Check to see if any constituents of the intersection are immediately related to the target.
+ // Don't report errors though. Elaborating on whether a source constituent is related to the target is
+ // not actually useful and leads to some confusing error messages. Instead, we rely on the caller
+ // checking whether the full intersection viewed as an object is related to the target.
+ return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
+ }
function eachTypeRelatedToSomeType(source, target) {
var result = -1 /* True */;
var sourceTypes = source.types;
@@ -64082,8 +64079,11 @@ var ts;
}
}
if (reportErrors) {
+ // Elaborate only if we can find a best matching type in the target union
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
- isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], 2 /* Target */, /*reportErrors*/ true);
+ if (bestMatchingType) {
+ isRelatedTo(source, bestMatchingType, 2 /* Target */, /*reportErrors*/ true);
+ }
}
return 0 /* False */;
}
@@ -64219,7 +64219,7 @@ var ts;
if (overflow) {
return 0 /* False */;
}
- var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0);
+ var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 /* InPropertyCheck */ : 0);
var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false);
var entry = relation.get(id);
if (entry !== undefined) {
@@ -64287,6 +64287,7 @@ var ts;
return originalHandler(onlyUnreliable);
};
}
+ var result;
if (expandingFlags === 3 /* Both */) {
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "recursiveTypeRelatedTo_DepthLimit", {
sourceId: source.id,
@@ -64296,8 +64297,13 @@ var ts;
depth: sourceDepth,
targetDepth: targetDepth
});
+ result = 3 /* Maybe */;
+ }
+ else {
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
+ result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
}
- var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */;
if (outofbandVarianceMarkerHandler) {
outofbandVarianceMarkerHandler = originalHandler;
}
@@ -64329,98 +64335,97 @@ var ts;
return result;
}
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
- var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
- return result;
- }
- function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
if (intersectionState & 4 /* PropertyCheck */) {
return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */);
}
- if (intersectionState & 8 /* UnionIntersectionCheck */) {
- // Note that these checks are specifically ordered to produce correct results. In particular,
- // we need to deconstruct unions before intersections (because unions are always at the top),
- // and we need to handle "each" relations before "some" relations for the same kind of type.
- if (source.flags & 1048576 /* Union */) {
- return relation === comparableRelation ?
- someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */) :
- eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */);
- }
- if (target.flags & 1048576 /* Union */) {
- return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
- }
- if (target.flags & 2097152 /* Intersection */) {
- return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
- }
- // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
- // constraints of all non-primitive types in the source into a new intersection. We do this because the
- // intersection may further constrain the constraints of the non-primitive types. For example, given a type
- // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
- // appear to be comparable to '2'.
- if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
- var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
- if (constraints !== source.types) {
- source = getIntersectionType(constraints);
- if (!(source.flags & 2097152 /* Intersection */)) {
- return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
- }
+ var result;
+ var originalErrorInfo;
+ var varianceCheckFailed = false;
+ var saveErrorInfo = captureErrorCalculationState();
+ var sourceFlags = source.flags;
+ var targetFlags = target.flags;
+ if (relation === identityRelation) {
+ // We've already checked that source.flags and target.flags are identical
+ if (sourceFlags & 3145728 /* UnionOrIntersection */) {
+ var result_8 = eachTypeRelatedToSomeType(source, target);
+ if (result_8) {
+ result_8 &= eachTypeRelatedToSomeType(target, source);
}
+ return result_8;
}
- // Check to see if any constituents of the intersection are immediately related to the target.
- //
- // Don't report errors though. Checking whether a constituent is related to the source is not actually
- // useful and leads to some confusing error messages. Instead it is better to let the below checks
- // take care of this, or to not elaborate at all. For instance,
- //
- // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors.
- //
- // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection
- // than to report that 'D' is not assignable to 'A' or 'B'.
- //
- // - For a primitive type or type parameter (such as 'number = A & B') there is no point in
- // breaking the intersection apart.
- return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
- }
- var flags = source.flags & target.flags;
- if (relation === identityRelation && !(flags & 524288 /* Object */)) {
- if (flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
return isRelatedTo(source.type, target.type, 3 /* Both */, /*reportErrors*/ false);
}
- var result_8 = 0 /* False */;
- if (flags & 8388608 /* IndexedAccess */) {
- if (result_8 = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
+ if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
- if (flags & 16777216 /* Conditional */) {
+ if (sourceFlags & 16777216 /* Conditional */) {
if (source.root.isDistributive === target.root.isDistributive) {
- if (result_8 = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (result = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
}
}
}
- if (flags & 33554432 /* Substitution */) {
+ if (sourceFlags & 33554432 /* Substitution */) {
return isRelatedTo(source.substitute, target.substitute, 3 /* Both */, /*reportErrors*/ false);
}
- return 0 /* False */;
+ if (!(sourceFlags & 524288 /* Object */)) {
+ return 0 /* False */;
+ }
+ }
+ else if (sourceFlags & 3145728 /* UnionOrIntersection */ || targetFlags & 3145728 /* UnionOrIntersection */) {
+ if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
+ return result;
+ }
+ if (source.flags & 2097152 /* Intersection */ || source.flags & 262144 /* TypeParameter */ && target.flags & 1048576 /* Union */) {
+ // The combined constraint of an intersection type is the intersection of the constraints of
+ // the constituents. When an intersection type contains instantiable types with union type
+ // constraints, there are situations where we need to examine the combined constraint. One is
+ // when the target is a union type. Another is when the intersection contains types belonging
+ // to one of the disjoint domains. For example, given type variables T and U, each with the
+ // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
+ // we need to check this constraint against a union on the target side. Also, given a type
+ // variable V constrained to 'string | number', 'V & number' has a combined constraint of
+ // 'string & number | number & number' which reduces to just 'number'.
+ // This also handles type parameters, as a type parameter with a union constraint compared against a union
+ // needs to have its constraint hoisted into an intersection with said type parameter, this way
+ // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
+ // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
+ var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
+ if (constraint && everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
+ // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
+ if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
+ resetErrorInfo(saveErrorInfo);
+ return result;
+ }
+ }
+ }
+ // The ordered decomposition above doesn't handle all cases. Specifically, we also need to handle:
+ // Source is instantiable (e.g. source has union or intersection constraint).
+ // Source is an object, target is a union (e.g. { a, b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target is an object (e.g. { a } & { b } <=> { a, b }).
+ // Source is an intersection, target is a union (e.g. { a } & { b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target instantiable (e.g. string & { tag } <=> T["a"] constrained to string & { tag }).
+ if (!(sourceFlags & 465829888 /* Instantiable */ ||
+ sourceFlags & 524288 /* Object */ && targetFlags & 1048576 /* Union */ ||
+ sourceFlags & 2097152 /* Intersection */ && targetFlags & (524288 /* Object */ | 1048576 /* Union */ | 465829888 /* Instantiable */))) {
+ return 0 /* False */;
+ }
}
- var result;
- var originalErrorInfo;
- var varianceCheckFailed = false;
- var saveErrorInfo = captureErrorCalculationState();
// We limit alias variance probing to only object and conditional types since their alias behavior
// is more predictable than other, interned types, which may or may not have an alias depending on
// the order in which things were checked.
- if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
+ if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
var variances = getAliasVariances(source.aliasSymbol);
@@ -64438,7 +64443,7 @@ var ts;
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2 /* Target */))) {
return result;
}
- if (target.flags & 262144 /* TypeParameter */) {
+ if (targetFlags & 262144 /* TypeParameter */) {
// A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q].
if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3 /* Both */)) {
if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) {
@@ -64450,10 +64455,10 @@ var ts;
}
}
}
- else if (target.flags & 4194304 /* Index */) {
+ else if (targetFlags & 4194304 /* Index */) {
var targetType_1 = target.type;
// A keyof S is related to a keyof T if T is related to S.
- if (source.flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(targetType_1, source.type, 3 /* Both */, /*reportErrors*/ false)) {
return result;
}
@@ -64504,8 +64509,8 @@ var ts;
}
}
}
- else if (target.flags & 8388608 /* IndexedAccess */) {
- if (source.flags & 8388608 /* IndexedAccess */) {
+ else if (targetFlags & 8388608 /* IndexedAccess */) {
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
// Relate components directly before falling back to constraint relationships
// A type S[K] is related to a type T[J] if S is related to T and K is related to J.
if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, reportErrors)) {
@@ -64611,7 +64616,7 @@ var ts;
}
}
}
- else if (target.flags & 16777216 /* Conditional */) {
+ else if (targetFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
@@ -64636,8 +64641,8 @@ var ts;
}
}
}
- else if (target.flags & 134217728 /* TemplateLiteral */) {
- if (source.flags & 134217728 /* TemplateLiteral */) {
+ else if (targetFlags & 134217728 /* TemplateLiteral */) {
+ if (sourceFlags & 134217728 /* TemplateLiteral */) {
if (relation === comparableRelation) {
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 /* False */ : -1 /* True */;
}
@@ -64649,11 +64654,11 @@ var ts;
return -1 /* True */;
}
}
- if (source.flags & 8650752 /* TypeVariable */) {
- // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
- if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
+ if (sourceFlags & 8650752 /* TypeVariable */) {
+ // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
+ if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
var constraint = getConstraintOfType(source);
- if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
+ if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
// A type variable with no constraint is not related to the non-primitive object type.
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
resetErrorInfo(saveErrorInfo);
@@ -64666,7 +64671,7 @@ var ts;
return result;
}
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(target.flags & source.flags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
+ else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
resetErrorInfo(saveErrorInfo);
return result;
}
@@ -64683,14 +64688,14 @@ var ts;
}
}
}
- else if (source.flags & 4194304 /* Index */) {
+ else if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(keyofConstraintType, target, 1 /* Source */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
}
}
- else if (source.flags & 134217728 /* TemplateLiteral */ && !(target.flags & 524288 /* Object */)) {
- if (!(target.flags & 134217728 /* TemplateLiteral */)) {
+ else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
+ if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
var constraint = getBaseConstraintOfType(source);
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1 /* Source */, reportErrors))) {
resetErrorInfo(saveErrorInfo);
@@ -64698,8 +64703,8 @@ var ts;
}
}
}
- else if (source.flags & 268435456 /* StringMapping */) {
- if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
+ else if (sourceFlags & 268435456 /* StringMapping */) {
+ if (targetFlags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
@@ -64713,14 +64718,14 @@ var ts;
}
}
}
- else if (source.flags & 16777216 /* Conditional */) {
+ else if (sourceFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
resetErrorInfo(saveErrorInfo);
return 3 /* Maybe */;
}
- if (target.flags & 16777216 /* Conditional */) {
+ if (targetFlags & 16777216 /* Conditional */) {
// Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if
// one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2,
// and Y1 is related to Y2.
@@ -64780,9 +64785,10 @@ var ts;
}
return 0 /* False */;
}
- var sourceIsPrimitive = !!(source.flags & 131068 /* Primitive */);
+ var sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */);
if (relation !== identityRelation) {
source = getApparentType(source);
+ sourceFlags = source.flags;
}
else if (isGenericMappedType(source)) {
return 0 /* False */;
@@ -64824,7 +64830,7 @@ var ts;
// In a check of the form X = A & B, we will have previously checked if A relates to X or B relates
// to X. Failing both of those we want to check if the aggregation of A and B's members structurally
// relates to X. Thus, we include intersection types on the source side here.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 524288 /* Object */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
// Report structural errors only if we haven't reported any errors yet
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined, intersectionState);
@@ -64848,7 +64854,7 @@ var ts;
// there exists a constituent of T for every combination of the discriminants of S
// with respect to T. We do not report errors here, as we will use the existing
// error result from checking each constituent of the union.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 1048576 /* Union */) {
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
if (objectOnlyTarget.flags & 1048576 /* Union */) {
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
@@ -65363,7 +65369,6 @@ var ts;
}
}
var result = -1 /* True */;
- var saveErrorInfo = captureErrorCalculationState();
var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
var sourceObjectFlags = ts.getObjectFlags(source);
var targetObjectFlags = ts.getObjectFlags(target);
@@ -65404,6 +65409,7 @@ var ts;
else {
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
var t = targetSignatures_1[_i];
+ var saveErrorInfo = captureErrorCalculationState();
// Only elaborate errors from the first failure
var shouldElaborateErrors = reportErrors;
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
@@ -65777,7 +65783,7 @@ var ts;
var constraintMarker = "";
var sourceId = getTypeReferenceId(source, 0);
var targetId = getTypeReferenceId(target, 0);
- return "" + constraintMarker + sourceId + "," + targetId + postFix;
+ return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
// getTypeReferenceId(A) returns "111=0-12=1"
// where A.id=111 and number.id=12
function getTypeReferenceId(type, depth) {
@@ -65821,7 +65827,7 @@ var ts;
var postFix = intersectionState ? ":" + intersectionState : "";
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
- source.id + "," + target.id + postFix;
+ "".concat(source.id, ",").concat(target.id).concat(postFix);
}
// Invoke the callback for each underlying property symbol of the given symbol and return the first
// value that isn't undefined.
@@ -67948,11 +67954,11 @@ var ts;
case 79 /* Identifier */:
if (!ts.isThisInTypeQuery(node)) {
var symbol = getResolvedSymbol(node);
- return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
+ return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
}
// falls through
case 108 /* ThisKeyword */:
- return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
+ return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
case 229 /* NonNullExpression */:
case 211 /* ParenthesizedExpression */:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
@@ -68574,9 +68580,6 @@ var ts;
getUnionType(ts.map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) :
mapType(type, mapper);
}
- function getConstituentCount(type) {
- return type.flags & 1048576 /* Union */ ? type.types.length : 1;
- }
function extractTypesOfKind(type, kind) {
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
}
@@ -70150,7 +70153,7 @@ var ts;
var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
+ return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
}
function isExportOrExportExpression(location) {
return !!ts.findAncestor(location, function (n) {
@@ -71841,7 +71844,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -76242,21 +76245,22 @@ var ts;
if (links.type === unknownType) {
links.type = getTypeFromBindingPattern(declaration.name);
}
- assignBindingElementTypes(declaration.name);
+ assignBindingElementTypes(declaration.name, links.type);
}
}
}
// When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push
// the destructured type into the contained binding elements.
- function assignBindingElementTypes(pattern) {
+ function assignBindingElementTypes(pattern, parentType) {
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
+ var type = getBindingElementTypeFromParentType(element, parentType);
if (element.name.kind === 79 /* Identifier */) {
- getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
+ getSymbolLinks(getSymbolOfNode(element)).type = type;
}
else {
- assignBindingElementTypes(element.name);
+ assignBindingElementTypes(element.name, type);
}
}
}
@@ -79997,28 +80001,24 @@ var ts;
if (returnType.flags & 1 /* Any */) {
return;
}
+ var headMessage;
var expectedReturnType;
- var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
- var errorInfo;
switch (node.parent.kind) {
case 256 /* ClassDeclaration */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 163 /* Parameter */:
- expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
- break;
case 166 /* PropertyDeclaration */:
+ case 163 /* Parameter */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
case 168 /* MethodDeclaration */:
case 171 /* GetAccessor */:
case 172 /* SetAccessor */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -80026,7 +80026,7 @@ var ts;
default:
return ts.Debug.fail();
}
- checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; });
+ checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
}
/**
* If a TypeNode can be resolved to a value symbol imported from an external module, it is
@@ -81708,7 +81708,7 @@ var ts;
function getPropertyNameForKnownSymbolName(symbolName) {
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
- return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
+ return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
}
/**
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
@@ -82299,9 +82299,9 @@ var ts;
var containsArguments = containsArgumentsReference(node);
if (containsArguments) {
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
- if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
+ if (isJs && lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
- errorOrSuggestion(isJs, lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
+ error(lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
}
}
else {
@@ -82311,7 +82311,9 @@ var ts;
return;
}
if (ts.isQualifiedName(name)) {
- errorOrSuggestion(isJs, name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ if (isJs) {
+ error(name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ }
}
else {
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
@@ -87490,29 +87492,28 @@ var ts;
}
function findMostOverlappyType(source, unionTarget) {
var bestMatch;
- var matchingCount = 0;
- for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
- var target = _a[_i];
- var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
- if (overlap.flags & 4194304 /* Index */) {
- // perfect overlap of keys
- bestMatch = target;
- matchingCount = Infinity;
- }
- else if (overlap.flags & 1048576 /* Union */) {
- // We only want to account for literal types otherwise.
- // If we have a union of index types, it seems likely that we
- // needed to elaborate between two generic mapped types anyway.
- var len = ts.length(ts.filter(overlap.types, isUnitType));
- if (len >= matchingCount) {
- bestMatch = target;
- matchingCount = len;
+ if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var matchingCount = 0;
+ for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
+ var target = _a[_i];
+ if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
+ if (overlap.flags & 4194304 /* Index */) {
+ // perfect overlap of keys
+ return target;
+ }
+ else if (isUnitType(overlap) || overlap.flags & 1048576 /* Union */) {
+ // We only want to account for literal types otherwise.
+ // If we have a union of index types, it seems likely that we
+ // needed to elaborate between two generic mapped types anyway.
+ var len = overlap.flags & 1048576 /* Union */ ? ts.countWhere(overlap.types, isUnitType) : 1;
+ if (len >= matchingCount) {
+ bestMatch = target;
+ matchingCount = len;
+ }
+ }
}
}
- else if (isUnitType(overlap) && 1 >= matchingCount) {
- bestMatch = target;
- matchingCount = 1;
- }
}
return bestMatch;
}
@@ -88760,7 +88761,7 @@ var ts;
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
value === 62 ? 43 /* plus */ :
value === 63 ? 47 /* slash */ :
- ts.Debug.fail(value + ": not a base64 value");
+ ts.Debug.fail("".concat(value, ": not a base64 value"));
}
function base64FormatDecode(ch) {
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
@@ -88835,7 +88836,7 @@ var ts;
var mappings = ts.arrayFrom(decoder, processMapping);
if (decoder.error !== undefined) {
if (host.log) {
- host.log("Encountered error while decoding sourcemap: " + decoder.error);
+ host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
}
decodedMappings = ts.emptyArray;
}
@@ -92510,7 +92511,7 @@ var ts;
var propertyName = ts.isPropertyAccessExpression(originalNode)
? ts.declarationNameToString(originalNode.name)
: ts.getTextOfNode(originalNode.argumentExpression);
- ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
+ ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
}
return substitute;
}
@@ -93986,8 +93987,8 @@ var ts;
}
function createHoistedVariableForClass(name, node) {
var className = getPrivateIdentifierEnvironment().className;
- var prefix = className ? "_" + className : "";
- var identifier = factory.createUniqueName(prefix + "_" + name, 16 /* Optimistic */);
+ var prefix = className ? "_".concat(className) : "";
+ var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
addBlockScopedVariable(identifier);
}
@@ -95992,7 +95993,7 @@ var ts;
specifierSourceImports = new ts.Map();
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
}
- var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
+ var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
generatedName.generatedImportReference = specifier;
specifierSourceImports.set(name, specifier);
@@ -97140,11 +97141,11 @@ var ts;
}
else {
if (node.kind === 245 /* BreakStatement */) {
- labelMarker = "break-" + label.escapedText;
+ labelMarker = "break-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
}
else {
- labelMarker = "continue-" + label.escapedText;
+ labelMarker = "continue-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
}
}
@@ -106001,7 +106002,7 @@ var ts;
return getTypeAliasDeclarationVisibilityError;
}
else {
- return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
+ return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
@@ -106212,7 +106213,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
- return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
+ return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
}
}
function getTypeParameterConstraintVisibilityError() {
@@ -106970,7 +106971,7 @@ var ts;
while (ts.length(lateMarkedStatements)) {
var i = lateMarkedStatements.shift();
if (!ts.isLateVisibilityPaintedStatement(i)) {
- return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
+ 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));
}
var priorNeedsDeclare = needsDeclare;
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
@@ -107159,7 +107160,7 @@ var ts;
return cleanup(input);
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));
}
- default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
+ default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
}
}
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
@@ -107450,7 +107451,7 @@ var ts;
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
// We must add a temporary declaration for the extends clause expression
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
- var newId_1 = factory.createUniqueName(oldId + "_base", 16 /* Optimistic */);
+ var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
getSymbolAccessibilityDiagnostic = function () { return ({
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
errorNode: extendsClause_1,
@@ -107491,7 +107492,7 @@ var ts;
}
}
// Anything left unhandled is an error, so this should be unreachable
- return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
+ return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
function cleanup(node) {
if (isEnclosingDeclaration(input)) {
enclosingDeclaration = previousEnclosingDeclaration;
@@ -108383,13 +108384,13 @@ var ts;
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
return;
if (js && configFile.options.sourceMap) {
- addOutput(js + ".map");
+ addOutput("".concat(js, ".map"));
}
if (ts.getEmitDeclarations(configFile.options)) {
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
addOutput(dts);
if (configFile.options.declarationMap) {
- addOutput(dts + ".map");
+ addOutput("".concat(dts, ".map"));
}
}
}
@@ -108458,7 +108459,7 @@ var ts;
function getFirstProjectOutput(configFile, ignoreCase) {
if (ts.outFile(configFile.options)) {
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
- return ts.Debug.checkDefined(jsFilePath, "project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
@@ -108477,7 +108478,7 @@ var ts;
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
if (buildInfoPath)
return buildInfoPath;
- return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
ts.getFirstProjectOutput = getFirstProjectOutput;
/*@internal*/
@@ -108703,7 +108704,7 @@ var ts;
if (sourceMappingURL) {
if (!writer.isAtStartOfLine())
writer.rawWrite(newLine);
- writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Tools can sometimes see this line as a source mapping url comment
+ writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
}
// Write the source map
if (sourceMapFilePath) {
@@ -108752,7 +108753,7 @@ var ts;
// Encode the sourceMap into the sourceMap url
var sourceMapText = sourceMapGenerator.toString();
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
- return "data:application/json;base64," + base64SourceMapText;
+ return "data:application/json;base64,".concat(base64SourceMapText);
}
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
if (mapOptions.mapRoot) {
@@ -108932,7 +108933,7 @@ var ts;
return;
break;
default:
- ts.Debug.fail("Unexpected path: " + name);
+ ts.Debug.fail("Unexpected path: ".concat(name));
}
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
},
@@ -109792,7 +109793,7 @@ var ts;
return writeTokenNode(node, writeKeyword);
if (ts.isTokenKind(node.kind))
return writeTokenNode(node, writePunctuation);
- ts.Debug.fail("Unhandled SyntaxKind: " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
}
function emitMappedTypeParameter(node) {
emit(node.name);
@@ -109962,16 +109963,16 @@ var ts;
}
}
function emitPlaceholder(hint, node, snippet) {
- nonEscapingWrite("${" + snippet.order + ":"); // `${2:`
+ nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
nonEscapingWrite("}"); // `}`
// `${2:...}`
}
function emitTabStop(hint, node, snippet) {
// A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
- ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
- nonEscapingWrite("$" + snippet.order);
+ nonEscapingWrite("$".concat(snippet.order));
}
//
// Identifiers
@@ -111733,17 +111734,17 @@ var ts;
writeLine();
}
if (currentSourceFile && currentSourceFile.moduleName) {
- writeComment("/// ");
+ writeComment("/// "));
writeLine();
}
if (currentSourceFile && currentSourceFile.amdDependencies) {
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
var dep = _b[_a];
if (dep.name) {
- writeComment("/// ");
+ writeComment("/// "));
}
else {
- writeComment("/// ");
+ writeComment("/// "));
}
writeLine();
}
@@ -111751,7 +111752,7 @@ var ts;
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
var directive = files_2[_c];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
writeLine();
@@ -111759,7 +111760,7 @@ var ts;
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
var directive = types_24[_d];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
writeLine();
@@ -111767,7 +111768,7 @@ var ts;
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
var directive = libs_1[_e];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
writeLine();
@@ -112547,9 +112548,9 @@ var ts;
var textSourceNode = node.textSourceNode;
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
- return jsxAttributeEscape ? "\"" + ts.escapeJsxAttributeString(text) + "\"" :
- neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"" + ts.escapeString(text) + "\"" :
- "\"" + ts.escapeNonAsciiString(text) + "\"";
+ return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
+ neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
+ "\"".concat(ts.escapeNonAsciiString(text), "\"");
}
else {
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
@@ -113026,8 +113027,8 @@ var ts;
}
function formatSynthesizedComment(comment) {
return comment.kind === 3 /* MultiLineCommentTrivia */
- ? "/*" + comment.text + "*/"
- : "//" + comment.text;
+ ? "/*".concat(comment.text, "*/")
+ : "//".concat(comment.text);
}
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
enterComment();
@@ -113748,7 +113749,7 @@ var ts;
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;
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
if (!newPath) {
- writeLog("Project: " + configFileName + " Detected ignored path: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
return true;
}
fileOrDirectoryPath = newPath;
@@ -113757,11 +113758,11 @@ var ts;
// If the the added or created file or directory is not supported file name, ignore the file
// But when watched directory is added/removed, we need to reload the file list
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
- writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
return true;
}
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
- writeLog("Project: " + configFileName + " Detected excluded file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
return true;
}
if (!program)
@@ -113785,7 +113786,7 @@ var ts;
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
- writeLog("Project: " + configFileName + " Detected output file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
return true;
}
return false;
@@ -113853,36 +113854,36 @@ var ts;
host.useCaseSensitiveFileNames();
}
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
- log("ExcludeWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
return {
- close: function () { return log("ExcludeWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }
+ close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
};
}
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- log("FileWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
return {
close: function () {
- log("FileWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
watcher.close();
}
};
}
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- var watchInfo = "DirectoryWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
return {
close: function () {
- var watchInfo = "DirectoryWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
watcher.close();
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
}
};
}
@@ -113892,16 +113893,16 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
- var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher") + ":: Triggered with " + args[0] + " " + (args[1] !== undefined ? args[1] : "") + ":: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ 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));
log(triggerredInfo);
var start = ts.timestamp();
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + triggerredInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
}, flags, options, detailInfo1, detailInfo2); };
}
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
- return "WatchInfo: " + file + " " + flags + " " + JSON.stringify(options) + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2);
+ return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
}
}
ts.getWatchFactory = getWatchFactory;
@@ -114208,12 +114209,12 @@ var ts;
}
ts.formatDiagnostics = formatDiagnostics;
function formatDiagnostic(diagnostic, host) {
- var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();
+ var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
if (diagnostic.file) {
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
var fileName = diagnostic.file.fileName;
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
- return relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): " + errorMessage;
+ return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
}
return errorMessage;
}
@@ -114301,9 +114302,9 @@ var ts;
var output = "";
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
output += ":";
- output += color("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
output += ":";
- output += color("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
return output;
}
ts.formatLocation = formatLocation;
@@ -114317,7 +114318,7 @@ var ts;
output += " - ";
}
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
- output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
+ output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
if (diagnostic.file) {
output += host.getNewLine();
@@ -114426,7 +114427,7 @@ var ts;
var result = void 0;
var mode = getModeForResolutionAtIndex(containingFile, i);
i++;
- var cacheKey = mode !== undefined ? mode + "|" + name : name;
+ var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
if (cache.has(cacheKey)) {
result = cache.get(cacheKey);
}
@@ -116615,7 +116616,7 @@ var ts;
path += (i === 2 ? "/" : "-") + components[i];
i++;
}
- var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
+ var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
return localOverrideModuleResult.resolvedModule.resolvedFileName;
@@ -117436,12 +117437,12 @@ var ts;
}
function directoryExistsIfProjectReferenceDeclDir(dir) {
var dirPath = host.toPath(dir);
- var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
+ var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
// Any parent directory of declaration dir
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
// Any directory inside declaration dir
- ts.startsWith(dirPath, declDirPath + "/"); });
+ ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
}
function handleDirectoryCouldBeSymlink(directory) {
var _a;
@@ -117494,7 +117495,7 @@ var ts;
if (isFile && result) {
// Store the real path for the file'
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
- symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), ""));
+ symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
}
return result;
}) || false;
@@ -117952,7 +117953,7 @@ var ts;
/*forceDtsEmit*/ true);
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
if (firstDts_1) {
- 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: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
+ 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; }))); });
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
if (exportedModulesMapCache && latestSignature !== prevSignature) {
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
@@ -118460,7 +118461,7 @@ var ts;
return;
}
else {
- 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: " + affectedFile.fileName);
+ 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));
}
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
@@ -119605,7 +119606,7 @@ var ts;
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
- ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: " + failedLookupLocation + " failedLookupLocationPath: " + failedLookupLocationPath);
+ ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
if (failedLookupPathSplit.length > rootSplitLength + 1) {
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
return {
@@ -120687,7 +120688,7 @@ var ts;
}
function getJSExtensionForFile(fileName, options) {
var _a;
- return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension " + ts.extensionFromPath(fileName) + " is unsupported:: FileName:: " + fileName);
+ return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
}
function tryGetJSExtensionForFile(fileName, options) {
var ext = ts.tryGetExtensionFromPath(fileName);
@@ -120790,8 +120791,8 @@ var ts;
return pretty ?
function (diagnostic, newLine, options) {
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
- var output = "[" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);
+ var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
system.write(output);
} :
function (diagnostic, newLine, options) {
@@ -120799,8 +120800,8 @@ var ts;
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
output += newLine;
}
- output += getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);
+ output += "".concat(getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
system.write(output);
};
}
@@ -120823,7 +120824,7 @@ var ts;
.map(function (errorDiagnostic) {
if (errorDiagnostic.file === undefined)
return;
- return "" + errorDiagnostic.file.fileName;
+ return "".concat(errorDiagnostic.file.fileName);
});
return filesInError.map(function (fileName) {
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
@@ -120856,7 +120857,7 @@ var ts;
if (errorCount === 0)
return "";
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
- var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return "".concat(fileInError.fileName, ":").concat(fileInError.line); })
.filter(function (value, index, self) { return self.indexOf(value) === index; });
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
var d = errorCount === 1 ?
@@ -120869,7 +120870,7 @@ var ts;
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
+ return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix);
}
ts.getErrorSummaryText = getErrorSummaryText;
function createTabularErrorsDisplay(filesInError, host) {
@@ -120892,7 +120893,7 @@ var ts;
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
: "";
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
- tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
+ tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n");
});
return tabularData;
}
@@ -120919,9 +120920,9 @@ var ts;
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
var file = _c[_i];
- write("" + toFileName(file, relativeFileName));
- (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" " + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });
- (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" " + d.messageText); });
+ write("".concat(toFileName(file, relativeFileName)));
+ (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
+ (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
}
}
ts.explainFiles = explainFiles;
@@ -120961,7 +120962,7 @@ var ts;
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
return false;
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
- return !!pattern && ts.getRegexFromPattern("(" + pattern + ")$", useCaseSensitiveFileNames).test(fileName);
+ return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
});
}
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
@@ -120970,7 +120971,7 @@ var ts;
var options = program.getCompilerOptions();
if (ts.isReferencedFile(reason)) {
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
- var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"" + referenceLocation.text + "\"";
+ var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
var message = void 0;
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
switch (reason.kind) {
@@ -121094,7 +121095,7 @@ var ts;
var currentDir_1 = program.getCurrentDirectory();
ts.forEach(emittedFiles, function (file) {
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
- write("TSFILE: " + filepath);
+ write("TSFILE: ".concat(filepath));
});
listFiles(program, write);
}
@@ -121423,7 +121424,7 @@ var ts;
}
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
- writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames);
+ writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
var configFileWatcher;
if (configFileName) {
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
@@ -121579,10 +121580,10 @@ var ts;
function createNewProgram(hasInvalidatedResolution) {
// Compile the program
writeLog("CreatingProgramWith::");
- writeLog(" roots: " + JSON.stringify(rootFileNames));
- writeLog(" options: " + JSON.stringify(compilerOptions));
+ writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
+ writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
if (projectReferences)
- writeLog(" projectReferences: " + JSON.stringify(projectReferences));
+ writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
hasChangedCompilerOptions = false;
hasChangedConfigFileParsingErrors = false;
@@ -121743,7 +121744,7 @@ var ts;
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
}
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
- writeLog("Scheduling invalidateFailedLookup" + (pending ? ", Cancelled earlier one" : ""));
+ writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
}
function invalidateResolutionsOfFailedLookup() {
@@ -121803,7 +121804,7 @@ var ts;
synchronizeProgram();
}
function reloadConfigFile() {
- writeLog("Reloading config file: " + configFileName);
+ writeLog("Reloading config file: ".concat(configFileName));
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
if (cachedDirectoryStructureHost) {
cachedDirectoryStructureHost.clearCache();
@@ -121844,7 +121845,7 @@ var ts;
return config.parsedCommandLine;
}
}
- writeLog("Loading config file: " + configFileName);
+ writeLog("Loading config file: ".concat(configFileName));
var parsedCommandLine = host.getParsedCommandLine ?
host.getParsedCommandLine(configFileName) :
getParsedCommandLineFromConfigFileHost(configFileName);
@@ -122148,8 +122149,8 @@ var ts;
*/
function createBuilderStatusReporter(system, pretty) {
return function (diagnostic) {
- var output = pretty ? "[" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] " : ts.getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);
+ var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
system.write(output);
};
}
@@ -122924,7 +122925,7 @@ var ts;
function listEmittedFile(_a, proj, file) {
var write = _a.write;
if (write && proj.options.listEmittedFiles) {
- write("TSFILE: " + file);
+ write("TSFILE: ".concat(file));
}
}
function getOldProgram(_a, proj, parsed) {
@@ -122953,7 +122954,7 @@ var ts;
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
reportAndStoreErrors(state, resolvedPath, diagnostics);
- state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
+ state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
if (canEmitBuildInfo)
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
afterProgramDone(state, program, config);
@@ -122981,7 +122982,7 @@ var ts;
if (!host.fileExists(inputFile)) {
return {
type: ts.UpToDateStatusType.Unbuildable,
- reason: inputFile + " does not exist"
+ reason: "".concat(inputFile, " does not exist")
};
}
if (!force) {
@@ -123340,7 +123341,7 @@ var ts;
}
}
if (filesToDelete) {
- reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ 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(""));
}
return ts.ExitStatus.Success;
}
@@ -123678,7 +123679,7 @@ var ts;
function nowString() {
// E.g. "12:34:56.789"
var d = new Date();
- return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0");
+ 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"));
}
server.nowString = nowString;
})(server = ts.server || (ts.server = {}));
@@ -123689,7 +123690,7 @@ var ts;
var JsTyping;
(function (JsTyping) {
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
- var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest"));
+ var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
return availableVersion.compareTo(cachedTyping.version) <= 0;
}
JsTyping.isTypingUpToDate = isTypingUpToDate;
@@ -123742,7 +123743,7 @@ var ts;
"worker_threads",
"zlib"
];
- JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:" + name; });
+ JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
function nonRelativeModuleNameForTypingCache(moduleName) {
@@ -123815,7 +123816,7 @@ var ts;
var excludeTypingName = exclude_1[_i];
var didDelete = inferredTypings.delete(excludeTypingName);
if (didDelete && log)
- log("Typing for " + excludeTypingName + " is in exclude list, will be ignored.");
+ log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
}
var newTypingNames = [];
var cachedTypingPaths = [];
@@ -123829,7 +123830,7 @@ var ts;
});
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
if (log)
- log("Result: " + JSON.stringify(result));
+ log("Result: ".concat(JSON.stringify(result)));
return result;
function addInferredTyping(typingName) {
if (!inferredTypings.has(typingName)) {
@@ -123838,7 +123839,7 @@ var ts;
}
function addInferredTypings(typingNames, message) {
if (log)
- log(message + ": " + JSON.stringify(typingNames));
+ log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
ts.forEach(typingNames, addInferredTyping);
}
/**
@@ -123860,7 +123861,7 @@ var ts;
filesToWatch.push(manifestPath);
manifest = ts.readConfigFile(manifestPath, function (path) { return host.readFile(path); }).config;
manifestTypingNames = ts.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts.getOwnKeys);
- addInferredTypings(manifestTypingNames, "Typing names in '" + manifestPath + "' dependencies");
+ addInferredTypings(manifestTypingNames, "Typing names in '".concat(manifestPath, "' dependencies"));
}
// Now we scan the directories for typing information in
// already-installed dependencies (if present). Note that this
@@ -123904,7 +123905,7 @@ var ts;
!isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; // `node_modules/foo`
});
if (log)
- log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(dependencyManifestNames));
+ log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(dependencyManifestNames)));
// Once we have the names of things to look up, we iterate over
// and either collect their included typings, or add them to the
// list of typings we need to look up separately.
@@ -123923,12 +123924,12 @@ var ts;
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
if (host.fileExists(absolutePath)) {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types."));
inferredTypings.set(manifest_1.name, absolutePath);
}
else {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types but they are missing.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types but they are missing."));
}
}
else {
@@ -124024,15 +124025,15 @@ var ts;
var kind = isScopeName ? "Scope" : "Package";
switch (result) {
case 1 /* EmptyName */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot be empty";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
case 2 /* NameTooLong */:
- return "'" + typing + "':: " + kind + " name '" + name + "' should be less than " + maxPackageNameLength + " characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
case 3 /* NameStartsWithDot */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '.'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
case 4 /* NameStartsWithUnderscore */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '_'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
case 5 /* NameContainsNonURISafeCharacters */:
- return "'" + typing + "':: " + kind + " name '" + name + "' contains non URI safe characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
case 0 /* Ok */:
return ts.Debug.fail(); // Shouldn't have called this.
default:
@@ -126587,7 +126588,7 @@ var ts;
var prefix = ts.isJSDocLink(link) ? "link"
: ts.isJSDocLinkCode(link) ? "linkcode"
: "linkplain";
- var parts = [linkPart("{@" + prefix + " ")];
+ var parts = [linkPart("{@".concat(prefix, " "))];
if (!link.name) {
if (link.text)
parts.push(linkTextPart(link.text));
@@ -126835,7 +126836,7 @@ var ts;
function getUniqueName(baseName, sourceFile) {
var nameText = baseName;
for (var i = 1; !ts.isFileLevelUniqueName(sourceFile, nameText); i++) {
- nameText = baseName + "_" + i;
+ nameText = "".concat(baseName, "_").concat(i);
}
return nameText;
}
@@ -126945,7 +126946,7 @@ var ts;
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
var quotePreference = getQuotePreference(sourceFile, preferences);
var quoted = JSON.stringify(text);
- return quotePreference === 0 /* Single */ ? "'" + ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"') + "'" : quoted;
+ return quotePreference === 0 /* Single */ ? "'".concat(ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"'), "'") : quoted;
}
ts.quote = quote;
function isEqualityOperatorKind(kind) {
@@ -127329,7 +127330,7 @@ var ts;
var components = ts.getPathComponents(ts.getPackageNameFromTypesPackageName(fullSpecifier)).slice(1);
// Scoped packages
if (ts.startsWith(components[0], "@")) {
- return components[0] + "/" + components[1];
+ return "".concat(components[0], "/").concat(components[1]);
}
return components[0];
}
@@ -127456,13 +127457,13 @@ var ts;
}
function getSymbolParentOrFail(symbol) {
var _a;
- return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: " + ts.Debug.formatSymbolFlags(symbol.flags) + ". " +
- ("Declarations: " + ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
+ return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: ".concat(ts.Debug.formatSymbolFlags(symbol.flags), ". ") +
+ "Declarations: ".concat((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
var kind = ts.Debug.formatSyntaxKind(d.kind);
var inJS = ts.isInJSFile(d);
var expression = d.expression;
- return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: " + ts.Debug.formatSyntaxKind(expression.kind) + ")" : "");
- }).join(", ")) + "."));
+ return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: ".concat(ts.Debug.formatSyntaxKind(expression.kind), ")") : "");
+ }).join(", "), "."));
}
/**
* Useful to check whether a string contains another string at a specific index
@@ -127723,7 +127724,7 @@ var ts;
: checker.tryFindAmbientModule(info.moduleName));
var symbol = info.symbol || cachedSymbol || ts.Debug.checkDefined(exportKind === 2 /* ExportEquals */
? checker.resolveExternalModuleSymbol(moduleSymbol)
- : checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '" + info.symbolName + "' by key '" + info.symbolTableKey + "' in module " + moduleSymbol.name);
+ : checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '".concat(info.symbolName, "' by key '").concat(info.symbolTableKey, "' in module ").concat(moduleSymbol.name));
symbols.set(id, [symbol, moduleSymbol]);
return {
symbol: symbol,
@@ -127736,7 +127737,7 @@ var ts;
}
function key(importedName, symbol, ambientModuleName, checker) {
var moduleKey = ambientModuleName || "";
- return importedName + "|" + ts.getSymbolId(ts.skipAlias(symbol, checker)) + "|" + moduleKey;
+ return "".concat(importedName, "|").concat(ts.getSymbolId(ts.skipAlias(symbol, checker)), "|").concat(moduleKey);
}
function parseKey(key) {
var symbolName = key.substring(0, key.indexOf("|"));
@@ -127822,7 +127823,7 @@ var ts;
if (autoImportProvider) {
var start = ts.timestamp();
forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), function (module, file) { return cb(module, file, autoImportProvider, /*isFromPackageJson*/ true); });
- (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: " + (ts.timestamp() - start));
+ (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: ".concat(ts.timestamp() - start));
}
}
ts.forEachExternalModuleToImportFrom = forEachExternalModuleToImportFrom;
@@ -127875,7 +127876,7 @@ var ts;
}
});
});
- (_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in " + (ts.timestamp() - start) + " ms");
+ (_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in ".concat(ts.timestamp() - start, " ms"));
return cache;
}
ts.getExportInfoMap = getExportInfoMap;
@@ -128408,7 +128409,7 @@ var ts;
return { spans: spans, endOfLineState: 0 /* None */ };
function pushClassification(start, end, type) {
var length = end - start;
- ts.Debug.assert(length > 0, "Classification had non-positive length of " + length);
+ ts.Debug.assert(length > 0, "Classification had non-positive length of ".concat(length));
spans.push(start);
spans.push(length);
spans.push(type);
@@ -129280,7 +129281,7 @@ var ts;
case ".d.cts" /* Dcts */: return ".d.cts" /* dctsModifier */;
case ".cjs" /* Cjs */: return ".cjs" /* cjsModifier */;
case ".cts" /* Cts */: return ".cts" /* ctsModifier */;
- case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension " + ".tsbuildinfo" /* TsBuildInfo */ + " is unsupported.");
+ case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension ".concat(".tsbuildinfo" /* TsBuildInfo */, " is unsupported."));
case undefined: return "" /* none */;
default:
return ts.Debug.assertNever(extension);
@@ -130016,10 +130017,10 @@ var ts;
var resolvedFromCacheCount = 0;
var cacheAttemptCount = 0;
var result = cb({ tryResolve: tryResolve, resolutionLimitExceeded: function () { return resolutionLimitExceeded; } });
- var hitRateMessage = cacheAttemptCount ? " (" + (resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1) + "% hit rate)" : "";
- (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, logPrefix + ": resolved " + resolvedCount + " module specifiers, plus " + ambientCount + " ambient and " + resolvedFromCacheCount + " from cache" + hitRateMessage);
- (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, logPrefix + ": response is " + (resolutionLimitExceeded ? "incomplete" : "complete"));
- (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, logPrefix + ": " + (ts.timestamp() - start));
+ var hitRateMessage = cacheAttemptCount ? " (".concat((resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1), "% hit rate)") : "";
+ (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, "".concat(logPrefix, ": resolved ").concat(resolvedCount, " module specifiers, plus ").concat(ambientCount, " ambient and ").concat(resolvedFromCacheCount, " from cache").concat(hitRateMessage));
+ (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "".concat(logPrefix, ": response is ").concat(resolutionLimitExceeded ? "incomplete" : "complete"));
+ (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, "".concat(logPrefix, ": ").concat(ts.timestamp() - start));
return result;
function tryResolve(exportInfo, isFromAmbientModule) {
if (isFromAmbientModule) {
@@ -130352,15 +130353,15 @@ var ts;
var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess;
if (origin && originIsThisType(origin)) {
insertText = needsConvertPropertyAccess
- ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(sourceFile, preferences, name) + "]"
- : "this" + (insertQuestionDot ? "?." : ".") + name;
+ ? "this".concat(insertQuestionDot ? "?." : "", "[").concat(quotePropertyName(sourceFile, preferences, name), "]")
+ : "this".concat(insertQuestionDot ? "?." : ".").concat(name);
}
// We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790.
// Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro.
else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) {
- insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(sourceFile, preferences, name) + "]" : "[" + name + "]" : name;
+ insertText = useBraces ? needsConvertPropertyAccess ? "[".concat(quotePropertyName(sourceFile, preferences, name), "]") : "[".concat(name, "]") : name;
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
- insertText = "?." + insertText;
+ insertText = "?.".concat(insertText);
}
var dot = ts.findChildOfKind(propertyAccessToConvert, 24 /* DotToken */, sourceFile) ||
ts.findChildOfKind(propertyAccessToConvert, 28 /* QuestionDotToken */, sourceFile);
@@ -130374,7 +130375,7 @@ var ts;
if (isJsxInitializer) {
if (insertText === undefined)
insertText = name;
- insertText = "{" + insertText + "}";
+ insertText = "{".concat(insertText, "}");
if (typeof isJsxInitializer !== "boolean") {
replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile);
}
@@ -130387,8 +130388,8 @@ var ts;
if (precedingToken && ts.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) {
awaitText = ";";
}
- awaitText += "(await " + propertyAccessToConvert.expression.getText() + ")";
- insertText = needsConvertPropertyAccess ? "" + awaitText + insertText : "" + awaitText + (insertQuestionDot ? "?." : ".") + insertText;
+ awaitText += "(await ".concat(propertyAccessToConvert.expression.getText(), ")");
+ insertText = needsConvertPropertyAccess ? "".concat(awaitText).concat(insertText) : "".concat(awaitText).concat(insertQuestionDot ? "?." : ".").concat(insertText);
replacementSpan = ts.createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end);
}
if (originIsResolvedExport(origin)) {
@@ -130421,7 +130422,7 @@ var ts;
&& !(type.flags & 1048576 /* Union */ && ts.find(type.types, function (type) { return !!(type.flags & 528 /* BooleanLike */); }))) {
if (type.flags & 402653316 /* StringLike */ || (type.flags & 1048576 /* Union */ && ts.every(type.types, function (type) { return !!(type.flags & (402653316 /* StringLike */ | 32768 /* Undefined */)); }))) {
// If is string like or undefined use quotes
- insertText = ts.escapeSnippetText(name) + "=" + ts.quote(sourceFile, preferences, "$1");
+ insertText = "".concat(ts.escapeSnippetText(name), "=").concat(ts.quote(sourceFile, preferences, "$1"));
isSnippet = true;
}
else {
@@ -130430,7 +130431,7 @@ var ts;
}
}
if (useBraces_1) {
- insertText = ts.escapeSnippetText(name) + "={$1}";
+ insertText = "".concat(ts.escapeSnippetText(name), "={$1}");
isSnippet = true;
}
}
@@ -130715,14 +130716,14 @@ var ts;
var importKind = ts.codefix.getImportKind(sourceFile, exportKind, options, /*forceImportKeyword*/ true);
var isTopLevelTypeOnly = ((_b = (_a = ts.tryCast(importCompletionNode, ts.isImportDeclaration)) === null || _a === void 0 ? void 0 : _a.importClause) === null || _b === void 0 ? void 0 : _b.isTypeOnly) || ((_c = ts.tryCast(importCompletionNode, ts.isImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.isTypeOnly);
var isImportSpecifierTypeOnly = couldBeTypeOnlyImportSpecifier(importCompletionNode, contextToken);
- var topLevelTypeOnlyText = isTopLevelTypeOnly ? " " + ts.tokenToString(151 /* TypeKeyword */) + " " : " ";
- var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? ts.tokenToString(151 /* TypeKeyword */) + " " : "";
+ var topLevelTypeOnlyText = isTopLevelTypeOnly ? " ".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : " ";
+ var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? "".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : "";
var suffix = useSemicolons ? ";" : "";
switch (importKind) {
- case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " = require(" + quotedModuleSpecifier + ")" + suffix };
- case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " from " + quotedModuleSpecifier + suffix };
- case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "* as " + ts.escapeSnippetText(name) + " from " + quotedModuleSpecifier + suffix };
- case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "{ " + importSpecifierTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " } from " + quotedModuleSpecifier + suffix };
+ case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " = require(").concat(quotedModuleSpecifier, ")").concat(suffix) };
+ case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " from ").concat(quotedModuleSpecifier).concat(suffix) };
+ case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "* as ").concat(ts.escapeSnippetText(name), " from ").concat(quotedModuleSpecifier).concat(suffix) };
+ case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "{ ").concat(importSpecifierTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " } from ").concat(quotedModuleSpecifier).concat(suffix) };
}
}
function quotePropertyName(sourceFile, preferences, name) {
@@ -133684,7 +133685,7 @@ var ts;
}
function getDocumentRegistryEntry(bucketEntry, scriptKind) {
var entry = isDocumentRegistryEntry(bucketEntry) ? bucketEntry : bucketEntry.get(ts.Debug.checkDefined(scriptKind, "If there are more than one scriptKind's for same document the scriptKind should be provided"));
- ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:" + scriptKind + " and sourceFile.scriptKind: " + (entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind) + ", !entry: " + !entry);
+ ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:".concat(scriptKind, " and sourceFile.scriptKind: ").concat(entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind, ", !entry: ").concat(!entry));
return entry;
}
function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
@@ -134713,7 +134714,7 @@ var ts;
sourceFile: def.file,
name: def.reference.fileName,
kind: "string" /* string */,
- displayParts: [ts.displayPart("\"" + def.reference.fileName + "\"", ts.SymbolDisplayPartKind.stringLiteral)]
+ displayParts: [ts.displayPart("\"".concat(def.reference.fileName, "\""), ts.SymbolDisplayPartKind.stringLiteral)]
};
}
default:
@@ -135293,7 +135294,7 @@ var ts;
if (symbol.flags & 33554432 /* Transient */)
return undefined;
// Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here.
- ts.Debug.fail("Unexpected symbol at " + ts.Debug.formatSyntaxKind(node.kind) + ": " + ts.Debug.formatSymbol(symbol));
+ ts.Debug.fail("Unexpected symbol at ".concat(ts.Debug.formatSyntaxKind(node.kind), ": ").concat(ts.Debug.formatSymbol(symbol)));
}
return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent)
? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name)
@@ -136578,8 +136579,8 @@ var ts;
var end = pos + 6; /* "static".length */
var typeChecker = program.getTypeChecker();
var symbol = typeChecker.getSymbolAtLocation(node.parent);
- var prefix = symbol ? typeChecker.symbolToString(symbol, node.parent) + " " : "";
- return { text: prefix + "static {}", pos: pos, end: end };
+ var prefix = symbol ? "".concat(typeChecker.symbolToString(symbol, node.parent), " ") : "";
+ return { text: "".concat(prefix, "static {}"), pos: pos, end: end };
}
var declName = isConstNamedExpression(node) ? node.parent.name :
ts.Debug.checkDefined(ts.getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
@@ -137863,7 +137864,7 @@ var ts;
function getJSDocTagCompletions() {
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) {
return {
- name: "@" + tagName,
+ name: "@".concat(tagName),
kind: "keyword" /* keyword */,
kindModifiers: "",
sortText: ts.Completions.SortText.LocationPriority
@@ -137995,11 +137996,11 @@ var ts;
var name = _a.name, dotDotDotToken = _a.dotDotDotToken;
var paramName = name.kind === 79 /* Identifier */ ? name.text : "param" + i;
var type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : "";
- return indentationStr + " * @param " + type + paramName + newLine;
+ return "".concat(indentationStr, " * @param ").concat(type).concat(paramName).concat(newLine);
}).join("");
}
function returnsDocComment(indentationStr, newLine) {
- return indentationStr + " * @returns" + newLine;
+ return "".concat(indentationStr, " * @returns").concat(newLine);
}
function getCommentOwnerInfo(tokenAtPos, options) {
return ts.forEachAncestor(tokenAtPos, function (n) { return getCommentOwnerInfoWorker(n, options); });
@@ -138842,7 +138843,7 @@ var ts;
}
if (name) {
var text = ts.isIdentifier(name) ? name.text
- : ts.isElementAccessExpression(name) ? "[" + nodeText(name.argumentExpression) + "]"
+ : ts.isElementAccessExpression(name) ? "[".concat(nodeText(name.argumentExpression), "]")
: nodeText(name);
if (text.length > 0) {
return cleanText(text);
@@ -138852,7 +138853,7 @@ var ts;
case 303 /* SourceFile */:
var sourceFile = node;
return ts.isExternalModule(sourceFile)
- ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\""
+ ? "\"".concat(ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))), "\"")
: "";
case 270 /* ExportAssignment */:
return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
@@ -139048,10 +139049,10 @@ var ts;
if (name !== undefined) {
name = cleanText(name);
if (name.length > maxLength) {
- return name + " callback";
+ return "".concat(name, " callback");
}
var args = cleanText(ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined; }).join(", "));
- return name + "(" + args + ") callback";
+ return "".concat(name, "(").concat(args, ") callback");
}
}
return "";
@@ -139064,7 +139065,7 @@ var ts;
else if (ts.isPropertyAccessExpression(expr)) {
var left = getCalledExpressionName(expr.expression);
var right = expr.name.text;
- return left === undefined ? right : left + "." + right;
+ return left === undefined ? right : "".concat(left, ".").concat(right);
}
else {
return undefined;
@@ -141511,7 +141512,7 @@ var ts;
var _loop_9 = function (n) {
// If the node is not a subspan of its parent, this is a big problem.
// There have been crashes that might be caused by this violation.
- ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.formatSyntaxKind(n.kind) + ", parent: " + ts.Debug.formatSyntaxKind(n.parent.kind); });
+ ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: ".concat(ts.Debug.formatSyntaxKind(n.kind), ", parent: ").concat(ts.Debug.formatSyntaxKind(n.parent.kind)); });
var argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n, position, sourceFile, checker);
if (argumentInfo) {
return { value: argumentInfo };
@@ -141683,7 +141684,7 @@ var ts;
(function (InlayHints) {
var maxHintsLength = 30;
var leadingParameterNameCommentRegexFactory = function (name) {
- return new RegExp("^\\s?/\\*\\*?\\s?" + name + "\\s?\\*\\/\\s?$");
+ return new RegExp("^\\s?/\\*\\*?\\s?".concat(name, "\\s?\\*\\/\\s?$"));
};
function shouldShowParameterNameHints(preferences) {
return preferences.includeInlayParameterNameHints === "literals" || preferences.includeInlayParameterNameHints === "all";
@@ -141747,7 +141748,7 @@ var ts;
}
function addParameterHints(text, position, isFirstVariadicArgument) {
result.push({
- text: "" + (isFirstVariadicArgument ? "..." : "") + truncation(text, maxHintsLength) + ":",
+ text: "".concat(isFirstVariadicArgument ? "..." : "").concat(truncation(text, maxHintsLength), ":"),
position: position,
kind: "Parameter" /* Parameter */,
whitespaceAfter: true,
@@ -141755,7 +141756,7 @@ var ts;
}
function addTypeHints(text, position) {
result.push({
- text: ": " + truncation(text, maxHintsLength),
+ text: ": ".concat(truncation(text, maxHintsLength)),
position: position,
kind: "Type" /* Type */,
whitespaceBefore: true,
@@ -141763,7 +141764,7 @@ var ts;
}
function addEnumMemberValueHints(text, position) {
result.push({
- text: "= " + truncation(text, maxHintsLength),
+ text: "= ".concat(truncation(text, maxHintsLength)),
position: position,
kind: "Enum" /* Enum */,
whitespaceBefore: true,
@@ -142298,7 +142299,7 @@ var ts;
}
}
function getKeyFromNode(exp) {
- return exp.pos.toString() + ":" + exp.end.toString();
+ return "".concat(exp.pos.toString(), ":").concat(exp.end.toString());
}
function canBeConvertedToClass(node, checker) {
var _a, _b, _c, _d;
@@ -146447,7 +146448,7 @@ var ts;
var insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition);
var token = ts.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position);
var indent = sourceFile.text.slice(lineStartPosition, startPosition);
- var text = (insertAtLineStart ? "" : this.newLineCharacter) + "//" + commentText + this.newLineCharacter + indent;
+ var text = "".concat(insertAtLineStart ? "" : this.newLineCharacter, "//").concat(commentText).concat(this.newLineCharacter).concat(indent);
this.insertText(sourceFile, token.getStart(sourceFile), text);
};
ChangeTracker.prototype.insertJsdocCommentBefore = function (sourceFile, node, tag) {
@@ -146671,7 +146672,7 @@ var ts;
};
ChangeTracker.prototype.getInsertNodeAfterOptions = function (sourceFile, after) {
var options = this.getInsertNodeAfterOptionsWorker(after);
- return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n" + options.prefix : "\n") : options.prefix });
+ return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n".concat(options.prefix) : "\n") : options.prefix });
};
ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) {
switch (node.kind) {
@@ -146705,7 +146706,7 @@ var ts;
}
else {
// `x => {}` -> `function f(x) {}`
- this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function " + name + "(");
+ this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function ".concat(name, "("));
// Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)`
this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */));
}
@@ -146771,7 +146772,7 @@ var ts;
var nextNode = containingList[index + 1];
var startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart());
// write separator and leading trivia of the next element as suffix
- var suffix = "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, startPos);
+ var suffix = "".concat(ts.tokenToString(nextToken.kind)).concat(sourceFile.text.substring(nextToken.end, startPos));
this.insertNodesAt(sourceFile, startPos, [newNode], { suffix: suffix });
}
}
@@ -146816,7 +146817,7 @@ var ts;
this.replaceRange(sourceFile, ts.createRange(insertPos), newNode, { indentation: indentation, prefix: this.newLineCharacter });
}
else {
- this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + " " });
+ this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: "".concat(ts.tokenToString(separator), " ") });
}
}
};
@@ -146947,7 +146948,7 @@ var ts;
var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); });
var _loop_12 = function (i) {
ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () {
- return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range);
+ return "".concat(JSON.stringify(normalized[i].range), " and ").concat(JSON.stringify(normalized[i + 1].range));
});
};
// verify that change intervals do not overlap, except possibly at end points.
@@ -147038,7 +147039,7 @@ var ts;
function applyChanges(text, changes) {
for (var i = changes.length - 1; i >= 0; i--) {
var _a = changes[i], span = _a.span, newText = _a.newText;
- text = "" + text.substring(0, span.start) + newText + text.substring(ts.textSpanEnd(span));
+ text = "".concat(text.substring(0, span.start)).concat(newText).concat(text.substring(ts.textSpanEnd(span)));
}
return text;
}
@@ -149523,7 +149524,7 @@ var ts;
if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind)
|| checker.resolveName(text, node, 111551 /* Value */, /*excludeGlobals*/ true))) {
// Unconditionally add an underscore in case `text` is a keyword.
- res.set(text, makeUniqueName("_" + text, identifiers));
+ res.set(text, makeUniqueName("_".concat(text), identifiers));
}
});
return res;
@@ -149623,7 +149624,7 @@ var ts;
// `const a = require("b").c` --> `import { c as a } from "./b";
return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]);
default:
- return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form " + name.kind);
+ return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form ".concat(name.kind));
}
}
function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) {
@@ -149674,7 +149675,7 @@ var ts;
case 168 /* MethodDeclaration */:
return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(93 /* ExportKeyword */)], prop, useSitesToUnqualify);
default:
- ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind);
+ ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind ".concat(prop.kind));
}
});
return statements && [statements, false];
@@ -149806,7 +149807,7 @@ var ts;
case 79 /* Identifier */:
return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference);
default:
- return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind " + name.kind);
+ return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind ".concat(name.kind));
}
}
/**
@@ -149863,7 +149864,7 @@ var ts;
// Identifiers helpers
function makeUniqueName(name, identifiers) {
while (identifiers.original.has(name) || identifiers.additional.has(name)) {
- name = "_" + name;
+ name = "_".concat(name);
}
identifiers.additional.add(name);
return name;
@@ -149943,7 +149944,7 @@ var ts;
if (!qualifiedName)
return undefined;
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); });
- var newText = qualifiedName.left.text + "[\"" + qualifiedName.right.text + "\"]";
+ var newText = "".concat(qualifiedName.left.text, "[\"").concat(qualifiedName.right.text, "\"]");
return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, ts.Diagnostics.Rewrite_all_as_indexed_access_types)];
},
fixIds: [fixId],
@@ -150345,7 +150346,7 @@ var ts;
// Excluding from fix-all
break;
default:
- ts.Debug.assertNever(fix, "fix wasn't never - got kind " + fix.kind);
+ ts.Debug.assertNever(fix, "fix wasn't never - got kind ".concat(fix.kind));
}
function reduceAddAsTypeOnlyValues(prevValue, newValue) {
// `NotAllowed` overrides `Required` because one addition of a new import might be required to be type-only
@@ -150389,7 +150390,7 @@ var ts;
return newEntry;
}
function newImportsKey(moduleSpecifier, topLevelTypeOnly) {
- return (topLevelTypeOnly ? 1 : 0) + "|" + moduleSpecifier;
+ return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier);
}
}
function writeFixes(changeTracker) {
@@ -150887,7 +150888,7 @@ var ts;
case ts.ModuleKind.NodeNext:
return importingFile.impliedNodeFormat === ts.ModuleKind.ESNext ? 2 /* Namespace */ : 3 /* CommonJS */;
default:
- return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind " + moduleKind);
+ return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind ".concat(moduleKind));
}
}
function getFixesInfoForNonUMDImport(_a, symbolToken, useAutoImportProvider) {
@@ -151010,7 +151011,7 @@ var ts;
switch (fix.kind) {
case 0 /* UseNamespace */:
addNamespaceQualifier(changes, sourceFile, fix);
- return [ts.Diagnostics.Change_0_to_1, symbolName, fix.namespacePrefix + "." + symbolName];
+ return [ts.Diagnostics.Change_0_to_1, symbolName, "".concat(fix.namespacePrefix, ".").concat(symbolName)];
case 1 /* JsdocTypeImport */:
addImportType(changes, sourceFile, fix, quotePreference);
return [ts.Diagnostics.Change_0_to_1, symbolName, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName];
@@ -151041,7 +151042,7 @@ var ts;
: [ts.Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
}
default:
- return ts.Debug.assertNever(fix, "Unexpected fix kind " + fix.kind);
+ return ts.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind));
}
}
function getModuleSpecifierText(promotedDeclaration) {
@@ -151194,7 +151195,7 @@ var ts;
}
function getImportTypePrefix(moduleSpecifier, quotePreference) {
var quote = ts.getQuoteFromPreference(quotePreference);
- return "import(" + quote + moduleSpecifier + quote + ").";
+ return "import(".concat(quote).concat(moduleSpecifier).concat(quote, ").");
}
function needsTypeOnly(_a) {
var addAsTypeOnly = _a.addAsTypeOnly;
@@ -151290,7 +151291,7 @@ var ts;
lastCharWasValid = isValid;
}
// Need `|| "_"` to ensure result isn't empty.
- return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res;
+ return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_".concat(res);
}
codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier;
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -152546,7 +152547,7 @@ var ts;
break;
}
default:
- ts.Debug.fail("Bad fixId: " + context.fixId);
+ ts.Debug.fail("Bad fixId: ".concat(context.fixId));
}
});
},
@@ -152994,7 +152995,7 @@ var ts;
if (!isValidCharacter(character)) {
return;
}
- var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(sourceFile, preferences, character) + "}";
+ var replacement = useHtmlEntity ? htmlEntity[character] : "{".concat(ts.quote(sourceFile, preferences, character), "}");
changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement);
}
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -153274,11 +153275,11 @@ var ts;
token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name;
}
if (ts.isIdentifier(token) && canPrefix(token)) {
- changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_" + token.text));
+ changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_".concat(token.text)));
if (ts.isParameter(token.parent)) {
ts.getJSDocParameterTags(token.parent).forEach(function (tag) {
if (ts.isIdentifier(tag.name)) {
- changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_" + tag.name.text));
+ changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_".concat(tag.name.text)));
}
});
}
@@ -153620,7 +153621,7 @@ var ts;
}); }
});
function doChange(changes, sourceFile, name) {
- changes.replaceNodeWithText(sourceFile, name, name.text + "()");
+ changes.replaceNodeWithText(sourceFile, name, "".concat(name.text, "()"));
}
function getCallName(sourceFile, start) {
var token = ts.getTokenAtPosition(sourceFile, start);
@@ -154744,7 +154745,7 @@ var ts;
var parameters = [];
var length = Math.max.apply(Math, calls.map(function (c) { return c.argumentTypes.length; }));
var _loop_16 = function (i) {
- var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg" + i));
+ var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg".concat(i)));
symbol.type = combineTypes(calls.map(function (call) { return call.argumentTypes[i] || checker.getUndefinedType(); }));
if (calls.some(function (call) { return call.argumentTypes[i] === undefined; })) {
symbol.flags |= 16777216 /* Optional */;
@@ -154847,7 +154848,7 @@ var ts;
codefix.createCodeFixActionWithoutFixAll(fixName, [codefix.createFileTextChanges(sourceFile.fileName, [
ts.createTextChange(sourceFile.checkJsDirective
? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end)
- : ts.createTextSpan(0, 0), "// @ts-nocheck" + newLineCharacter),
+ : ts.createTextSpan(0, 0), "// @ts-nocheck".concat(newLineCharacter)),
])], ts.Diagnostics.Disable_checking_for_this_file),
];
if (ts.textChanges.isValidLocationToAddComment(sourceFile, span.start)) {
@@ -155113,7 +155114,7 @@ var ts;
var typeParameters = isJs || typeArguments === undefined
? undefined
: ts.map(typeArguments, function (_, i) {
- return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T" + i);
+ return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T".concat(i));
});
var parameters = createDummyParameters(args.length, names, types, /*minArgumentCount*/ undefined, isJs);
var type = isJs || contextualType === undefined
@@ -155148,7 +155149,7 @@ var ts;
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
- /*name*/ names && names[i] || "arg" + i,
+ /*name*/ names && names[i] || "arg".concat(i),
/*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.factory.createToken(57 /* QuestionToken */) : undefined,
/*type*/ inJs ? undefined : types && types[i] || ts.factory.createKeywordTypeNode(130 /* AnyKeyword */),
/*initializer*/ undefined);
@@ -155399,7 +155400,7 @@ var ts;
}
var name = declaration.name.text;
var startWithUnderscore = ts.startsWithUnderscore(name);
- var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file), declaration.name);
+ var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_".concat(name), file), declaration.name);
var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name);
return {
isStatic: ts.hasStaticModifier(declaration),
@@ -156438,7 +156439,7 @@ var ts;
changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text)));
break;
default:
- ts.Debug.fail("Unexpected exportNode kind " + exportNode.kind);
+ ts.Debug.fail("Unexpected exportNode kind ".concat(exportNode.kind));
}
}
}
@@ -156526,7 +156527,7 @@ var ts;
break;
}
default:
- ts.Debug.assertNever(parent, "Unexpected parent kind " + parent.kind);
+ ts.Debug.assertNever(parent, "Unexpected parent kind ".concat(parent.kind));
}
}
function makeImportSpecifier(propertyName, name) {
@@ -157109,7 +157110,7 @@ var ts;
var newComment = ts.displayPartsToString(parameterDocComment);
if (newComment.length) {
ts.setSyntheticLeadingComments(result, [{
- text: "*\n" + newComment.split("\n").map(function (c) { return " * " + c; }).join("\n") + "\n ",
+ text: "*\n".concat(newComment.split("\n").map(function (c) { return " * ".concat(c); }).join("\n"), "\n "),
kind: 3 /* MultiLineCommentTrivia */,
pos: -1,
end: -1,
@@ -157254,7 +157255,7 @@ var ts;
usedFunctionNames.set(description, true);
functionActions.push({
description: description,
- name: "function_scope_" + i,
+ name: "function_scope_".concat(i),
kind: extractFunctionAction.kind
});
}
@@ -157262,7 +157263,7 @@ var ts;
else if (!innermostErrorFunctionAction) {
innermostErrorFunctionAction = {
description: description,
- name: "function_scope_" + i,
+ name: "function_scope_".concat(i),
notApplicableReason: getStringError(functionExtraction.errors),
kind: extractFunctionAction.kind
};
@@ -157278,7 +157279,7 @@ var ts;
usedConstantNames.set(description_1, true);
constantActions.push({
description: description_1,
- name: "constant_scope_" + i,
+ name: "constant_scope_".concat(i),
kind: extractConstantAction.kind
});
}
@@ -157286,7 +157287,7 @@ var ts;
else if (!innermostErrorConstantAction) {
innermostErrorConstantAction = {
description: description,
- name: "constant_scope_" + i,
+ name: "constant_scope_".concat(i),
notApplicableReason: getStringError(constantExtraction.errors),
kind: extractConstantAction.kind
};
@@ -157428,7 +157429,7 @@ var ts;
// cannot find either start or end node
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };
}
- if (ts.isJSDoc(start)) {
+ if (start.flags & 4194304 /* JSDoc */) {
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractJSDoc)] };
}
if (start.parent !== end.parent) {
@@ -157870,28 +157871,28 @@ var ts;
case 212 /* FunctionExpression */:
case 255 /* FunctionDeclaration */:
return scope.name
- ? "function '" + scope.name.text + "'"
+ ? "function '".concat(scope.name.text, "'")
: ts.ANONYMOUS;
case 213 /* ArrowFunction */:
return "arrow function";
case 168 /* MethodDeclaration */:
- return "method '" + scope.name.getText() + "'";
+ return "method '".concat(scope.name.getText(), "'");
case 171 /* GetAccessor */:
- return "'get " + scope.name.getText() + "'";
+ return "'get ".concat(scope.name.getText(), "'");
case 172 /* SetAccessor */:
- return "'set " + scope.name.getText() + "'";
+ return "'set ".concat(scope.name.getText(), "'");
default:
- throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind);
+ throw ts.Debug.assertNever(scope, "Unexpected scope kind ".concat(scope.kind));
}
}
function getDescriptionForClassLikeDeclaration(scope) {
return scope.kind === 256 /* ClassDeclaration */
- ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration"
- : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression";
+ ? scope.name ? "class '".concat(scope.name.text, "'") : "anonymous class declaration"
+ : scope.name ? "class expression '".concat(scope.name.text, "'") : "anonymous class expression";
}
function getDescriptionForModuleLikeDeclaration(scope) {
return scope.kind === 261 /* ModuleBlock */
- ? "namespace '" + scope.parent.name.getText() + "'"
+ ? "namespace '".concat(scope.parent.name.getText(), "'")
: scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */;
}
var SpecialScope;
@@ -159367,7 +159368,7 @@ var ts;
case 253 /* VariableDeclaration */:
return ts.tryCast(node.name, ts.isIdentifier);
default:
- return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
+ return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
}
}
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) {
@@ -159404,7 +159405,7 @@ var ts;
case 253 /* VariableDeclaration */:
return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString));
default:
- return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
+ return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
}
}
function moduleSpecifierFromImport(i) {
@@ -159491,7 +159492,7 @@ var ts;
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
break;
default:
- ts.Debug.assertNever(importDecl, "Unexpected import decl kind " + importDecl.kind);
+ ts.Debug.assertNever(importDecl, "Unexpected import decl kind ".concat(importDecl.kind));
}
}
function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused) {
@@ -159591,7 +159592,7 @@ var ts;
var name = ts.combinePaths(inDirectory, newModuleName + extension);
if (!host.fileExists(name))
return newModuleName; // TODO: GH#18217
- newModuleName = moduleName + "." + i;
+ newModuleName = "".concat(moduleName, ".").concat(i);
}
}
function getNewModuleName(movedSymbols) {
@@ -159698,7 +159699,7 @@ var ts;
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined;
}
default:
- return ts.Debug.assertNever(i, "Unexpected import kind " + i.kind);
+ return ts.Debug.assertNever(i, "Unexpected import kind ".concat(i.kind));
}
}
function filterNamedBindings(namedBindings, keep) {
@@ -159813,7 +159814,7 @@ var ts;
case 200 /* ObjectBindingPattern */:
return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); });
default:
- return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind);
+ return ts.Debug.assertNever(name, "Unexpected name kind ".concat(name.kind));
}
}
function nameOfTopLevelDeclaration(d) {
@@ -159874,7 +159875,7 @@ var ts;
case 237 /* ExpressionStatement */:
return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...`
default:
- return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind);
+ return ts.Debug.assertNever(d, "Unexpected declaration kind ".concat(d.kind));
}
}
function addCommonjsExport(decl) {
@@ -159896,7 +159897,7 @@ var ts;
case 237 /* ExpressionStatement */:
return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...`
default:
- return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind);
+ return ts.Debug.assertNever(decl, "Unexpected decl kind ".concat(decl.kind));
}
}
/** Creates `exports.x = x;` */
@@ -160534,7 +160535,7 @@ var ts;
return [functionDeclaration.name, functionDeclaration.parent.name];
return [functionDeclaration.parent.name];
default:
- return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind " + functionDeclaration.kind);
+ return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind ".concat(functionDeclaration.kind));
}
}
})(convertParamsToDestructuredObject = refactor.convertParamsToDestructuredObject || (refactor.convertParamsToDestructuredObject = {}));
@@ -161238,7 +161239,7 @@ var ts;
var textPos = ts.scanner.getTextPos();
if (textPos <= end) {
if (token === 79 /* Identifier */) {
- ts.Debug.fail("Did not expect " + ts.Debug.formatSyntaxKind(parent.kind) + " to have an Identifier in its trivia");
+ ts.Debug.fail("Did not expect ".concat(ts.Debug.formatSyntaxKind(parent.kind), " to have an Identifier in its trivia"));
}
nodes.push(createNode(token, pos, textPos, parent));
}
@@ -162168,7 +162169,7 @@ var ts;
function getValidSourceFile(fileName) {
var sourceFile = program.getSourceFile(fileName);
if (!sourceFile) {
- var error = new Error("Could not find source file: '" + fileName + "'.");
+ var error = new Error("Could not find source file: '".concat(fileName, "'."));
// We've been having trouble debugging this, so attach sidecar data for the tsserver log.
// See https://github.com/microsoft/TypeScript/issues/30180.
error.ProgramFiles = program.getSourceFiles().map(function (f) { return f.fileName; });
@@ -162844,7 +162845,7 @@ var ts;
var element = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningElement(token.parent) ? token.parent.parent
: ts.isJsxText(token) && ts.isJsxElement(token.parent) ? token.parent : undefined;
if (element && isUnclosedTag(element)) {
- return { newText: "" + element.openingElement.tagName.getText(sourceFile) + ">" };
+ return { newText: "".concat(element.openingElement.tagName.getText(sourceFile), ">") };
}
var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent
: ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined;
@@ -162950,7 +162951,7 @@ var ts;
pos = commentRange.end + 1;
}
else { // If it's not in a comment range, then we need to comment the uncommented portions.
- var newPos = text.substring(pos, textRange.end).search("(" + openMultilineRegex + ")|(" + closeMultilineRegex + ")");
+ var newPos = text.substring(pos, textRange.end).search("(".concat(openMultilineRegex, ")|(").concat(closeMultilineRegex, ")"));
isCommenting = insertComment !== undefined
? insertComment
: isCommenting || !ts.isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); // If isCommenting is already true we don't need to check whitespace again.
@@ -163345,14 +163346,14 @@ var ts;
case ts.LanguageServiceMode.PartialSemantic:
invalidOperationsInPartialSemanticMode.forEach(function (key) {
return ls[key] = function () {
- throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.PartialSemantic");
+ throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.PartialSemantic"));
};
});
break;
case ts.LanguageServiceMode.Syntactic:
invalidOperationsInSyntacticMode.forEach(function (key) {
return ls[key] = function () {
- throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.Syntactic");
+ throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.Syntactic"));
};
});
break;
@@ -164334,13 +164335,13 @@ var ts;
var result = action();
if (logPerformance) {
var end = ts.timestamp();
- logger.log(actionDescription + " completed in " + (end - start) + " msec");
+ logger.log("".concat(actionDescription, " completed in ").concat(end - start, " msec"));
if (ts.isString(result)) {
var str = result;
if (str.length > 128) {
str = str.substring(0, 128) + "...";
}
- logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'");
+ logger.log(" result.length=".concat(str.length, ", result='").concat(JSON.stringify(str), "'"));
}
}
return result;
@@ -164422,7 +164423,7 @@ var ts;
* Update the list of scripts known to the compiler
*/
LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
- this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; } // eslint-disable-line no-null/no-null
+ this.forwardJSONCall("refresh(".concat(throwOnError, ")"), function () { return null; } // eslint-disable-line no-null/no-null
);
};
LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
@@ -164438,43 +164439,43 @@ var ts;
};
LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
+ return this.forwardJSONCall("getSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
};
LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
+ return this.forwardJSONCall("getSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
};
LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")",
+ return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
// directly serialize the spans out to a string. This is much faster to decode
// on the managed side versus a full JSON array.
function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
};
LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")",
+ return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
// directly serialize the spans out to a string. This is much faster to decode
// on the managed side versus a full JSON array.
function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
};
LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () {
+ return this.forwardJSONCall("getSyntacticDiagnostics('".concat(fileName, "')"), function () {
var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
return _this.realizeDiagnostics(diagnostics);
});
};
LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () {
+ return this.forwardJSONCall("getSemanticDiagnostics('".concat(fileName, "')"), function () {
var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
return _this.realizeDiagnostics(diagnostics);
});
};
LanguageServiceShimObject.prototype.getSuggestionDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSuggestionDiagnostics('" + fileName + "')", function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
+ return this.forwardJSONCall("getSuggestionDiagnostics('".concat(fileName, "')"), function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
};
LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
var _this = this;
@@ -164490,7 +164491,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
+ return this.forwardJSONCall("getQuickInfoAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
};
/// NAMEORDOTTEDNAMESPAN
/**
@@ -164499,7 +164500,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
var _this = this;
- return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
+ return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(fileName, "', ").concat(startPos, ", ").concat(endPos, ")"), function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
};
/**
* STATEMENTSPAN
@@ -164507,12 +164508,12 @@ var ts;
*/
LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
+ return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
};
/// SIGNATUREHELP
LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
+ return this.forwardJSONCall("getSignatureHelpItems('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
};
/// GOTO DEFINITION
/**
@@ -164521,7 +164522,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
+ return this.forwardJSONCall("getDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
};
/**
* Computes the definition location and file for the symbol
@@ -164529,7 +164530,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getDefinitionAndBoundSpan = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getDefinitionAndBoundSpan('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
+ return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
};
/// GOTO Type
/**
@@ -164538,7 +164539,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
+ return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
};
/// GOTO Implementation
/**
@@ -164547,37 +164548,37 @@ var ts;
*/
LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
+ return this.forwardJSONCall("getImplementationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position, options); });
+ return this.forwardJSONCall("getRenameInfo('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getRenameInfo(fileName, position, options); });
};
LanguageServiceShimObject.prototype.getSmartSelectionRange = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getSmartSelectionRange('" + fileName + "', " + position + ")", function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
+ return this.forwardJSONCall("getSmartSelectionRange('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
};
LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) {
var _this = this;
- return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ", " + providePrefixAndSuffixTextForRename + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
+ return this.forwardJSONCall("findRenameLocations('".concat(fileName, "', ").concat(position, ", ").concat(findInStrings, ", ").concat(findInComments, ", ").concat(providePrefixAndSuffixTextForRename, ")"), function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
};
/// GET BRACE MATCHING
LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
+ return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
var _this = this;
- return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
+ return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(openingBrace, ")"), function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
};
LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) {
var _this = this;
- return this.forwardJSONCall("getSpanOfEnclosingComment('" + fileName + "', " + position + ")", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
+ return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
};
/// GET SMART INDENT
LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) {
var _this = this;
- return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () {
+ return this.forwardJSONCall("getIndentationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
});
@@ -164585,23 +164586,23 @@ var ts;
/// GET REFERENCES
LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
+ return this.forwardJSONCall("getReferencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); });
+ return this.forwardJSONCall("findReferences('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.findReferences(fileName, position); });
};
LanguageServiceShimObject.prototype.getFileReferences = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getFileReferences('" + fileName + ")", function () { return _this.languageService.getFileReferences(fileName); });
+ return this.forwardJSONCall("getFileReferences('".concat(fileName, ")"), function () { return _this.languageService.getFileReferences(fileName); });
};
LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
+ return this.forwardJSONCall("getOccurrencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
var _this = this;
- return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () {
+ return this.forwardJSONCall("getDocumentHighlights('".concat(fileName, "', ").concat(position, ")"), function () {
var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
// workaround for VS document highlighting issue - keep only items from the initial file
var normalizedName = ts.toFileNameLowerCase(ts.normalizeSlashes(fileName));
@@ -164616,108 +164617,108 @@ var ts;
*/
LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences, formattingSettings) {
var _this = this;
- return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ", " + formattingSettings + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
+ return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ", ").concat(formattingSettings, ")"), function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
};
/** Get a string based representation of a completion list entry details */
LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, formatOptions, source, preferences, data) {
var _this = this;
- return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () {
+ return this.forwardJSONCall("getCompletionEntryDetails('".concat(fileName, "', ").concat(position, ", '").concat(entryName, "')"), function () {
var localOptions = formatOptions === undefined ? undefined : JSON.parse(formatOptions);
return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () {
+ return this.forwardJSONCall("getFormattingEditsForRange('".concat(fileName, "', ").concat(start, ", ").concat(end, ")"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () {
+ return this.forwardJSONCall("getFormattingEditsForDocument('".concat(fileName, "')"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () {
+ return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(fileName, "', ").concat(position, ", '").concat(key, "')"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
});
};
LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
+ return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
};
/// NAVIGATE TO
/** Return a list of symbols that are interesting to navigate to */
LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ", " + fileName + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
+ return this.forwardJSONCall("getNavigateToItems('".concat(searchValue, "', ").concat(maxResultCount, ", ").concat(fileName, ")"), function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
};
LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); });
+ return this.forwardJSONCall("getNavigationBarItems('".concat(fileName, "')"), function () { return _this.languageService.getNavigationBarItems(fileName); });
};
LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
+ return this.forwardJSONCall("getNavigationTree('".concat(fileName, "')"), function () { return _this.languageService.getNavigationTree(fileName); });
};
LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
+ return this.forwardJSONCall("getOutliningSpans('".concat(fileName, "')"), function () { return _this.languageService.getOutliningSpans(fileName); });
};
LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
var _this = this;
- return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
+ return this.forwardJSONCall("getTodoComments('".concat(fileName, "')"), function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
};
/// CALL HIERARCHY
LanguageServiceShimObject.prototype.prepareCallHierarchy = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("prepareCallHierarchy('" + fileName + "', " + position + ")", function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
+ return this.forwardJSONCall("prepareCallHierarchy('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
};
LanguageServiceShimObject.prototype.provideCallHierarchyIncomingCalls = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("provideCallHierarchyIncomingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
+ return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
};
LanguageServiceShimObject.prototype.provideCallHierarchyOutgoingCalls = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
+ return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
};
LanguageServiceShimObject.prototype.provideInlayHints = function (fileName, span, preference) {
var _this = this;
- return this.forwardJSONCall("provideInlayHints('" + fileName + "', '" + JSON.stringify(span) + "', " + JSON.stringify(preference) + ")", function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
+ return this.forwardJSONCall("provideInlayHints('".concat(fileName, "', '").concat(JSON.stringify(span), "', ").concat(JSON.stringify(preference), ")"), function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
};
/// Emit
LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () {
+ return this.forwardJSONCall("getEmitOutput('".concat(fileName, "')"), function () {
var _a = _this.languageService.getEmitOutput(fileName), diagnostics = _a.diagnostics, rest = __rest(_a, ["diagnostics"]);
return __assign(__assign({}, rest), { diagnostics: _this.realizeDiagnostics(diagnostics) });
});
};
LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
var _this = this;
- return forwardCall(this.logger, "getEmitOutput('" + fileName + "')",
+ return forwardCall(this.logger, "getEmitOutput('".concat(fileName, "')"),
/*returnJson*/ false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
};
LanguageServiceShimObject.prototype.toggleLineComment = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("toggleLineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleLineComment(fileName, textRange); });
+ return this.forwardJSONCall("toggleLineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleLineComment(fileName, textRange); });
};
LanguageServiceShimObject.prototype.toggleMultilineComment = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("toggleMultilineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
+ return this.forwardJSONCall("toggleMultilineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
};
LanguageServiceShimObject.prototype.commentSelection = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("commentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.commentSelection(fileName, textRange); });
+ return this.forwardJSONCall("commentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.commentSelection(fileName, textRange); });
};
LanguageServiceShimObject.prototype.uncommentSelection = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("uncommentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.uncommentSelection(fileName, textRange); });
+ return this.forwardJSONCall("uncommentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.uncommentSelection(fileName, textRange); });
};
return LanguageServiceShimObject;
}(ShimBase));
@@ -164767,7 +164768,7 @@ var ts;
};
CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("resolveModuleName('" + fileName + "')", function () {
+ return this.forwardJSONCall("resolveModuleName('".concat(fileName, "')"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;
@@ -164782,7 +164783,7 @@ var ts;
};
CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("resolveTypeReferenceDirective(" + fileName + ")", function () {
+ return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(fileName, ")"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
return {
@@ -164794,7 +164795,7 @@ var ts;
};
CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
var _this = this;
- return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () {
+ return this.forwardJSONCall("getPreProcessedFileInfo('".concat(fileName, "')"), function () {
// for now treat files as JavaScript
var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true);
return {
@@ -164809,7 +164810,7 @@ var ts;
};
CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("getAutomaticTypeDirectiveNames('" + compilerOptionsJson + "')", function () {
+ return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(compilerOptionsJson, "')"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
});
@@ -164831,7 +164832,7 @@ var ts;
};
CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
var _this = this;
- return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () {
+ return this.forwardJSONCall("getTSConfigFileInfo('".concat(fileName, "')"), function () {
var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot));
var normalizedFileName = ts.normalizeSlashes(fileName);
var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName);
@@ -165021,7 +165022,7 @@ var ts;
}
Errors.ThrowProjectLanguageServiceDisabled = ThrowProjectLanguageServiceDisabled;
function ThrowProjectDoesNotContainDocument(fileName, project) {
- throw new Error("Project '" + project.getProjectName() + "' does not contain document '" + fileName + "'");
+ throw new Error("Project '".concat(project.getProjectName(), "' does not contain document '").concat(fileName, "'"));
}
Errors.ThrowProjectDoesNotContainDocument = ThrowProjectDoesNotContainDocument;
})(Errors = server.Errors || (server.Errors = {}));
@@ -165062,12 +165063,12 @@ var ts;
}
server.isInferredProjectName = isInferredProjectName;
function makeInferredProjectName(counter) {
- return "/dev/null/inferredProject" + counter + "*";
+ return "/dev/null/inferredProject".concat(counter, "*");
}
server.makeInferredProjectName = makeInferredProjectName;
/*@internal*/
function makeAutoImportProviderProjectName(counter) {
- return "/dev/null/autoImportProviderProject" + counter + "*";
+ return "/dev/null/autoImportProviderProject".concat(counter, "*");
}
server.makeAutoImportProviderProjectName = makeAutoImportProviderProjectName;
function createSortedArray() {
@@ -165102,7 +165103,7 @@ var ts;
// schedule new operation, pass arguments
this.pendingTimeouts.set(operationId, this.host.setTimeout(ThrottledOperations.run, delay, this, operationId, cb));
if (this.logger) {
- this.logger.info("Scheduled: " + operationId + (pendingTimeout ? ", Cancelled earlier one" : ""));
+ this.logger.info("Scheduled: ".concat(operationId).concat(pendingTimeout ? ", Cancelled earlier one" : ""));
}
};
ThrottledOperations.prototype.cancel = function (operationId) {
@@ -165116,7 +165117,7 @@ var ts;
ts.perfLogger.logStartScheduledOperation(operationId);
self.pendingTimeouts.delete(operationId);
if (self.logger) {
- self.logger.info("Running: " + operationId);
+ self.logger.info("Running: ".concat(operationId));
}
cb();
ts.perfLogger.logStopScheduledOperation();
@@ -165145,7 +165146,7 @@ var ts;
self.host.gc(); // TODO: GH#18217
if (log) {
var after = self.host.getMemoryUsage(); // TODO: GH#18217
- self.logger.perftrc("GC::before " + before + ", after " + after);
+ self.logger.perftrc("GC::before ".concat(before, ", after ").concat(after));
}
ts.perfLogger.logStopScheduledOperation();
};
@@ -165498,8 +165499,8 @@ var ts;
}
TextStorage.prototype.getVersion = function () {
return this.svc
- ? "SVC-" + this.version.svc + "-" + this.svc.getSnapshotVersion()
- : "Text-" + this.version.text;
+ ? "SVC-".concat(this.version.svc, "-").concat(this.svc.getSnapshotVersion())
+ : "Text-".concat(this.version.text);
};
TextStorage.prototype.hasScriptVersionCache_TestOnly = function () {
return this.svc !== undefined;
@@ -165642,7 +165643,7 @@ var ts;
if (fileSize > server.maxFileSize) {
ts.Debug.assert(!!this.info.containingProjects.length);
var service = this.info.containingProjects[0].projectService;
- service.logger.info("Skipped loading contents of large file " + fileName + " for info " + this.info.fileName + ": fileSize: " + fileSize);
+ service.logger.info("Skipped loading contents of large file ".concat(fileName, " for info ").concat(this.info.fileName, ": fileSize: ").concat(fileSize));
this.info.containingProjects[0].projectService.sendLargeFileReferencedEvent(fileName, fileSize);
return { text: "", fileSize: fileSize };
}
@@ -166018,14 +166019,14 @@ var ts;
return project;
}
function failIfInvalidPosition(position) {
- ts.Debug.assert(typeof position === "number", "Expected position " + position + " to be a number.");
+ ts.Debug.assert(typeof position === "number", "Expected position ".concat(position, " to be a number."));
ts.Debug.assert(position >= 0, "Expected position to be non-negative.");
}
function failIfInvalidLocation(location) {
- ts.Debug.assert(typeof location.line === "number", "Expected line " + location.line + " to be a number.");
- ts.Debug.assert(typeof location.offset === "number", "Expected offset " + location.offset + " to be a number.");
- ts.Debug.assert(location.line > 0, "Expected line to be non-" + (location.line === 0 ? "zero" : "negative"));
- ts.Debug.assert(location.offset > 0, "Expected offset to be non-" + (location.offset === 0 ? "zero" : "negative"));
+ ts.Debug.assert(typeof location.line === "number", "Expected line ".concat(location.line, " to be a number."));
+ ts.Debug.assert(typeof location.offset === "number", "Expected offset ".concat(location.offset, " to be a number."));
+ ts.Debug.assert(location.line > 0, "Expected line to be non-".concat(location.line === 0 ? "zero" : "negative"));
+ ts.Debug.assert(location.offset > 0, "Expected offset to be non-".concat(location.offset === 0 ? "zero" : "negative"));
}
})(server = ts.server || (ts.server = {}));
})(ts || (ts = {}));
@@ -166337,11 +166338,11 @@ var ts;
};
Project.resolveModule = function (moduleName, initialDir, host, log, logErrors) {
var resolvedPath = ts.normalizeSlashes(host.resolvePath(ts.combinePaths(initialDir, "node_modules")));
- log("Loading " + moduleName + " from " + initialDir + " (resolved to " + resolvedPath + ")");
+ log("Loading ".concat(moduleName, " from ").concat(initialDir, " (resolved to ").concat(resolvedPath, ")"));
var result = host.require(resolvedPath, moduleName); // TODO: GH#18217
if (result.error) {
var err = result.error.stack || result.error.message || JSON.stringify(result.error);
- (logErrors || log)("Failed to load module '" + moduleName + "' from " + resolvedPath + ": " + err);
+ (logErrors || log)("Failed to load module '".concat(moduleName, "' from ").concat(resolvedPath, ": ").concat(err));
return undefined;
}
return result.module;
@@ -166492,12 +166493,12 @@ var ts;
};
/*@internal*/
Project.prototype.clearInvalidateResolutionOfFailedLookupTimer = function () {
- return this.projectService.throttledOperations.cancel(this.getProjectName() + "FailedLookupInvalidation");
+ return this.projectService.throttledOperations.cancel("".concat(this.getProjectName(), "FailedLookupInvalidation"));
};
/*@internal*/
Project.prototype.scheduleInvalidateResolutionsOfFailedLookupLocations = function () {
var _this = this;
- this.projectService.throttledOperations.schedule(this.getProjectName() + "FailedLookupInvalidation", /*delay*/ 1000, function () {
+ this.projectService.throttledOperations.schedule("".concat(this.getProjectName(), "FailedLookupInvalidation"), /*delay*/ 1000, function () {
if (_this.resolutionCache.invalidateResolutionsOfFailedLookupLocations()) {
_this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(_this);
}
@@ -166675,7 +166676,7 @@ var ts;
return plugin.module.getExternalFiles(_this);
}
catch (e) {
- _this.projectService.logger.info("A plugin threw an exception in getExternalFiles: " + e);
+ _this.projectService.logger.info("A plugin threw an exception in getExternalFiles: ".concat(e));
if (e.stack) {
_this.projectService.logger.info(e.stack);
}
@@ -166778,7 +166779,7 @@ var ts;
}
return ts.map(this.program.getSourceFiles(), function (sourceFile) {
var scriptInfo = _this.projectService.getScriptInfoForPath(sourceFile.resolvedPath);
- ts.Debug.assert(!!scriptInfo, "getScriptInfo", function () { return "scriptInfo for a file '" + sourceFile.fileName + "' Path: '" + sourceFile.path + "' / '" + sourceFile.resolvedPath + "' is missing."; });
+ ts.Debug.assert(!!scriptInfo, "getScriptInfo", function () { return "scriptInfo for a file '".concat(sourceFile.fileName, "' Path: '").concat(sourceFile.path, "' / '").concat(sourceFile.resolvedPath, "' is missing."); });
return scriptInfo;
});
};
@@ -167021,7 +167022,7 @@ var ts;
var _this = this;
var oldProgram = this.program;
ts.Debug.assert(!this.isClosed(), "Called update graph worker of closed project");
- this.writeLog("Starting updateGraphWorker: Project: " + this.getProjectName());
+ this.writeLog("Starting updateGraphWorker: Project: ".concat(this.getProjectName()));
var start = ts.timestamp();
this.hasInvalidatedResolution = this.resolutionCache.createHasInvalidatedResolution();
this.resolutionCache.startCachingPerDirectoryResolution();
@@ -167123,7 +167124,7 @@ var ts;
}, function (removed) { return _this.detachScriptInfoFromProject(removed); });
var elapsed = ts.timestamp() - start;
this.sendPerformanceEvent("UpdateGraph", elapsed);
- this.writeLog("Finishing updateGraphWorker: Project: " + this.getProjectName() + " Version: " + this.getProjectVersion() + " structureChanged: " + hasNewProgram + (this.program ? " structureIsReused:: " + ts.StructureIsReused[this.program.structureIsReused] : "") + " Elapsed: " + elapsed + "ms");
+ this.writeLog("Finishing updateGraphWorker: Project: ".concat(this.getProjectName(), " Version: ").concat(this.getProjectVersion(), " structureChanged: ").concat(hasNewProgram).concat(this.program ? " structureIsReused:: ".concat(ts.StructureIsReused[this.program.structureIsReused]) : "", " Elapsed: ").concat(elapsed, "ms"));
if (this.hasAddedorRemovedFiles) {
this.print(/*writeProjectFileNames*/ true);
}
@@ -167183,7 +167184,7 @@ var ts;
var path = this.toPath(sourceFile);
if (this.generatedFilesMap) {
if (isGeneratedFileWatcher(this.generatedFilesMap)) {
- ts.Debug.fail(this.projectName + " Expected to not have --out watcher for generated file with options: " + JSON.stringify(this.compilerOptions));
+ ts.Debug.fail("".concat(this.projectName, " Expected to not have --out watcher for generated file with options: ").concat(JSON.stringify(this.compilerOptions)));
return;
}
if (this.generatedFilesMap.has(path))
@@ -167235,20 +167236,20 @@ var ts;
if (!this.program)
return "\tFiles (0) NoProgram\n";
var sourceFiles = this.program.getSourceFiles();
- var strBuilder = "\tFiles (" + sourceFiles.length + ")\n";
+ var strBuilder = "\tFiles (".concat(sourceFiles.length, ")\n");
if (writeProjectFileNames) {
for (var _i = 0, sourceFiles_1 = sourceFiles; _i < sourceFiles_1.length; _i++) {
var file = sourceFiles_1[_i];
- strBuilder += "\t" + file.fileName + "\n";
+ strBuilder += "\t".concat(file.fileName, "\n");
}
strBuilder += "\n\n";
- ts.explainFiles(this.program, function (s) { return strBuilder += "\t" + s + "\n"; });
+ ts.explainFiles(this.program, function (s) { return strBuilder += "\t".concat(s, "\n"); });
}
return strBuilder;
};
/*@internal*/
Project.prototype.print = function (writeProjectFileNames) {
- this.writeLog("Project '" + this.projectName + "' (" + ProjectKind[this.projectKind] + ")");
+ this.writeLog("Project '".concat(this.projectName, "' (").concat(ProjectKind[this.projectKind], ")"));
this.writeLog(this.filesToString(writeProjectFileNames && this.projectService.logger.hasLevel(server.LogLevel.verbose)));
this.writeLog("-----------------------------------------------");
if (this.autoImportProviderHost) {
@@ -167410,7 +167411,7 @@ var ts;
if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; }))
return "continue";
// Provide global: true so plugins can detect why they can't find their config
- this_1.projectService.logger.info("Loading global plugin " + globalPluginName);
+ this_1.projectService.logger.info("Loading global plugin ".concat(globalPluginName));
this_1.enablePlugin({ name: globalPluginName, global: true }, searchPaths, pluginConfigOverrides);
};
var this_1 = this;
@@ -167423,9 +167424,9 @@ var ts;
};
Project.prototype.enablePlugin = function (pluginConfigEntry, searchPaths, pluginConfigOverrides) {
var _this = this;
- this.projectService.logger.info("Enabling plugin " + pluginConfigEntry.name + " from candidate paths: " + searchPaths.join(","));
+ this.projectService.logger.info("Enabling plugin ".concat(pluginConfigEntry.name, " from candidate paths: ").concat(searchPaths.join(",")));
if (!pluginConfigEntry.name || ts.parsePackageName(pluginConfigEntry.name).rest) {
- this.projectService.logger.info("Skipped loading plugin " + (pluginConfigEntry.name || JSON.stringify(pluginConfigEntry)) + " because only package name is allowed plugin name");
+ this.projectService.logger.info("Skipped loading plugin ".concat(pluginConfigEntry.name || JSON.stringify(pluginConfigEntry), " because only package name is allowed plugin name"));
return;
}
var log = function (message) { return _this.projectService.logger.info(message); };
@@ -167448,13 +167449,13 @@ var ts;
}
else {
ts.forEach(errorLogs, log);
- this.projectService.logger.info("Couldn't find " + pluginConfigEntry.name);
+ this.projectService.logger.info("Couldn't find ".concat(pluginConfigEntry.name));
}
};
Project.prototype.enableProxy = function (pluginModuleFactory, configEntry) {
try {
if (typeof pluginModuleFactory !== "function") {
- this.projectService.logger.info("Skipped loading plugin " + configEntry.name + " because it did not expose a proper factory function");
+ this.projectService.logger.info("Skipped loading plugin ".concat(configEntry.name, " because it did not expose a proper factory function"));
return;
}
var info = {
@@ -167471,7 +167472,7 @@ var ts;
var k = _a[_i];
// eslint-disable-next-line no-in-operator
if (!(k in newLS)) {
- this.projectService.logger.info("Plugin activation warning: Missing proxied method " + k + " in created LS. Patching.");
+ this.projectService.logger.info("Plugin activation warning: Missing proxied method ".concat(k, " in created LS. Patching."));
newLS[k] = this.languageService[k];
}
}
@@ -167480,7 +167481,7 @@ var ts;
this.plugins.push({ name: configEntry.name, module: pluginModule });
}
catch (e) {
- this.projectService.logger.info("Plugin activation failed: " + e);
+ this.projectService.logger.info("Plugin activation failed: ".concat(e));
}
};
/*@internal*/
@@ -167745,7 +167746,7 @@ var ts;
var name = _d[_c];
// Avoid creating a large project that would significantly slow down time to editor interactivity
if (dependencySelection === 2 /* Auto */ && dependenciesAdded > this.maxDependencies) {
- hostProject.log("AutoImportProviderProject: attempted to add more than " + this.maxDependencies + " dependencies. Aborting.");
+ hostProject.log("AutoImportProviderProject: attempted to add more than ".concat(this.maxDependencies, " dependencies. Aborting."));
return ts.emptyArray;
}
// 1. Try to load from the implementation package. For many dependencies, the
@@ -167762,7 +167763,7 @@ var ts;
}
}
// 2. Try to load from the @types package.
- var typesPackageJson = ts.resolvePackageNameToPackageJson("@types/" + name, hostProject.currentDirectory, compilerOptions, moduleResolutionHost, program.getModuleResolutionCache());
+ var typesPackageJson = ts.resolvePackageNameToPackageJson("@types/".concat(name), hostProject.currentDirectory, compilerOptions, moduleResolutionHost, program.getModuleResolutionCache());
if (typesPackageJson) {
var entrypoints = getRootNamesFromPackageJson(typesPackageJson, program, symlinkCache);
rootNames = ts.concatenate(rootNames, entrypoints);
@@ -167780,7 +167781,7 @@ var ts;
}
}
if (rootNames === null || rootNames === void 0 ? void 0 : rootNames.length) {
- hostProject.log("AutoImportProviderProject: found " + rootNames.length + " root files in " + dependenciesAdded + " dependencies in " + (ts.timestamp() - start) + " ms");
+ hostProject.log("AutoImportProviderProject: found ".concat(rootNames.length, " root files in ").concat(dependenciesAdded, " dependencies in ").concat(ts.timestamp() - start, " ms"));
}
return rootNames || ts.emptyArray;
function addDependency(dependency) {
@@ -168037,7 +168038,7 @@ var ts;
var searchPaths = __spreadArray([ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")], this.projectService.pluginProbeLocations, true);
if (this.projectService.allowLocalPluginLoads) {
var local = ts.getDirectoryPath(this.canonicalConfigFilePath);
- this.projectService.logger.info("Local plugin loading enabled; adding " + local + " to search paths");
+ this.projectService.logger.info("Local plugin loading enabled; adding ".concat(local, " to search paths"));
searchPaths.unshift(local);
}
// Enable tsconfig-specified plugins
@@ -168463,7 +168464,7 @@ var ts;
return forEachAnyProjectReferenceKind(project, function (resolvedRef) { return callbackRefProject(project, cb, resolvedRef.sourceFile.path); }, function (projectRef) { return callbackRefProject(project, cb, project.toPath(ts.resolveProjectReferencePath(projectRef))); }, function (potentialProjectRef) { return callbackRefProject(project, cb, potentialProjectRef); });
}
function getDetailWatchInfo(watchType, project) {
- return (ts.isString(project) ? "Config: " + project + " " : project ? "Project: " + project.getProjectName() + " " : "") + "WatchType: " + watchType;
+ return "".concat(ts.isString(project) ? "Config: ".concat(project, " ") : project ? "Project: ".concat(project.getProjectName(), " ") : "", "WatchType: ").concat(watchType);
}
function isScriptInfoWatchedFromNodeModules(info) {
return !info.isScriptOpen() && info.mTime !== undefined;
@@ -168668,7 +168669,7 @@ var ts;
try {
var fileContent = this.host.readFile(this.typesMapLocation); // TODO: GH#18217
if (fileContent === undefined) {
- this.logger.info("Provided types map file \"" + this.typesMapLocation + "\" doesn't exist");
+ this.logger.info("Provided types map file \"".concat(this.typesMapLocation, "\" doesn't exist"));
return;
}
var raw = JSON.parse(fileContent);
@@ -168686,7 +168687,7 @@ var ts;
}
}
catch (e) {
- this.logger.info("Error loading types map: " + e);
+ this.logger.info("Error loading types map: ".concat(e));
this.safelist = defaultTypeSafeList;
this.legacySafelist.clear();
}
@@ -169008,7 +169009,7 @@ var ts;
var fsResult = config.cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
if (ts.getBaseFileName(fileOrDirectoryPath) === "package.json" && !ts.isInsideNodeModules(fileOrDirectoryPath) &&
(fsResult && fsResult.fileExists || !fsResult && _this.host.fileExists(fileOrDirectoryPath))) {
- _this.logger.info("Config: " + configFileName + " Detected new package.json: " + fileOrDirectory);
+ _this.logger.info("Config: ".concat(configFileName, " Detected new package.json: ").concat(fileOrDirectory));
_this.onAddPackageJson(fileOrDirectoryPath);
}
var configuredProjectForConfig = _this.findConfiguredProjectByProjectName(configFileName);
@@ -169131,13 +169132,13 @@ var ts;
project.print(/*writeProjectFileNames*/ true);
project.close();
if (ts.Debug.shouldAssert(1 /* Normal */)) {
- this.filenameToScriptInfo.forEach(function (info) { return ts.Debug.assert(!info.isAttached(project), "Found script Info still attached to project", function () { return project.projectName + ": ScriptInfos still attached: " + JSON.stringify(ts.arrayFrom(ts.mapDefinedIterator(_this.filenameToScriptInfo.values(), function (info) { return info.isAttached(project) ?
+ this.filenameToScriptInfo.forEach(function (info) { return ts.Debug.assert(!info.isAttached(project), "Found script Info still attached to project", function () { return "".concat(project.projectName, ": ScriptInfos still attached: ").concat(JSON.stringify(ts.arrayFrom(ts.mapDefinedIterator(_this.filenameToScriptInfo.values(), function (info) { return info.isAttached(project) ?
{
fileName: info.fileName,
projects: info.containingProjects.map(function (p) { return p.projectName; }),
hasMixedContent: info.hasMixedContent
} : undefined; })),
- /*replacer*/ undefined, " "); }); });
+ /*replacer*/ undefined, " ")); }); });
}
// Remove the project from pending project updates
this.pendingProjectUpdates.delete(project.getProjectName());
@@ -169538,15 +169539,15 @@ var ts;
if (result !== undefined)
return result || undefined;
}
- this.logger.info("Search path: " + ts.getDirectoryPath(info.fileName));
+ this.logger.info("Search path: ".concat(ts.getDirectoryPath(info.fileName)));
var configFileName = this.forEachConfigFileLocation(info, function (canonicalConfigFilePath, configFileName) {
return _this.configFileExists(configFileName, canonicalConfigFilePath, info);
});
if (configFileName) {
- this.logger.info("For info: " + info.fileName + " :: Config file name: " + configFileName);
+ this.logger.info("For info: ".concat(info.fileName, " :: Config file name: ").concat(configFileName));
}
else {
- this.logger.info("For info: " + info.fileName + " :: No config files found.");
+ this.logger.info("For info: ".concat(info.fileName, " :: No config files found."));
}
if (isOpenScriptInfo(info)) {
this.configFileForOpenFiles.set(info.path, configFileName || false);
@@ -169565,8 +169566,8 @@ var ts;
this.logger.info("Open files: ");
this.openFiles.forEach(function (projectRootPath, path) {
var info = _this.getScriptInfoForPath(path);
- _this.logger.info("\tFileName: " + info.fileName + " ProjectRootPath: " + projectRootPath);
- _this.logger.info("\t\tProjects: " + info.containingProjects.map(function (p) { return p.getProjectName(); }));
+ _this.logger.info("\tFileName: ".concat(info.fileName, " ProjectRootPath: ").concat(projectRootPath));
+ _this.logger.info("\t\tProjects: ".concat(info.containingProjects.map(function (p) { return p.getProjectName(); })));
});
this.logger.endGroup();
};
@@ -169605,7 +169606,7 @@ var ts;
.map(function (name) { return ({ name: name, size: _this.host.getFileSize(name) }); })
.sort(function (a, b) { return b.size - a.size; })
.slice(0, 5);
- this.logger.info("Non TS file size exceeded limit (" + totalNonTsFileSize + "). Largest files: " + top5LargestFiles.map(function (file) { return file.name + ":" + file.size; }).join(", "));
+ this.logger.info("Non TS file size exceeded limit (".concat(totalNonTsFileSize, "). Largest files: ").concat(top5LargestFiles.map(function (file) { return "".concat(file.name, ":").concat(file.size); }).join(", ")));
// Keep the size as zero since it's disabled
return fileName;
}
@@ -169674,7 +169675,7 @@ var ts;
};
/* @internal */
ProjectService.prototype.createConfiguredProject = function (configFileName) {
- this.logger.info("Creating configuration project " + configFileName);
+ this.logger.info("Creating configuration project ".concat(configFileName));
var canonicalConfigFilePath = server.asNormalizedPath(this.toCanonicalFileName(configFileName));
var configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
// We could be in this scenario if project is the configured project tracked by external project
@@ -169785,12 +169786,12 @@ var ts;
if (parsedCommandLine.errors.length) {
configFileErrors.push.apply(configFileErrors, parsedCommandLine.errors);
}
- this.logger.info("Config: " + configFilename + " : " + JSON.stringify({
+ this.logger.info("Config: ".concat(configFilename, " : ").concat(JSON.stringify({
rootNames: parsedCommandLine.fileNames,
options: parsedCommandLine.options,
watchOptions: parsedCommandLine.watchOptions,
projectReferences: parsedCommandLine.projectReferences
- }, /*replacer*/ undefined, " "));
+ }, /*replacer*/ undefined, " ")));
var oldCommandLine = (_b = configFileExistenceInfo.config) === null || _b === void 0 ? void 0 : _b.parsedCommandLine;
if (!configFileExistenceInfo.config) {
configFileExistenceInfo.config = { parsedCommandLine: parsedCommandLine, cachedDirectoryStructureHost: cachedDirectoryStructureHost, projects: new ts.Map() };
@@ -169820,7 +169821,7 @@ var ts;
// Update projects
var ensureProjectsForOpenFiles = false;
(_a = _this.sharedExtendedConfigFileWatchers.get(extendedConfigFilePath)) === null || _a === void 0 ? void 0 : _a.projects.forEach(function (canonicalPath) {
- ensureProjectsForOpenFiles = _this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalPath, "Change in extended config file " + extendedConfigFileName + " detected") || ensureProjectsForOpenFiles;
+ ensureProjectsForOpenFiles = _this.delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalPath, "Change in extended config file ".concat(extendedConfigFileName, " detected")) || ensureProjectsForOpenFiles;
});
if (ensureProjectsForOpenFiles)
_this.delayEnsureProjectForOpenFiles();
@@ -169976,7 +169977,7 @@ var ts;
// Clear the cache since we are reloading the project from disk
host.clearCache();
var configFileName = project.getConfigFilePath();
- this.logger.info((isInitialLoad ? "Loading" : "Reloading") + " configured project " + configFileName);
+ this.logger.info("".concat(isInitialLoad ? "Loading" : "Reloading", " configured project ").concat(configFileName));
// Load project from the disk
this.loadConfiguredProject(project, reason);
project.updateGraph();
@@ -170115,7 +170116,7 @@ var ts;
var path = _a[0], scriptInfo = _a[1];
return ({ path: path, fileName: scriptInfo.fileName });
});
- this.logger.msg("Could not find file " + JSON.stringify(fileName) + ".\nAll files are: " + JSON.stringify(names), server.Msg.Err);
+ this.logger.msg("Could not find file ".concat(JSON.stringify(fileName), ".\nAll files are: ").concat(JSON.stringify(names)), server.Msg.Err);
};
/**
* Returns the projects that contain script info through SymLink
@@ -170299,9 +170300,9 @@ var ts;
var info = this.getScriptInfoForPath(path);
if (!info) {
var isDynamic = server.isDynamicFileName(fileName);
- ts.Debug.assert(ts.isRootedDiskPath(fileName) || isDynamic || openedByClient, "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nScript info with non-dynamic relative file name can only be open script info or in context of host currentDirectory"; });
- ts.Debug.assert(!ts.isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nOpen script files with non rooted disk path opened with current directory context cannot have same canonical names"; });
- ts.Debug.assert(!isDynamic || this.currentDirectory === currentDirectory || this.useInferredProjectPerProjectRoot, "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nDynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath."; });
+ ts.Debug.assert(ts.isRootedDiskPath(fileName) || isDynamic || openedByClient, "", function () { return "".concat(JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }), "\nScript info with non-dynamic relative file name can only be open script info or in context of host currentDirectory"); });
+ ts.Debug.assert(!ts.isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "", function () { return "".concat(JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }), "\nOpen script files with non rooted disk path opened with current directory context cannot have same canonical names"); });
+ ts.Debug.assert(!isDynamic || this.currentDirectory === currentDirectory || this.useInferredProjectPerProjectRoot, "", function () { return "".concat(JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }), "\nDynamic files must always be opened with service's current directory or service should support inferred project per projectRootPath."); });
// If the file is not opened by client and the file doesnot exist on the disk, return
if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) {
return;
@@ -170480,13 +170481,13 @@ var ts;
var info = this.getScriptInfoForNormalizedPath(server.toNormalizedPath(args.file));
if (info) {
info.setOptions(convertFormatOptions(args.formatOptions), args.preferences);
- this.logger.info("Host configuration update for file " + args.file);
+ this.logger.info("Host configuration update for file ".concat(args.file));
}
}
else {
if (args.hostInfo !== undefined) {
this.hostConfiguration.hostInfo = args.hostInfo;
- this.logger.info("Host information " + args.hostInfo);
+ this.logger.info("Host information ".concat(args.hostInfo));
}
if (args.formatOptions) {
this.hostConfiguration.formatCodeOptions = __assign(__assign({}, this.hostConfiguration.formatCodeOptions), convertFormatOptions(args.formatOptions));
@@ -170518,7 +170519,7 @@ var ts;
}
if (args.watchOptions) {
this.hostConfiguration.watchOptions = (_a = convertWatchOptions(args.watchOptions)) === null || _a === void 0 ? void 0 : _a.watchOptions;
- this.logger.info("Host watch options changed to " + JSON.stringify(this.hostConfiguration.watchOptions) + ", it will be take effect for next watches.");
+ this.logger.info("Host watch options changed to ".concat(JSON.stringify(this.hostConfiguration.watchOptions), ", it will be take effect for next watches."));
}
}
};
@@ -170730,7 +170731,7 @@ var ts;
? originalLocation
: location;
}
- configuredProject = this.createAndLoadConfiguredProject(configFileName, "Creating project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : ""));
+ configuredProject = this.createAndLoadConfiguredProject(configFileName, "Creating project for original file: ".concat(originalFileInfo.fileName).concat(location !== originalLocation ? " for location: " + location.fileName : ""));
}
updateProjectIfDirty(configuredProject);
var projectContainsOriginalInfo = function (project) {
@@ -170742,7 +170743,7 @@ var ts;
configuredProject = forEachResolvedProjectReferenceProject(configuredProject, fileName, function (child) {
updateProjectIfDirty(child);
return projectContainsOriginalInfo(child) ? child : undefined;
- }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + configuredProject.projectName + " to find possible configured project for original file: " + originalFileInfo.fileName + (location !== originalLocation ? " for location: " + location.fileName : ""));
+ }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution ".concat(configuredProject.projectName, " to find possible configured project for original file: ").concat(originalFileInfo.fileName).concat(location !== originalLocation ? " for location: " + location.fileName : ""));
if (!configuredProject)
return undefined;
if (configuredProject === project)
@@ -170796,7 +170797,7 @@ var ts;
if (configFileName) {
project = this.findConfiguredProjectByProjectName(configFileName);
if (!project) {
- project = this.createLoadAndUpdateConfiguredProject(configFileName, "Creating possible configured project for " + info.fileName + " to open");
+ project = this.createLoadAndUpdateConfiguredProject(configFileName, "Creating possible configured project for ".concat(info.fileName, " to open"));
defaultConfigProjectIsCreated = true;
}
else {
@@ -170826,7 +170827,7 @@ var ts;
if (!projectForConfigFileDiag && child.containsScriptInfo(info)) {
projectForConfigFileDiag = child;
}
- }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution " + project.projectName + " to find possible configured project for " + info.fileName + " to open");
+ }, ProjectReferenceProjectLoadKind.FindCreateLoad, "Creating project referenced in solution ".concat(project.projectName, " to find possible configured project for ").concat(info.fileName, " to open"));
}
// Send the event only if the project got created as part of this open request and info is part of the project
if (projectForConfigFileDiag) {
@@ -170888,7 +170889,7 @@ var ts;
return;
// find or delay load the project
var ancestor = this.findConfiguredProjectByProjectName(configFileName) ||
- this.createConfiguredProjectWithDelayLoad(configFileName, "Creating project possibly referencing default composite project " + project.getProjectName() + " of open file " + info.fileName);
+ this.createConfiguredProjectWithDelayLoad(configFileName, "Creating project possibly referencing default composite project ".concat(project.getProjectName(), " of open file ").concat(info.fileName));
if (ancestor.isInitialLoadPending()) {
// Set a potential project reference
ancestor.setPotentialProjectReference(project.canonicalConfigFilePath);
@@ -170931,7 +170932,7 @@ var ts;
// Load this project,
var configFileName = server.toNormalizedPath(child.sourceFile.fileName);
var childProject = project.projectService.findConfiguredProjectByProjectName(configFileName) ||
- project.projectService.createAndLoadConfiguredProject(configFileName, "Creating project referenced by : " + project.projectName + " as it references project " + referencedProject.sourceFile.fileName);
+ project.projectService.createAndLoadConfiguredProject(configFileName, "Creating project referenced by : ".concat(project.projectName, " as it references project ").concat(referencedProject.sourceFile.fileName));
updateProjectIfDirty(childProject);
// Ensure children for this project
this.ensureProjectChildren(childProject, forProjects, seenProjects);
@@ -171232,7 +171233,7 @@ var ts;
for (var _b = 0, normalizedNames_1 = normalizedNames; _b < normalizedNames_1.length; _b++) {
var root = normalizedNames_1[_b];
if (rule.match.test(root)) {
- this_2.logger.info("Excluding files based on rule " + name + " matching file '" + root + "'");
+ this_2.logger.info("Excluding files based on rule ".concat(name, " matching file '").concat(root, "'"));
// If the file matches, collect its types packages and exclude rules
if (rule.types) {
for (var _c = 0, _d = rule.types; _c < _d.length; _c++) {
@@ -171257,7 +171258,7 @@ var ts;
if (typeof groupNumberOrString === "number") {
if (!ts.isString(groups[groupNumberOrString])) {
// Specification was wrong - exclude nothing!
- _this.logger.info("Incorrect RegExp specification in safelist rule " + name + " - not enough groups");
+ _this.logger.info("Incorrect RegExp specification in safelist rule ".concat(name, " - not enough groups"));
// * can't appear in a filename; escape it because it's feeding into a RegExp
return "\\*";
}
@@ -171305,7 +171306,7 @@ var ts;
var cleanedTypingName = ts.removeMinAndVersionNumbers(inferredTypingName);
var typeName = this_3.legacySafelist.get(cleanedTypingName);
if (typeName !== undefined) {
- this_3.logger.info("Excluded '" + normalizedNames[i] + "' because it matched " + cleanedTypingName + " from the legacy safelist");
+ this_3.logger.info("Excluded '".concat(normalizedNames[i], "' because it matched ").concat(cleanedTypingName, " from the legacy safelist"));
excludedFiles.push(normalizedNames[i]);
// *exclude* it from the project...
exclude = true;
@@ -171435,8 +171436,8 @@ var ts;
if (!project) {
// errors are stored in the project, do not need to update the graph
project = this.getHostPreferences().lazyConfiguredProjectsFromExternalProject ?
- this.createConfiguredProjectWithDelayLoad(tsconfigFile, "Creating configured project in external project: " + proj.projectFileName) :
- this.createLoadAndUpdateConfiguredProject(tsconfigFile, "Creating configured project in external project: " + proj.projectFileName);
+ this.createConfiguredProjectWithDelayLoad(tsconfigFile, "Creating configured project in external project: ".concat(proj.projectFileName)) :
+ this.createLoadAndUpdateConfiguredProject(tsconfigFile, "Creating configured project in external project: ".concat(proj.projectFileName));
}
if (project && !ts.contains(exisingConfigFiles, tsconfigFile)) {
// keep project alive even if no documents are opened - its lifetime is bound to the lifetime of containing external project
@@ -171674,7 +171675,7 @@ var ts;
return cache || (cache = new ts.Map());
}
function key(fromFileName, preferences) {
- return fromFileName + "," + preferences.importModuleSpecifierEnding + "," + preferences.importModuleSpecifierPreference;
+ return "".concat(fromFileName, ",").concat(preferences.importModuleSpecifierEnding, ",").concat(preferences.importModuleSpecifierPreference);
}
function createInfo(modulePaths, moduleSpecifiers, isAutoImportable) {
return { modulePaths: modulePaths, moduleSpecifiers: moduleSpecifiers, isAutoImportable: isAutoImportable };
@@ -171833,10 +171834,10 @@ var ts;
var verboseLogging = logger.hasLevel(server.LogLevel.verbose);
var json = JSON.stringify(msg);
if (verboseLogging) {
- logger.info(msg.type + ":" + server.indent(json));
+ logger.info("".concat(msg.type, ":").concat(server.indent(json)));
}
var len = byteLength(json, "utf8");
- return "Content-Length: " + (1 + len) + "\r\n\r\n" + json + newLine;
+ return "Content-Length: ".concat(1 + len, "\r\n\r\n").concat(json).concat(newLine);
}
server.formatMessage = formatMessage;
/**
@@ -171901,7 +171902,7 @@ var ts;
}
else {
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("session" /* Session */, "stepError", { seq: this.requestId, message: e.message });
- this.operationHost.logError(e, "delayed processing of request " + this.requestId);
+ this.operationHost.logError(e, "delayed processing of request ".concat(this.requestId));
}
}
if (stop || !this.hasPendingWork()) {
@@ -172002,7 +172003,7 @@ var ts;
function combineProjectOutputForReferences(projects, defaultProject, initialLocation, logger) {
var outputs = [];
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, getMappedLocation) {
- logger.info("Finding references to " + location.fileName + " position " + location.pos + " in project " + project.getProjectName());
+ logger.info("Finding references to ".concat(location.fileName, " position ").concat(location.pos, " in project ").concat(project.getProjectName()));
var _loop_8 = function (outputReferencedSymbol) {
var mappedDefinitionFile = getMappedLocation(project, documentSpanLocation(outputReferencedSymbol.definition));
var definition = mappedDefinitionFile === undefined ?
@@ -172687,14 +172688,14 @@ var ts;
case ts.LanguageServiceMode.PartialSemantic:
invalidPartialSemanticModeCommands.forEach(function (commandName) {
return _this.handlers.set(commandName, function (request) {
- throw new Error("Request: " + request.command + " not allowed in LanguageServiceMode.PartialSemantic");
+ throw new Error("Request: ".concat(request.command, " not allowed in LanguageServiceMode.PartialSemantic"));
});
});
break;
case ts.LanguageServiceMode.Syntactic:
invalidSyntacticModeCommands.forEach(function (commandName) {
return _this.handlers.set(commandName, function (request) {
- throw new Error("Request: " + request.command + " not allowed in LanguageServiceMode.Syntactic");
+ throw new Error("Request: ".concat(request.command, " not allowed in LanguageServiceMode.Syntactic"));
});
});
break;
@@ -172769,7 +172770,7 @@ var ts;
};
Session.prototype.projectsUpdatedInBackgroundEvent = function (openFiles) {
var _this = this;
- this.projectService.logger.info("got projects updated in background, updating diagnostics for " + openFiles);
+ this.projectService.logger.info("got projects updated in background, updating diagnostics for ".concat(openFiles));
if (openFiles.length) {
if (!this.suppressDiagnosticEvents && !this.noGetErrOnBackgroundUpdate) {
// For now only queue error checking for open files. We can change this to include non open files as well
@@ -172799,17 +172800,17 @@ var ts;
var scriptInfo = project.getScriptInfoForNormalizedPath(file);
if (scriptInfo) {
var text = ts.getSnapshotText(scriptInfo.getSnapshot());
- msg += "\n\nFile text of " + fileRequest.file + ":" + server.indent(text) + "\n";
+ msg += "\n\nFile text of ".concat(fileRequest.file, ":").concat(server.indent(text), "\n");
}
}
catch (_b) { } // eslint-disable-line no-empty
}
if (err.ProgramFiles) {
- msg += "\n\nProgram files: " + JSON.stringify(err.ProgramFiles) + "\n";
+ msg += "\n\nProgram files: ".concat(JSON.stringify(err.ProgramFiles), "\n");
msg += "\n\nProjects::\n";
var counter_1 = 0;
var addProjectInfo = function (project) {
- msg += "\nProject '" + project.projectName + "' (" + server.ProjectKind[project.projectKind] + ") " + counter_1 + "\n";
+ msg += "\nProject '".concat(project.projectName, "' (").concat(server.ProjectKind[project.projectKind], ") ").concat(counter_1, "\n");
msg += project.filesToString(/*writeProjectFileNames*/ true);
msg += "\n-----------------------------------------------\n";
counter_1++;
@@ -172824,7 +172825,7 @@ var ts;
Session.prototype.send = function (msg) {
if (msg.type === "event" && !this.canUseEvents) {
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("Session does not support events: ignored event: " + JSON.stringify(msg));
+ this.logger.info("Session does not support events: ignored event: ".concat(JSON.stringify(msg)));
}
return;
}
@@ -172832,7 +172833,7 @@ var ts;
};
Session.prototype.writeMessage = function (msg) {
var msgText = formatMessage(msg, this.logger, this.byteLength, this.host.newLine);
- ts.perfLogger.logEvent("Response message size: " + msgText.length);
+ ts.perfLogger.logEvent("Response message size: ".concat(msgText.length));
this.host.write(msgText);
};
Session.prototype.event = function (body, eventName) {
@@ -172970,7 +172971,7 @@ var ts;
if (!projects) {
return;
}
- this.logger.info("cleaning " + caption);
+ this.logger.info("cleaning ".concat(caption));
for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) {
var p = projects_4[_i];
p.getLanguageService(/*ensureSynchronized*/ false).cleanupSemanticCache();
@@ -173384,7 +173385,7 @@ var ts;
var refs = references.map(function (entry) { return referenceEntryToReferencesResponseItem(_this.projectService, entry); });
return {
refs: refs,
- symbolName: "\"" + args.file + "\""
+ symbolName: "\"".concat(args.file, "\"")
};
};
/**
@@ -173928,7 +173929,7 @@ var ts;
});
var badCode = args.errorCodes.find(function (c) { return !existingDiagCodes_1.includes(c); });
if (badCode !== undefined) {
- e.message = "BADCLIENT: Bad error code, " + badCode + " not found in range " + startPosition + ".." + endPosition + " (found: " + existingDiagCodes_1.join(", ") + "); could have caused this error:\n" + e.message;
+ e.message = "BADCLIENT: Bad error code, ".concat(badCode, " not found in range ").concat(startPosition, "..").concat(endPosition, " (found: ").concat(existingDiagCodes_1.join(", "), "); could have caused this error:\n").concat(e.message);
}
throw e;
}
@@ -174205,7 +174206,7 @@ var ts;
};
Session.prototype.addProtocolHandler = function (command, handler) {
if (this.handlers.has(command)) {
- throw new Error("Protocol handler already exists for command \"" + command + "\"");
+ throw new Error("Protocol handler already exists for command \"".concat(command, "\""));
}
this.handlers.set(command, handler);
};
@@ -174234,8 +174235,8 @@ var ts;
return this.executeWithRequestId(request.seq, function () { return handler(request); });
}
else {
- this.logger.msg("Unrecognized JSON command:" + server.stringifyIndented(request), server.Msg.Err);
- this.doOutput(/*info*/ undefined, server.CommandNames.Unknown, request.seq, /*success*/ false, "Unrecognized JSON command: " + request.command);
+ this.logger.msg("Unrecognized JSON command:".concat(server.stringifyIndented(request)), server.Msg.Err);
+ this.doOutput(/*info*/ undefined, server.CommandNames.Unknown, request.seq, /*success*/ false, "Unrecognized JSON command: ".concat(request.command));
return { responseRequired: false };
}
};
@@ -174246,7 +174247,7 @@ var ts;
if (this.logger.hasLevel(server.LogLevel.requestTime)) {
start = this.hrtime();
if (this.logger.hasLevel(server.LogLevel.verbose)) {
- this.logger.info("request:" + server.indent(this.toStringMessage(message)));
+ this.logger.info("request:".concat(server.indent(this.toStringMessage(message))));
}
}
var request;
@@ -174262,10 +174263,10 @@ var ts;
if (this.logger.hasLevel(server.LogLevel.requestTime)) {
var elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4);
if (responseRequired) {
- this.logger.perftrc(request.seq + "::" + request.command + ": elapsed time (in milliseconds) " + elapsedTime);
+ this.logger.perftrc("".concat(request.seq, "::").concat(request.command, ": elapsed time (in milliseconds) ").concat(elapsedTime));
}
else {
- this.logger.perftrc(request.seq + "::" + request.command + ": async elapsed time (in milliseconds) " + elapsedTime);
+ this.logger.perftrc("".concat(request.seq, "::").concat(request.command, ": async elapsed time (in milliseconds) ").concat(elapsedTime));
}
}
// Note: Log before writing the response, else the editor can complete its activity before the server does
diff --git a/lib/typescript.js b/lib/typescript.js
index 442c83f0d6e..4c53194abdf 100644
--- a/lib/typescript.js
+++ b/lib/typescript.js
@@ -21,7 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
ar[i] = from[i];
}
}
- return to.concat(ar || from);
+ return to.concat(ar || Array.prototype.slice.call(from));
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
@@ -294,7 +294,7 @@ var ts;
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
- ts.version = ts.versionMajorMinor + ".1-rc";
+ ts.version = "4.6.2";
/* @internal */
var Comparison;
(function (Comparison) {
@@ -341,7 +341,7 @@ var ts;
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
if (constructor)
return constructor;
- throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
+ throw new Error("TypeScript requires an environment that provides a compatible native ".concat(name, " implementation."));
}
})(ts || (ts = {}));
/* @internal */
@@ -1691,7 +1691,7 @@ var ts;
function cast(value, test) {
if (value !== undefined && test(value))
return value;
- return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'.");
+ return ts.Debug.fail("Invalid cast. The supplied value ".concat(value, " did not pass the test '").concat(ts.Debug.getFunctionName(test), "'."));
}
ts.cast = cast;
/** Does nothing. */
@@ -1782,7 +1782,7 @@ var ts;
function memoizeOne(callback) {
var map = new ts.Map();
return function (arg) {
- var key = typeof arg + ":" + arg;
+ var key = "".concat(typeof arg, ":").concat(arg);
var value = map.get(key);
if (value === undefined && !map.has(key)) {
value = callback(arg);
@@ -2232,7 +2232,7 @@ var ts;
ts.createGetCanonicalFileName = createGetCanonicalFileName;
function patternText(_a) {
var prefix = _a.prefix, suffix = _a.suffix;
- return prefix + "*" + suffix;
+ return "".concat(prefix, "*").concat(suffix);
}
ts.patternText = patternText;
/**
@@ -2545,7 +2545,7 @@ var ts;
}
function fail(message, stackCrawlMark) {
debugger;
- var e = new Error(message ? "Debug Failure. " + message : "Debug Failure.");
+ var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");
if (Error.captureStackTrace) {
Error.captureStackTrace(e, stackCrawlMark || fail);
}
@@ -2553,12 +2553,12 @@ var ts;
}
Debug.fail = fail;
function failBadSyntaxKind(node, message, stackCrawlMark) {
- return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", stackCrawlMark || failBadSyntaxKind);
+ return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind);
}
Debug.failBadSyntaxKind = failBadSyntaxKind;
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
if (!expression) {
- message = message ? "False expression: " + message : "False expression.";
+ message = message ? "False expression: ".concat(message) : "False expression.";
if (verboseDebugInfo) {
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
}
@@ -2568,26 +2568,26 @@ var ts;
Debug.assert = assert;
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
if (a !== b) {
- var message = msg ? msg2 ? msg + " " + msg2 : msg : "";
- fail("Expected " + a + " === " + b + ". " + message, stackCrawlMark || assertEqual);
+ var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
+ fail("Expected ".concat(a, " === ").concat(b, ". ").concat(message), stackCrawlMark || assertEqual);
}
}
Debug.assertEqual = assertEqual;
function assertLessThan(a, b, msg, stackCrawlMark) {
if (a >= b) {
- fail("Expected " + a + " < " + b + ". " + (msg || ""), stackCrawlMark || assertLessThan);
+ fail("Expected ".concat(a, " < ").concat(b, ". ").concat(msg || ""), stackCrawlMark || assertLessThan);
}
}
Debug.assertLessThan = assertLessThan;
function assertLessThanOrEqual(a, b, stackCrawlMark) {
if (a > b) {
- fail("Expected " + a + " <= " + b, stackCrawlMark || assertLessThanOrEqual);
+ fail("Expected ".concat(a, " <= ").concat(b), stackCrawlMark || assertLessThanOrEqual);
}
}
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
if (a < b) {
- fail("Expected " + a + " >= " + b, stackCrawlMark || assertGreaterThanOrEqual);
+ fail("Expected ".concat(a, " >= ").concat(b), stackCrawlMark || assertGreaterThanOrEqual);
}
}
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
@@ -2618,42 +2618,42 @@ var ts;
function assertNever(member, message, stackCrawlMark) {
if (message === void 0) { message = "Illegal value:"; }
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
- return fail(message + " " + detail, stackCrawlMark || assertNever);
+ return fail("".concat(message, " ").concat(detail), stackCrawlMark || assertNever);
}
Debug.assertNever = assertNever;
function assertEachNode(nodes, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) {
- assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertEachNode);
+ assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '".concat(getFunctionName(test), "'."); }, stackCrawlMark || assertEachNode);
}
}
Debug.assertEachNode = assertEachNode;
function assertNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNode")) {
- assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNode);
+ 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);
}
}
Debug.assertNode = assertNode;
function assertNotNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) {
- assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " should not have passed test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNotNode);
+ 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);
}
}
Debug.assertNotNode = assertNotNode;
function assertOptionalNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) {
- assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertOptionalNode);
+ 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);
}
}
Debug.assertOptionalNode = assertOptionalNode;
function assertOptionalToken(node, kind, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) {
- assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, stackCrawlMark || assertOptionalToken);
+ 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);
}
}
Debug.assertOptionalToken = assertOptionalToken;
function assertMissingNode(node, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) {
- assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, stackCrawlMark || assertMissingNode);
+ assert(node === undefined, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); }, stackCrawlMark || assertMissingNode);
}
}
Debug.assertMissingNode = assertMissingNode;
@@ -2674,7 +2674,7 @@ var ts;
}
Debug.getFunctionName = getFunctionName;
function formatSymbol(symbol) {
- return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }";
+ return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");
}
Debug.formatSymbol = formatSymbol;
/**
@@ -2695,7 +2695,7 @@ var ts;
break;
}
if (enumValue !== 0 && enumValue & value) {
- result = "" + result + (result ? "|" : "") + enumName;
+ result = "".concat(result).concat(result ? "|" : "").concat(enumName);
remainingFlags &= ~enumValue;
}
}
@@ -2805,7 +2805,7 @@ var ts;
this.flags & 1 /* Unreachable */ ? "FlowUnreachable" :
"UnknownFlow";
var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);
- return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : "");
+ return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : "");
}
},
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },
@@ -2844,7 +2844,7 @@ var ts;
// We don't care, this is debug code that's only enabled with a debugger attached -
// we're just taking note of it for anyone checking regex performance in the future.
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
- return "NodeArray " + defaultValue;
+ return "NodeArray ".concat(defaultValue);
}
}
});
@@ -2899,7 +2899,7 @@ var ts;
var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" :
"Symbol";
var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;
- return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : "");
+ return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
@@ -2909,11 +2909,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" :
- this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) :
- this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" :
+ this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType ".concat(JSON.stringify(this.value)) :
+ this.flags & 2048 /* BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") :
this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" :
this.flags & 32 /* Enum */ ? "EnumType" :
- this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName :
+ this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType ".concat(this.intrinsicName) :
this.flags & 1048576 /* Union */ ? "UnionType" :
this.flags & 2097152 /* Intersection */ ? "IntersectionType" :
this.flags & 4194304 /* Index */ ? "IndexType" :
@@ -2932,7 +2932,7 @@ var ts;
"ObjectType" :
"Type";
var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
- return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : "");
+ return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
@@ -2968,11 +2968,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
- ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" :
- ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" :
- ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") :
- ts.isNumericLiteral(this) ? "NumericLiteral " + this.text :
- ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" :
+ ts.isIdentifier(this) ? "Identifier '".concat(ts.idText(this), "'") :
+ ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
+ ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
+ ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
+ ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") :
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
ts.isParameter(this) ? "ParameterDeclaration" :
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
@@ -3004,7 +3004,7 @@ var ts;
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
ts.isImportTypeNode(this) ? "ImportTypeNode" :
formatSyntaxKind(this.kind);
- return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : "");
+ return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : "");
}
},
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
@@ -3051,10 +3051,10 @@ var ts;
Debug.enableDebugInfo = enableDebugInfo;
function formatDeprecationMessage(name, error, errorAfter, since, message) {
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
- deprecationMessage += "'" + name + "' ";
- deprecationMessage += since ? "has been deprecated since v" + since : "is deprecated";
- deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v" + errorAfter + "." : ".";
- deprecationMessage += message ? " " + ts.formatStringFromArgs(message, [name], 0) : "";
+ deprecationMessage += "'".concat(name, "' ");
+ deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
+ deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
+ deprecationMessage += message ? " ".concat(ts.formatStringFromArgs(message, [name], 0)) : "";
return deprecationMessage;
}
function createErrorDeprecation(name, errorAfter, since, message) {
@@ -3185,11 +3185,11 @@ var ts;
}
};
Version.prototype.toString = function () {
- var result = this.major + "." + this.minor + "." + this.patch;
+ var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
if (ts.some(this.prerelease))
- result += "-" + this.prerelease.join(".");
+ result += "-".concat(this.prerelease.join("."));
if (ts.some(this.build))
- result += "+" + this.build.join(".");
+ result += "+".concat(this.build.join("."));
return result;
};
Version.zero = new Version(0, 0, 0);
@@ -3456,7 +3456,7 @@ var ts;
return ts.map(comparators, formatComparator).join(" ");
}
function formatComparator(comparator) {
- return "" + comparator.operator + comparator.operand;
+ return "".concat(comparator.operator).concat(comparator.operand);
}
})(ts || (ts = {}));
/*@internal*/
@@ -3754,7 +3754,7 @@ var ts;
fs = require("fs");
}
catch (e) {
- throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
+ throw new Error("tracing requires having fs\n(original error: ".concat(e.message || e, ")"));
}
}
mode = tracingMode;
@@ -3766,11 +3766,11 @@ var ts;
if (!fs.existsSync(traceDir)) {
fs.mkdirSync(traceDir, { recursive: true });
}
- var countPart = mode === "build" ? "." + process.pid + "-" + ++traceCount
- : mode === "server" ? "." + process.pid
+ var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount)
+ : mode === "server" ? ".".concat(process.pid)
: "";
- var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
- var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
+ var tracePath = ts.combinePaths(traceDir, "trace".concat(countPart, ".json"));
+ var typesPath = ts.combinePaths(traceDir, "types".concat(countPart, ".json"));
legend.push({
configFilePath: configFilePath,
tracePath: tracePath,
@@ -3860,7 +3860,7 @@ var ts;
}
// test if [time,endTime) straddles a sampling point
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
- writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
+ writeEvent("X", phase, name, args, "\"dur\":".concat(endTime - time), time);
}
}
function writeEvent(eventType, phase, name, args, extras, time) {
@@ -3869,11 +3869,11 @@ var ts;
if (mode === "server" && phase === "checkTypes" /* CheckTypes */)
return;
ts.performance.mark("beginTracing");
- fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\"");
+ fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
if (extras)
- fs.writeSync(traceFd, "," + extras);
+ fs.writeSync(traceFd, ",".concat(extras));
if (args)
- fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args));
+ fs.writeSync(traceFd, ",\"args\":".concat(JSON.stringify(args)));
fs.writeSync(traceFd, "}");
ts.performance.mark("endTracing");
ts.performance.measure("Tracing", "beginTracing", "endTracing");
@@ -5034,6 +5034,8 @@ var ts;
TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike";
TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike";
/* @internal */
+ TypeFlags[TypeFlags["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable";
+ /* @internal */
TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains";
TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection";
TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType";
@@ -5986,7 +5988,7 @@ var ts;
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
function getLevel(envVar, level) {
- return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase());
+ return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
}
function getCustomLevels(baseVariable) {
var customLevels;
@@ -6455,7 +6457,7 @@ var ts;
}
function onTimerToUpdateChildWatches() {
timerToUpdateChildWatches = undefined;
- sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
var start = ts.timestamp();
var invokeMap = new ts.Map();
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
@@ -6468,7 +6470,7 @@ var ts;
var hasChanges = updateChildWatches(dirName, dirPath, options);
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
}
- sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
callbackCache.forEach(function (callbacks, rootDirName) {
var existing = invokeMap.get(rootDirName);
if (existing) {
@@ -6484,7 +6486,7 @@ var ts;
}
});
var elapsed = ts.timestamp() - start;
- sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
+ sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
}
function removeChildWatches(parentWatcher) {
if (!parentWatcher)
@@ -6944,7 +6946,7 @@ var ts;
var remappedPaths = new ts.Map();
var normalizedDir = ts.normalizeSlashes(__dirname);
// Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
- var fileUrlRoot = "file://" + (ts.getRootLength(normalizedDir) === 1 ? "" : "/") + normalizedDir;
+ var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
var node = _a[_i];
if (node.callFrame.url) {
@@ -6953,7 +6955,7 @@ var ts;
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
}
else if (!nativePattern.test(url)) {
- node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external" + externalFileCounter + ".js")).get(url);
+ node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
externalFileCounter++;
}
}
@@ -6969,7 +6971,7 @@ var ts;
if (!err) {
try {
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
- profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
+ profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
}
}
catch (_c) {
@@ -7071,7 +7073,7 @@ var ts;
* @param createWatcher
*/
function invokeCallbackAndUpdateWatcher(createWatcher) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
// Call the callback for current directory
callback("rename", "");
// If watcher is not closed, update it
@@ -7096,7 +7098,7 @@ var ts;
}
}
if (hitSystemWatcherLimit) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
@@ -7112,7 +7114,7 @@ var ts;
// 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
// so instead of throwing error, use fs.watchFile
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
}
@@ -8275,6 +8277,8 @@ var ts;
Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),
+ Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, ts.DiagnosticCategory.Error, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."),
+ Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, ts.DiagnosticCategory.Error, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
@@ -10127,7 +10131,7 @@ var ts;
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
}
else {
- ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
+ 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"));
}
}
var res = lineStarts[line] + character;
@@ -13017,7 +13021,7 @@ var ts;
: "linkplain";
var name = link.name ? ts.entityNameToString(link.name) : "";
var space = link.name && link.text.startsWith("://") ? "" : " ";
- return "{@" + kind + " " + name + space + link.text + "}";
+ return "{@".concat(kind, " ").concat(name).concat(space).concat(link.text, "}");
}
/**
* Gets the effective type parameters. If the node was parsed in a
@@ -14274,11 +14278,11 @@ var ts;
}
function packageIdToPackageName(_a) {
var name = _a.name, subModuleName = _a.subModuleName;
- return subModuleName ? name + "/" + subModuleName : name;
+ return subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
}
ts.packageIdToPackageName = packageIdToPackageName;
function packageIdToString(packageId) {
- return packageIdToPackageName(packageId) + "@" + packageId.version;
+ return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version);
}
ts.packageIdToString = packageIdToString;
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
@@ -14361,7 +14365,7 @@ var ts;
function nodePosToString(node) {
var file = getSourceFileOfNode(node);
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
- return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
+ return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
}
ts.nodePosToString = nodePosToString;
function getEndLinePosition(line, sourceFile) {
@@ -14500,7 +14504,7 @@ var ts;
ts.isPinnedComment = isPinnedComment;
function createCommentDirectivesMap(sourceFile, commentDirectives) {
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
- "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,
+ "".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
commentDirective,
]); }));
var usedLines = new ts.Map();
@@ -14517,10 +14521,10 @@ var ts;
});
}
function markUsed(line) {
- if (!directivesByLine.has("" + line)) {
+ if (!directivesByLine.has("".concat(line))) {
return false;
}
- usedLines.set("" + line, true);
+ usedLines.set("".concat(line), true);
return true;
}
}
@@ -14750,7 +14754,7 @@ var ts;
}
return node.text;
}
- return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
+ return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
}
ts.getLiteralText = getLiteralText;
function canUseOriginalText(node, flags) {
@@ -17331,11 +17335,11 @@ var ts;
}
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
function getPropertyNameForUniqueESSymbol(symbol) {
- return "__@" + ts.getSymbolId(symbol) + "@" + symbol.escapedName;
+ return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
}
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
- return "__#" + ts.getSymbolId(containingClassSymbol) + "@" + description;
+ return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
}
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
function isKnownSymbol(symbol) {
@@ -20037,7 +20041,7 @@ var ts;
}
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
function getJSXRuntimeImport(base, options) {
- return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
+ return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
}
ts.getJSXRuntimeImport = getJSXRuntimeImport;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -20144,7 +20148,7 @@ var ts;
}
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
- var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))";
+ var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
var filesMatcher = {
/**
* Matches any single directory segment unless it is the last segment and a .min.js file
@@ -20157,7 +20161,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
};
var directoriesMatcher = {
@@ -20166,7 +20170,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
};
var excludeMatcher = {
@@ -20184,10 +20188,10 @@ var ts;
if (!patterns || !patterns.length) {
return undefined;
}
- var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|");
+ var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
var terminator = usage === "exclude" ? "($|/)" : "$";
- return "^(" + pattern + ")" + terminator;
+ return "^(".concat(pattern, ")").concat(terminator);
}
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
function getRegularExpressionsForWildcards(specs, basePath, usage) {
@@ -20209,7 +20213,7 @@ var ts;
ts.isImplicitGlob = isImplicitGlob;
function getPatternFromSpec(spec, basePath, usage) {
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
- return pattern && "^(" + pattern + ")" + (usage === "exclude" ? "($|/)" : "$");
+ return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
}
ts.getPatternFromSpec = getPatternFromSpec;
function getSubPatternFromSpec(spec, basePath, usage, _a) {
@@ -20287,7 +20291,7 @@ var ts;
currentDirectory = ts.normalizePath(currentDirectory);
var absolutePath = ts.combinePaths(currentDirectory, path);
return {
- includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
+ includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
@@ -20568,7 +20572,7 @@ var ts;
*/
function extensionFromPath(path) {
var ext = tryGetExtensionFromPath(path);
- return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension.");
+ return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
}
ts.extensionFromPath = extensionFromPath;
function isAnySupportedFileExtension(path) {
@@ -26651,7 +26655,7 @@ var ts;
case 326 /* JSDocAugmentsTag */: return "augments";
case 327 /* JSDocImplementsTag */: return "implements";
default:
- return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
+ return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
}
}
var rawTextScanner;
@@ -26979,7 +26983,7 @@ var ts;
};
var definedTextGetter_1 = function (path) {
var result = textGetter_1(path);
- return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
+ return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
};
var buildInfo_1;
var getAndCacheBuildInfo_1 = function (getText) {
@@ -31517,7 +31521,7 @@ var ts;
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
var keyword = viableKeywordSuggestions_1[_i];
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
- return keyword + " " + expressionText.slice(keyword.length);
+ return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
}
}
return undefined;
@@ -38287,7 +38291,7 @@ var ts;
if (namedArgRegExCache.has(name)) {
return namedArgRegExCache.get(name);
}
- var result = new RegExp("(\\s" + name + "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))", "im");
+ var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
namedArgRegExCache.set(name, result);
return result;
}
@@ -39765,8 +39769,8 @@ var ts;
}
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
- var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
- return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
+ var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
+ return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
}
/* @internal */
function parseCustomTypeOption(opt, value, errors) {
@@ -40560,10 +40564,10 @@ var ts;
var newValue = compilerOptionsMap.get(cmd.name);
var defaultValue = getDefaultValueForOption(cmd);
if (newValue !== defaultValue) {
- result.push("" + tab + cmd.name + ": " + newValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
}
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
- result.push("" + tab + cmd.name + ": " + defaultValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
}
});
return result.join(newLine) + newLine;
@@ -40614,19 +40618,19 @@ var ts;
if (entries.length !== 0) {
entries.push({ value: "" });
}
- entries.push({ value: "/* " + category + " */" });
+ entries.push({ value: "/* ".concat(category, " */") });
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
var option = options_1[_i];
var optionName = void 0;
if (compilerOptionsMap.has(option.name)) {
- optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
+ optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
}
else {
- optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ",";
+ optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
}
entries.push({
value: optionName,
- description: "/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"
+ description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
});
marginLength = Math.max(optionName.length, marginLength);
}
@@ -40635,25 +40639,25 @@ var ts;
var tab = makePadding(2);
var result = [];
result.push("{");
- result.push(tab + "\"compilerOptions\": {");
- result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + " */");
+ result.push("".concat(tab, "\"compilerOptions\": {"));
+ 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), " */"));
result.push("");
// Print out each row, aligning all the descriptions on the same column.
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
var entry = entries_2[_a];
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
- result.push(value && "" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));
+ result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
}
if (fileNames.length) {
- result.push(tab + "},");
- result.push(tab + "\"files\": [");
+ result.push("".concat(tab, "},"));
+ result.push("".concat(tab, "\"files\": ["));
for (var i = 0; i < fileNames.length; i++) {
- result.push("" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? "" : ","));
+ result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
}
- result.push(tab + "]");
+ result.push("".concat(tab, "]"));
}
else {
- result.push(tab + "}");
+ result.push("".concat(tab, "}"));
}
result.push("}");
return result.join(newLine) + newLine;
@@ -41051,7 +41055,7 @@ var ts;
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
- extendedConfigPath = extendedConfigPath + ".json";
+ extendedConfigPath = "".concat(extendedConfigPath, ".json");
if (!host.fileExists(extendedConfigPath)) {
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
return undefined;
@@ -41296,7 +41300,7 @@ var ts;
// Valid only if *.json specified
if (!jsonOnlyIncludeRegexes) {
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
- var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^" + pattern + "$"; });
+ var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
}
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
@@ -41732,7 +41736,7 @@ var ts;
var bestVersionKey = result.version, bestVersionPaths = result.paths;
if (typeof bestVersionPaths !== "object") {
if (state.traceEnabled) {
- trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['" + bestVersionKey + "']", "object", typeof bestVersionPaths);
+ trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
}
return;
}
@@ -42139,7 +42143,7 @@ var ts;
};
return cache;
function getUnderlyingCacheKey(specifier, mode) {
- var result = mode === undefined ? specifier : mode + "|" + specifier;
+ var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
memoizedReverseKeys.set(result, [specifier, mode]);
return result;
}
@@ -42170,7 +42174,7 @@ var ts;
}
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
- return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode + "|" + nonRelativeModuleName, createPerModuleNameCache);
+ return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
}
function createPerModuleNameCache() {
var directoryPathMap = new ts.Map();
@@ -42317,10 +42321,10 @@ var ts;
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
break;
default:
- return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
+ return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
}
if (result && result.resolvedModule)
- ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
+ ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
if (perFolderCache) {
perFolderCache.set(moduleName, resolutionMode, result);
@@ -42523,7 +42527,7 @@ var ts;
function resolveJSModule(moduleName, initialDir, host) {
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
if (!resolvedModule) {
- throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", "));
+ throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
}
return resolvedModule.resolvedFileName;
}
@@ -42633,7 +42637,7 @@ var ts;
if (traceEnabled) {
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
}
- ts.Debug.assert(host.fileExists(real), path + " linked to nonexistent file " + real);
+ ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
return real;
}
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
@@ -43110,7 +43114,7 @@ var ts;
return undefined;
}
var trailingParts = parts.slice(nameParts.length);
- return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
+ return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
}
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
if (!scope.packageJsonContent.exports) {
@@ -43438,7 +43442,7 @@ var ts;
}
/* @internal */
function getTypesPackageName(packageName) {
- return "@types/" + mangleScopedPackageName(packageName);
+ return "@types/".concat(mangleScopedPackageName(packageName));
}
ts.getTypesPackageName = getTypesPackageName;
/* @internal */
@@ -43839,7 +43843,7 @@ var ts;
if (name) {
if (ts.isAmbientModule(node)) {
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
- return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
+ return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
}
if (name.kind === 161 /* ComputedPropertyName */) {
var nameExpression = name.expression;
@@ -43896,7 +43900,7 @@ var ts;
case 163 /* Parameter */:
// Parameters with names are handled at the top of this function. Parameters
// without names can only come from JSDocFunctionTypes.
- ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ 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"); });
var functionType = node.parent;
var index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -44008,7 +44012,7 @@ var ts;
var relatedInformation_1 = [];
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
// export type T; - may have meant export type { T }?
- relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { " + ts.unescapeLeadingUnderscores(node.name.escapedText) + " }"));
+ relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
}
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
ts.forEach(symbol.declarations, function (declaration, index) {
@@ -46084,7 +46088,7 @@ var ts;
}
}
function bindSourceFileAsExternalModule() {
- bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\"");
+ bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
}
function bindExportAssignment(node) {
if (!container.symbol || !container.symbol.exports) {
@@ -47135,8 +47139,7 @@ var ts;
IntersectionState[IntersectionState["Source"] = 1] = "Source";
IntersectionState[IntersectionState["Target"] = 2] = "Target";
IntersectionState[IntersectionState["PropertyCheck"] = 4] = "PropertyCheck";
- IntersectionState[IntersectionState["UnionIntersectionCheck"] = 8] = "UnionIntersectionCheck";
- IntersectionState[IntersectionState["InPropertyCheck"] = 16] = "InPropertyCheck";
+ IntersectionState[IntersectionState["InPropertyCheck"] = 8] = "InPropertyCheck";
})(IntersectionState || (IntersectionState = {}));
var RecursionFlags;
(function (RecursionFlags) {
@@ -48184,7 +48187,7 @@ var ts;
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
- var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + "|" + secondFile_1.path, function () {
+ var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
});
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
@@ -50837,7 +50840,7 @@ var ts;
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
- var key = (useOnlyExternalAliasing ? 0 : 1) + "|" + (firstRelevantLocation && getNodeId(firstRelevantLocation)) + "|" + meaning;
+ var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
if (cache.has(key)) {
return cache.get(key);
}
@@ -51686,7 +51689,7 @@ var ts;
context.symbolDepth = new ts.Map();
}
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
- var key = getTypeId(type) + "|" + context.flags;
+ var key = "".concat(getTypeId(type), "|").concat(context.flags);
if (links) {
links.serializedTypes || (links.serializedTypes = new ts.Map());
}
@@ -51955,7 +51958,7 @@ var ts;
}
}
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
- typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... " + (properties.length - i) + " more ...", /*questionToken*/ undefined, /*type*/ undefined));
+ typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
break;
}
@@ -52070,7 +52073,7 @@ var ts;
else if (types.length > 2) {
return [
typeToTypeNodeHelper(types[0], context),
- ts.factory.createTypeReferenceNode("... " + (types.length - 2) + " more ...", /*typeArguments*/ undefined),
+ ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
typeToTypeNodeHelper(types[types.length - 1], context)
];
}
@@ -52084,7 +52087,7 @@ var ts;
var type = types_2[_i];
i++;
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
- result_5.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined));
+ result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
if (typeNode_1) {
result_5.push(typeNode_1);
@@ -52607,7 +52610,7 @@ var ts;
var text = rawtext;
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
i++;
- text = rawtext + "_" + i;
+ text = "".concat(rawtext, "_").concat(i);
}
if (text !== rawtext) {
result = ts.factory.createIdentifier(text, result.typeArguments);
@@ -52927,7 +52930,7 @@ var ts;
function getNameForJSDocFunctionParameter(p, index) {
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
: getEffectiveDotDotDotForParameter(p) ? "args"
- : "arg" + index;
+ : "arg".concat(index);
}
function rewriteModuleSpecifier(parent, lit) {
if (bundled) {
@@ -54012,7 +54015,7 @@ var ts;
return results_1;
}
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
- return ts.Debug.fail("Unhandled class member kind! " + (p.__debugFlags || p.flags));
+ return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
};
}
function serializePropertySymbolForInterface(p, baseType) {
@@ -54087,7 +54090,7 @@ var ts;
if (ref) {
return ref;
}
- var tempName = getUnusedName(rootName + "_base");
+ var tempName = getUnusedName("".concat(rootName, "_base"));
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
], 2 /* Const */));
@@ -54134,7 +54137,7 @@ var ts;
var original = input;
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
i++;
- input = original + "_" + i;
+ input = "".concat(original, "_").concat(i);
}
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
if (id) {
@@ -54242,15 +54245,15 @@ var ts;
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
var name = "" + nameType.value;
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
- return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\"";
+ return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
}
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
- return "[" + name + "]";
+ return "[".concat(name, "]");
}
return name;
}
if (nameType.flags & 8192 /* UniqueESSymbol */) {
- return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
+ return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
}
}
}
@@ -57081,7 +57084,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -59032,7 +59035,7 @@ var ts;
return result;
}
function getAliasId(aliasSymbol, aliasTypeArguments) {
- return aliasSymbol ? "@" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? ":" + getTypeListId(aliasTypeArguments) : "") : "";
+ return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
}
// This function is used to propagate certain flags when creating new object type references and union types.
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
@@ -59218,7 +59221,7 @@ var ts;
return undefined;
}
function getSymbolPath(symbol) {
- return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
+ return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
@@ -59229,7 +59232,7 @@ var ts;
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
undefined;
- var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
+ var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
var result = unresolvedSymbols.get(path);
if (!result) {
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
@@ -59302,7 +59305,7 @@ var ts;
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
return baseType;
}
- var id = getTypeId(baseType) + ">" + getTypeId(substitute);
+ var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
var cached = substitutionTypes.get(id);
if (cached) {
return cached;
@@ -60226,9 +60229,9 @@ var ts;
return types[0];
}
var typeKey = !origin ? getTypeListId(types) :
- origin.flags & 1048576 /* Union */ ? "|" + getTypeListId(origin.types) :
- origin.flags & 2097152 /* Intersection */ ? "&" + getTypeListId(origin.types) :
- "#" + origin.type.id + "|" + getTypeListId(types); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
+ origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
+ origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
+ "#".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
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
var type = unionTypes.get(id);
if (!type) {
@@ -60750,7 +60753,7 @@ var ts;
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
return stringType;
}
- var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join("");
+ var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
var type = templateLiteralTypes.get(id);
if (!type) {
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
@@ -60810,7 +60813,7 @@ var ts;
return str;
}
function getStringMappingTypeForGenericType(symbol, type) {
- var id = getSymbolId(symbol) + "," + getTypeId(type);
+ var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
var result = stringMappingTypes.get(id);
if (!result) {
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
@@ -61827,7 +61830,7 @@ var ts;
function createUniqueESSymbolType(symbol) {
var type = createType(8192 /* UniqueESSymbol */);
type.symbol = symbol;
- type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
+ type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
return type;
}
function getESSymbolLikeTypeForNode(node) {
@@ -63422,11 +63425,11 @@ var ts;
var overflow = false;
var overrideNextErrorInfo = 0; // How many `reportRelationError` calls should be skipped in the elaboration pyramid
var lastSkippedInfo;
- var incompatibleStack = [];
+ var incompatibleStack;
var inPropertyCheck = false;
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
var result = isRelatedTo(source, target, 3 /* Both */, /*reportErrors*/ !!errorNode, headMessage);
- if (incompatibleStack.length) {
+ if (incompatibleStack) {
reportIncompatibleStack();
}
if (overflow) {
@@ -63483,19 +63486,19 @@ var ts;
return {
errorInfo: errorInfo,
lastSkippedInfo: lastSkippedInfo,
- incompatibleStack: incompatibleStack.slice(),
+ incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
overrideNextErrorInfo: overrideNextErrorInfo,
- relatedInfo: !relatedInfo ? undefined : relatedInfo.slice()
+ relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
};
}
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
overrideNextErrorInfo++; // Suppress the next relation error
lastSkippedInfo = undefined; // Reset skipped info cache
- incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
+ (incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
}
function reportIncompatibleStack() {
- var stack = incompatibleStack;
- incompatibleStack = [];
+ var stack = incompatibleStack || [];
+ incompatibleStack = undefined;
var info = lastSkippedInfo;
lastSkippedInfo = undefined;
if (stack.length === 1) {
@@ -63516,24 +63519,24 @@ var ts;
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
// Parenthesize a `new` if there is one
if (path.indexOf("new ") === 0) {
- path = "(" + path + ")";
+ path = "(".concat(path, ")");
}
var str = "" + args[0];
// If leading, just print back the arg (irrespective of if it's a valid identifier)
if (path.length === 0) {
- path = "" + str;
+ path = "".concat(str);
}
// Otherwise write a dotted name if possible
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
- path = path + "." + str;
+ path = "".concat(path, ".").concat(str);
}
// Failing that, check if the name is already a computed name
else if (str[0] === "[" && str[str.length - 1] === "]") {
- path = "" + path + str;
+ path = "".concat(path).concat(str);
}
// And finally write out a computed name as a last resort
else {
- path = path + "[" + str + "]";
+ path = "".concat(path, "[").concat(str, "]");
}
break;
}
@@ -63562,7 +63565,7 @@ var ts;
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
? ""
: "...";
- path = "" + prefix + path + "(" + params + ")";
+ path = "".concat(prefix).concat(path, "(").concat(params, ")");
}
break;
}
@@ -63575,7 +63578,7 @@ var ts;
break;
}
default:
- return ts.Debug.fail("Unhandled Diagnostic: " + msg.code);
+ return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
}
}
if (path) {
@@ -63601,7 +63604,7 @@ var ts;
}
function reportError(message, arg0, arg1, arg2, arg3) {
ts.Debug.assert(!!errorNode);
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
if (message.elidedInCompatabilityPyramid)
return;
@@ -63617,7 +63620,7 @@ var ts;
}
}
function reportRelationError(message, source, target) {
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
var generalizedSource = source;
@@ -63729,7 +63732,9 @@ var ts;
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
return -1 /* True */;
}
- reportErrorResults(originalSource, originalTarget, 0 /* False */, !!(ts.getObjectFlags(originalSource) & 2048 /* JsxAttributes */));
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
+ }
return 0 /* False */;
}
// Normalize the source and target types: Turn fresh literal types into regular literal types,
@@ -63741,7 +63746,12 @@ var ts;
if (source === target)
return -1 /* True */;
if (relation === identityRelation) {
- return isIdenticalTo(source, target, recursionFlags);
+ if (source.flags !== target.flags)
+ return 0 /* False */;
+ if (source.flags & 67358815 /* Singleton */)
+ return -1 /* True */;
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
}
// We fastpath comparing a type parameter to exactly its constraint, as this is _super_ common,
// and otherwise, for type parameters in large unions, causes us to need to compare the union to itself,
@@ -63751,163 +63761,130 @@ var ts;
if (source.flags & 262144 /* TypeParameter */ && getConstraintOfType(source) === target) {
return -1 /* True */;
}
- // Try to see if we're relating something like `Foo` -> `Bar | null | undefined`.
- // If so, reporting the `null` and `undefined` in the type is hardly useful.
- // First, see if we're even relating an object type to a union.
- // Then see if the target is stripped down to a single non-union type.
- // Note
- // * We actually want to remove null and undefined naively here (rather than using getNonNullableType),
- // since we don't want to end up with a worse error like "`Foo` is not assignable to `NonNullable`"
- // when dealing with generics.
- // * We also don't deal with primitive source types, since we already halt elaboration below.
- if (target.flags & 1048576 /* Union */ && source.flags & 524288 /* Object */ &&
- target.types.length <= 3 && maybeTypeOfKind(target, 98304 /* Nullable */)) {
- var nullStrippedTarget = extractTypesOfKind(target, ~98304 /* Nullable */);
- if (!(nullStrippedTarget.flags & (1048576 /* Union */ | 131072 /* Never */))) {
- target = getNormalizedType(nullStrippedTarget, /*writing*/ true);
+ // See if we're relating a definitely non-nullable type to a union that includes null and/or undefined
+ // plus a single non-nullable type. If so, remove null and/or undefined from the target type.
+ if (source.flags & 470302716 /* DefinitelyNonNullable */ && target.flags & 1048576 /* Union */) {
+ var types = target.types;
+ var candidate = types.length === 2 && types[0].flags & 98304 /* Nullable */ ? types[1] :
+ types.length === 3 && types[0].flags & 98304 /* Nullable */ && types[1].flags & 98304 /* Nullable */ ? types[2] :
+ undefined;
+ if (candidate && !(candidate.flags & 98304 /* Nullable */)) {
+ target = getNormalizedType(candidate, /*writing*/ true);
+ if (source === target)
+ return -1 /* True */;
}
- if (source === nullStrippedTarget)
- return -1 /* True */;
}
if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) ||
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
return -1 /* True */;
- var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
- var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
- if (isPerformingExcessPropertyChecks) {
- if (hasExcessProperties(source, target, reportErrors)) {
+ if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {
+ var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
+ if (isPerformingExcessPropertyChecks) {
+ if (hasExcessProperties(source, target, reportErrors)) {
+ if (reportErrors) {
+ reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ }
+ return 0 /* False */;
+ }
+ }
+ var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
+ source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
+ target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
+ (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
+ var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
+ if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
if (reportErrors) {
- reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
+ var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
+ var calls = getSignaturesOfType(source, 0 /* Call */);
+ var constructs = getSignaturesOfType(source, 1 /* Construct */);
+ if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
+ constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
+ reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
+ }
+ else {
+ reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
+ }
}
return 0 /* False */;
}
- }
- var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
- source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
- target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
- (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
- if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
- if (reportErrors) {
- var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
- var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
- var calls = getSignaturesOfType(source, 0 /* Call */);
- var constructs = getSignaturesOfType(source, 1 /* Construct */);
- if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
- constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
- reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
- }
- else {
- reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
- }
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ var skipCaching = source.flags & 1048576 /* Union */ && source.types.length < 4 && !(target.flags & 1048576 /* Union */) ||
+ target.flags & 1048576 /* Union */ && target.types.length < 4 && !(source.flags & 469499904 /* StructuredOrInstantiable */);
+ var result_7 = skipCaching ?
+ unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
+ recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
+ // For certain combinations involving intersections and optional, excess, or mismatched properties we need
+ // an extra property check where the intersection is viewed as a single object. The following are motivating
+ // examples that all should be errors, but aren't without this extra property check:
+ //
+ // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
+ //
+ // declare let wrong: { a: { y: string } };
+ // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
+ //
+ // function foo(x: { a?: string }, y: T & { a: boolean }) {
+ // x = y; // Mismatched property in source intersection
+ // }
+ //
+ // We suppress recursive intersection property checks because they can generate lots of work when relating
+ // recursive intersections that are structurally similar but not exactly identical. See #37854.
+ if (result_7 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
+ isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
+ inPropertyCheck = true;
+ result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
+ inPropertyCheck = false;
}
- return 0 /* False */;
- }
- traceUnionsOrIntersectionsTooLarge(source, target);
- var result = 0 /* False */;
- var saveErrorInfo = captureErrorCalculationState();
- if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
- // We skip caching when source or target is a union with no more than three constituents.
- result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
- }
- else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
- result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
- }
- if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
- if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
- resetErrorInfo(saveErrorInfo);
+ if (result_7) {
+ return result_7;
}
}
- if (!result && source.flags & (2097152 /* Intersection */ | 262144 /* TypeParameter */)) {
- // The combined constraint of an intersection type is the intersection of the constraints of
- // the constituents. When an intersection type contains instantiable types with union type
- // constraints, there are situations where we need to examine the combined constraint. One is
- // when the target is a union type. Another is when the intersection contains types belonging
- // to one of the disjoint domains. For example, given type variables T and U, each with the
- // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
- // we need to check this constraint against a union on the target side. Also, given a type
- // variable V constrained to 'string | number', 'V & number' has a combined constraint of
- // 'string & number | number & number' which reduces to just 'number'.
- // This also handles type parameters, as a type parameter with a union constraint compared against a union
- // needs to have its constraint hoisted into an intersection with said type parameter, this way
- // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
- // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
- var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
- if (constraint && (source.flags & 2097152 /* Intersection */ || target.flags & 1048576 /* Union */)) {
- if (everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
- // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
- if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
- resetErrorInfo(saveErrorInfo);
- }
- }
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, source, target, headMessage);
+ }
+ return 0 /* False */;
+ }
+ function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
+ var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
+ var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
+ source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
+ target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
+ var maybeSuppress = overrideNextErrorInfo > 0;
+ if (maybeSuppress) {
+ overrideNextErrorInfo--;
+ }
+ if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
+ var currentError = errorInfo;
+ tryElaborateArrayLikeErrors(source, target, /*reportErrors*/ true);
+ if (errorInfo !== currentError) {
+ maybeSuppress = !!errorInfo;
}
}
- // For certain combinations involving intersections and optional, excess, or mismatched properties we need
- // an extra property check where the intersection is viewed as a single object. The following are motivating
- // examples that all should be errors, but aren't without this extra property check:
- //
- // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
- //
- // declare let wrong: { a: { y: string } };
- // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
- //
- // function foo(x: { a?: string }, y: T & { a: boolean }) {
- // x = y; // Mismatched property in source intersection
- // }
- //
- // We suppress recursive intersection property checks because they can generate lots of work when relating
- // recursive intersections that are structurally similar but not exactly identical. See #37854.
- if (result && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
- isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
- inPropertyCheck = true;
- result &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
- inPropertyCheck = false;
+ if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
+ tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
- reportErrorResults(source, target, result, isComparingJsxAttributes);
- return result;
- function reportErrorResults(source, target, result, isComparingJsxAttributes) {
- if (!result && reportErrors) {
- var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
- var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
- source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
- target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
- var maybeSuppress = overrideNextErrorInfo > 0;
- if (maybeSuppress) {
- overrideNextErrorInfo--;
- }
- if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
- var currentError = errorInfo;
- tryElaborateArrayLikeErrors(source, target, reportErrors);
- if (errorInfo !== currentError) {
- maybeSuppress = !!errorInfo;
- }
- }
- if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
- tryElaborateErrorsForPrimitivesAndObjects(source, target);
- }
- else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
- reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
- }
- else if (isComparingJsxAttributes && target.flags & 2097152 /* Intersection */) {
- var targetTypes = target.types;
- var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
- var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
- if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
- (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
- // do not report top error
- return result;
- }
- }
- else {
- errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
- }
- if (!headMessage && maybeSuppress) {
- lastSkippedInfo = [source, target];
- // Used by, eg, missing property checking to replace the top-level message with a more informative one
- return result;
- }
- reportRelationError(headMessage, source, target);
+ else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
+ reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
+ }
+ else if (ts.getObjectFlags(source) & 2048 /* JsxAttributes */ && target.flags & 2097152 /* Intersection */) {
+ var targetTypes = target.types;
+ var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
+ var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
+ if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
+ (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
+ // do not report top error
+ return;
}
}
+ else {
+ errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
+ }
+ if (!headMessage && maybeSuppress) {
+ lastSkippedInfo = [source, target];
+ // Used by, eg, missing property checking to replace the top-level message with a more informative one
+ return;
+ }
+ reportRelationError(headMessage, source, target);
}
function traceUnionsOrIntersectionsTooLarge(source, target) {
if (!ts.tracing) {
@@ -63934,21 +63911,6 @@ var ts;
}
}
}
- function isIdenticalTo(source, target, recursionFlags) {
- if (source.flags !== target.flags)
- return 0 /* False */;
- if (source.flags & 67358815 /* Singleton */)
- return -1 /* True */;
- traceUnionsOrIntersectionsTooLarge(source, target);
- if (source.flags & 3145728 /* UnionOrIntersection */) {
- var result_7 = eachTypeRelatedToSomeType(source, target);
- if (result_7) {
- result_7 &= eachTypeRelatedToSomeType(target, source);
- }
- return result_7;
- }
- return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
- }
function getTypeOfPropertyInTypes(types, name) {
var appendPropType = function (propTypes, type) {
var _a;
@@ -64047,6 +64009,41 @@ var ts;
function shouldCheckAsExcessProperty(prop, container) {
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
}
+ function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
+ // Note that these checks are specifically ordered to produce correct results. In particular,
+ // we need to deconstruct unions before intersections (because unions are always at the top),
+ // and we need to handle "each" relations before "some" relations for the same kind of type.
+ if (source.flags & 1048576 /* Union */) {
+ return relation === comparableRelation ?
+ someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) :
+ eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState);
+ }
+ if (target.flags & 1048576 /* Union */) {
+ return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
+ }
+ if (target.flags & 2097152 /* Intersection */) {
+ return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
+ }
+ // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
+ // constraints of all non-primitive types in the source into a new intersection. We do this because the
+ // intersection may further constrain the constraints of the non-primitive types. For example, given a type
+ // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
+ // appear to be comparable to '2'.
+ if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
+ var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
+ if (constraints !== source.types) {
+ source = getIntersectionType(constraints);
+ if (!(source.flags & 2097152 /* Intersection */)) {
+ return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
+ }
+ }
+ }
+ // Check to see if any constituents of the intersection are immediately related to the target.
+ // Don't report errors though. Elaborating on whether a source constituent is related to the target is
+ // not actually useful and leads to some confusing error messages. Instead, we rely on the caller
+ // checking whether the full intersection viewed as an object is related to the target.
+ return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
+ }
function eachTypeRelatedToSomeType(source, target) {
var result = -1 /* True */;
var sourceTypes = source.types;
@@ -64082,8 +64079,11 @@ var ts;
}
}
if (reportErrors) {
+ // Elaborate only if we can find a best matching type in the target union
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
- isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], 2 /* Target */, /*reportErrors*/ true);
+ if (bestMatchingType) {
+ isRelatedTo(source, bestMatchingType, 2 /* Target */, /*reportErrors*/ true);
+ }
}
return 0 /* False */;
}
@@ -64219,7 +64219,7 @@ var ts;
if (overflow) {
return 0 /* False */;
}
- var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0);
+ var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 /* InPropertyCheck */ : 0);
var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false);
var entry = relation.get(id);
if (entry !== undefined) {
@@ -64287,6 +64287,7 @@ var ts;
return originalHandler(onlyUnreliable);
};
}
+ var result;
if (expandingFlags === 3 /* Both */) {
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "recursiveTypeRelatedTo_DepthLimit", {
sourceId: source.id,
@@ -64296,8 +64297,13 @@ var ts;
depth: sourceDepth,
targetDepth: targetDepth
});
+ result = 3 /* Maybe */;
+ }
+ else {
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
+ result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
}
- var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */;
if (outofbandVarianceMarkerHandler) {
outofbandVarianceMarkerHandler = originalHandler;
}
@@ -64329,98 +64335,97 @@ var ts;
return result;
}
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
- var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
- return result;
- }
- function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
if (intersectionState & 4 /* PropertyCheck */) {
return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */);
}
- if (intersectionState & 8 /* UnionIntersectionCheck */) {
- // Note that these checks are specifically ordered to produce correct results. In particular,
- // we need to deconstruct unions before intersections (because unions are always at the top),
- // and we need to handle "each" relations before "some" relations for the same kind of type.
- if (source.flags & 1048576 /* Union */) {
- return relation === comparableRelation ?
- someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */) :
- eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */);
- }
- if (target.flags & 1048576 /* Union */) {
- return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
- }
- if (target.flags & 2097152 /* Intersection */) {
- return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
- }
- // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
- // constraints of all non-primitive types in the source into a new intersection. We do this because the
- // intersection may further constrain the constraints of the non-primitive types. For example, given a type
- // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
- // appear to be comparable to '2'.
- if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
- var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
- if (constraints !== source.types) {
- source = getIntersectionType(constraints);
- if (!(source.flags & 2097152 /* Intersection */)) {
- return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
- }
+ var result;
+ var originalErrorInfo;
+ var varianceCheckFailed = false;
+ var saveErrorInfo = captureErrorCalculationState();
+ var sourceFlags = source.flags;
+ var targetFlags = target.flags;
+ if (relation === identityRelation) {
+ // We've already checked that source.flags and target.flags are identical
+ if (sourceFlags & 3145728 /* UnionOrIntersection */) {
+ var result_8 = eachTypeRelatedToSomeType(source, target);
+ if (result_8) {
+ result_8 &= eachTypeRelatedToSomeType(target, source);
}
+ return result_8;
}
- // Check to see if any constituents of the intersection are immediately related to the target.
- //
- // Don't report errors though. Checking whether a constituent is related to the source is not actually
- // useful and leads to some confusing error messages. Instead it is better to let the below checks
- // take care of this, or to not elaborate at all. For instance,
- //
- // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors.
- //
- // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection
- // than to report that 'D' is not assignable to 'A' or 'B'.
- //
- // - For a primitive type or type parameter (such as 'number = A & B') there is no point in
- // breaking the intersection apart.
- return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
- }
- var flags = source.flags & target.flags;
- if (relation === identityRelation && !(flags & 524288 /* Object */)) {
- if (flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
return isRelatedTo(source.type, target.type, 3 /* Both */, /*reportErrors*/ false);
}
- var result_8 = 0 /* False */;
- if (flags & 8388608 /* IndexedAccess */) {
- if (result_8 = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
+ if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
- if (flags & 16777216 /* Conditional */) {
+ if (sourceFlags & 16777216 /* Conditional */) {
if (source.root.isDistributive === target.root.isDistributive) {
- if (result_8 = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (result = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
}
}
}
- if (flags & 33554432 /* Substitution */) {
+ if (sourceFlags & 33554432 /* Substitution */) {
return isRelatedTo(source.substitute, target.substitute, 3 /* Both */, /*reportErrors*/ false);
}
- return 0 /* False */;
+ if (!(sourceFlags & 524288 /* Object */)) {
+ return 0 /* False */;
+ }
+ }
+ else if (sourceFlags & 3145728 /* UnionOrIntersection */ || targetFlags & 3145728 /* UnionOrIntersection */) {
+ if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
+ return result;
+ }
+ if (source.flags & 2097152 /* Intersection */ || source.flags & 262144 /* TypeParameter */ && target.flags & 1048576 /* Union */) {
+ // The combined constraint of an intersection type is the intersection of the constraints of
+ // the constituents. When an intersection type contains instantiable types with union type
+ // constraints, there are situations where we need to examine the combined constraint. One is
+ // when the target is a union type. Another is when the intersection contains types belonging
+ // to one of the disjoint domains. For example, given type variables T and U, each with the
+ // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
+ // we need to check this constraint against a union on the target side. Also, given a type
+ // variable V constrained to 'string | number', 'V & number' has a combined constraint of
+ // 'string & number | number & number' which reduces to just 'number'.
+ // This also handles type parameters, as a type parameter with a union constraint compared against a union
+ // needs to have its constraint hoisted into an intersection with said type parameter, this way
+ // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
+ // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
+ var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
+ if (constraint && everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
+ // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
+ if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
+ resetErrorInfo(saveErrorInfo);
+ return result;
+ }
+ }
+ }
+ // The ordered decomposition above doesn't handle all cases. Specifically, we also need to handle:
+ // Source is instantiable (e.g. source has union or intersection constraint).
+ // Source is an object, target is a union (e.g. { a, b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target is an object (e.g. { a } & { b } <=> { a, b }).
+ // Source is an intersection, target is a union (e.g. { a } & { b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target instantiable (e.g. string & { tag } <=> T["a"] constrained to string & { tag }).
+ if (!(sourceFlags & 465829888 /* Instantiable */ ||
+ sourceFlags & 524288 /* Object */ && targetFlags & 1048576 /* Union */ ||
+ sourceFlags & 2097152 /* Intersection */ && targetFlags & (524288 /* Object */ | 1048576 /* Union */ | 465829888 /* Instantiable */))) {
+ return 0 /* False */;
+ }
}
- var result;
- var originalErrorInfo;
- var varianceCheckFailed = false;
- var saveErrorInfo = captureErrorCalculationState();
// We limit alias variance probing to only object and conditional types since their alias behavior
// is more predictable than other, interned types, which may or may not have an alias depending on
// the order in which things were checked.
- if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
+ if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
var variances = getAliasVariances(source.aliasSymbol);
@@ -64438,7 +64443,7 @@ var ts;
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2 /* Target */))) {
return result;
}
- if (target.flags & 262144 /* TypeParameter */) {
+ if (targetFlags & 262144 /* TypeParameter */) {
// A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q].
if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3 /* Both */)) {
if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) {
@@ -64450,10 +64455,10 @@ var ts;
}
}
}
- else if (target.flags & 4194304 /* Index */) {
+ else if (targetFlags & 4194304 /* Index */) {
var targetType_1 = target.type;
// A keyof S is related to a keyof T if T is related to S.
- if (source.flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(targetType_1, source.type, 3 /* Both */, /*reportErrors*/ false)) {
return result;
}
@@ -64504,8 +64509,8 @@ var ts;
}
}
}
- else if (target.flags & 8388608 /* IndexedAccess */) {
- if (source.flags & 8388608 /* IndexedAccess */) {
+ else if (targetFlags & 8388608 /* IndexedAccess */) {
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
// Relate components directly before falling back to constraint relationships
// A type S[K] is related to a type T[J] if S is related to T and K is related to J.
if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, reportErrors)) {
@@ -64611,7 +64616,7 @@ var ts;
}
}
}
- else if (target.flags & 16777216 /* Conditional */) {
+ else if (targetFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
@@ -64636,8 +64641,8 @@ var ts;
}
}
}
- else if (target.flags & 134217728 /* TemplateLiteral */) {
- if (source.flags & 134217728 /* TemplateLiteral */) {
+ else if (targetFlags & 134217728 /* TemplateLiteral */) {
+ if (sourceFlags & 134217728 /* TemplateLiteral */) {
if (relation === comparableRelation) {
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 /* False */ : -1 /* True */;
}
@@ -64649,11 +64654,11 @@ var ts;
return -1 /* True */;
}
}
- if (source.flags & 8650752 /* TypeVariable */) {
- // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
- if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
+ if (sourceFlags & 8650752 /* TypeVariable */) {
+ // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
+ if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
var constraint = getConstraintOfType(source);
- if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
+ if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
// A type variable with no constraint is not related to the non-primitive object type.
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
resetErrorInfo(saveErrorInfo);
@@ -64666,7 +64671,7 @@ var ts;
return result;
}
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(target.flags & source.flags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
+ else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
resetErrorInfo(saveErrorInfo);
return result;
}
@@ -64683,14 +64688,14 @@ var ts;
}
}
}
- else if (source.flags & 4194304 /* Index */) {
+ else if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(keyofConstraintType, target, 1 /* Source */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
}
}
- else if (source.flags & 134217728 /* TemplateLiteral */ && !(target.flags & 524288 /* Object */)) {
- if (!(target.flags & 134217728 /* TemplateLiteral */)) {
+ else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
+ if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
var constraint = getBaseConstraintOfType(source);
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1 /* Source */, reportErrors))) {
resetErrorInfo(saveErrorInfo);
@@ -64698,8 +64703,8 @@ var ts;
}
}
}
- else if (source.flags & 268435456 /* StringMapping */) {
- if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
+ else if (sourceFlags & 268435456 /* StringMapping */) {
+ if (targetFlags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
@@ -64713,14 +64718,14 @@ var ts;
}
}
}
- else if (source.flags & 16777216 /* Conditional */) {
+ else if (sourceFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
resetErrorInfo(saveErrorInfo);
return 3 /* Maybe */;
}
- if (target.flags & 16777216 /* Conditional */) {
+ if (targetFlags & 16777216 /* Conditional */) {
// Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if
// one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2,
// and Y1 is related to Y2.
@@ -64780,9 +64785,10 @@ var ts;
}
return 0 /* False */;
}
- var sourceIsPrimitive = !!(source.flags & 131068 /* Primitive */);
+ var sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */);
if (relation !== identityRelation) {
source = getApparentType(source);
+ sourceFlags = source.flags;
}
else if (isGenericMappedType(source)) {
return 0 /* False */;
@@ -64824,7 +64830,7 @@ var ts;
// In a check of the form X = A & B, we will have previously checked if A relates to X or B relates
// to X. Failing both of those we want to check if the aggregation of A and B's members structurally
// relates to X. Thus, we include intersection types on the source side here.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 524288 /* Object */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
// Report structural errors only if we haven't reported any errors yet
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined, intersectionState);
@@ -64848,7 +64854,7 @@ var ts;
// there exists a constituent of T for every combination of the discriminants of S
// with respect to T. We do not report errors here, as we will use the existing
// error result from checking each constituent of the union.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 1048576 /* Union */) {
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
if (objectOnlyTarget.flags & 1048576 /* Union */) {
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
@@ -65363,7 +65369,6 @@ var ts;
}
}
var result = -1 /* True */;
- var saveErrorInfo = captureErrorCalculationState();
var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
var sourceObjectFlags = ts.getObjectFlags(source);
var targetObjectFlags = ts.getObjectFlags(target);
@@ -65404,6 +65409,7 @@ var ts;
else {
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
var t = targetSignatures_1[_i];
+ var saveErrorInfo = captureErrorCalculationState();
// Only elaborate errors from the first failure
var shouldElaborateErrors = reportErrors;
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
@@ -65777,7 +65783,7 @@ var ts;
var constraintMarker = "";
var sourceId = getTypeReferenceId(source, 0);
var targetId = getTypeReferenceId(target, 0);
- return "" + constraintMarker + sourceId + "," + targetId + postFix;
+ return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
// getTypeReferenceId(A) returns "111=0-12=1"
// where A.id=111 and number.id=12
function getTypeReferenceId(type, depth) {
@@ -65821,7 +65827,7 @@ var ts;
var postFix = intersectionState ? ":" + intersectionState : "";
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
- source.id + "," + target.id + postFix;
+ "".concat(source.id, ",").concat(target.id).concat(postFix);
}
// Invoke the callback for each underlying property symbol of the given symbol and return the first
// value that isn't undefined.
@@ -67948,11 +67954,11 @@ var ts;
case 79 /* Identifier */:
if (!ts.isThisInTypeQuery(node)) {
var symbol = getResolvedSymbol(node);
- return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
+ return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
}
// falls through
case 108 /* ThisKeyword */:
- return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
+ return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
case 229 /* NonNullExpression */:
case 211 /* ParenthesizedExpression */:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
@@ -68574,9 +68580,6 @@ var ts;
getUnionType(ts.map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) :
mapType(type, mapper);
}
- function getConstituentCount(type) {
- return type.flags & 1048576 /* Union */ ? type.types.length : 1;
- }
function extractTypesOfKind(type, kind) {
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
}
@@ -70150,7 +70153,7 @@ var ts;
var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
+ return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
}
function isExportOrExportExpression(location) {
return !!ts.findAncestor(location, function (n) {
@@ -71841,7 +71844,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -76242,21 +76245,22 @@ var ts;
if (links.type === unknownType) {
links.type = getTypeFromBindingPattern(declaration.name);
}
- assignBindingElementTypes(declaration.name);
+ assignBindingElementTypes(declaration.name, links.type);
}
}
}
// When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push
// the destructured type into the contained binding elements.
- function assignBindingElementTypes(pattern) {
+ function assignBindingElementTypes(pattern, parentType) {
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
+ var type = getBindingElementTypeFromParentType(element, parentType);
if (element.name.kind === 79 /* Identifier */) {
- getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
+ getSymbolLinks(getSymbolOfNode(element)).type = type;
}
else {
- assignBindingElementTypes(element.name);
+ assignBindingElementTypes(element.name, type);
}
}
}
@@ -79997,28 +80001,24 @@ var ts;
if (returnType.flags & 1 /* Any */) {
return;
}
+ var headMessage;
var expectedReturnType;
- var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
- var errorInfo;
switch (node.parent.kind) {
case 256 /* ClassDeclaration */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 163 /* Parameter */:
- expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
- break;
case 166 /* PropertyDeclaration */:
+ case 163 /* Parameter */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
case 168 /* MethodDeclaration */:
case 171 /* GetAccessor */:
case 172 /* SetAccessor */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -80026,7 +80026,7 @@ var ts;
default:
return ts.Debug.fail();
}
- checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; });
+ checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
}
/**
* If a TypeNode can be resolved to a value symbol imported from an external module, it is
@@ -81708,7 +81708,7 @@ var ts;
function getPropertyNameForKnownSymbolName(symbolName) {
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
- return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
+ return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
}
/**
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
@@ -82299,9 +82299,9 @@ var ts;
var containsArguments = containsArgumentsReference(node);
if (containsArguments) {
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
- if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
+ if (isJs && lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
- errorOrSuggestion(isJs, lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
+ error(lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
}
}
else {
@@ -82311,7 +82311,9 @@ var ts;
return;
}
if (ts.isQualifiedName(name)) {
- errorOrSuggestion(isJs, name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ if (isJs) {
+ error(name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ }
}
else {
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
@@ -87490,29 +87492,28 @@ var ts;
}
function findMostOverlappyType(source, unionTarget) {
var bestMatch;
- var matchingCount = 0;
- for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
- var target = _a[_i];
- var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
- if (overlap.flags & 4194304 /* Index */) {
- // perfect overlap of keys
- bestMatch = target;
- matchingCount = Infinity;
- }
- else if (overlap.flags & 1048576 /* Union */) {
- // We only want to account for literal types otherwise.
- // If we have a union of index types, it seems likely that we
- // needed to elaborate between two generic mapped types anyway.
- var len = ts.length(ts.filter(overlap.types, isUnitType));
- if (len >= matchingCount) {
- bestMatch = target;
- matchingCount = len;
+ if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var matchingCount = 0;
+ for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
+ var target = _a[_i];
+ if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
+ if (overlap.flags & 4194304 /* Index */) {
+ // perfect overlap of keys
+ return target;
+ }
+ else if (isUnitType(overlap) || overlap.flags & 1048576 /* Union */) {
+ // We only want to account for literal types otherwise.
+ // If we have a union of index types, it seems likely that we
+ // needed to elaborate between two generic mapped types anyway.
+ var len = overlap.flags & 1048576 /* Union */ ? ts.countWhere(overlap.types, isUnitType) : 1;
+ if (len >= matchingCount) {
+ bestMatch = target;
+ matchingCount = len;
+ }
+ }
}
}
- else if (isUnitType(overlap) && 1 >= matchingCount) {
- bestMatch = target;
- matchingCount = 1;
- }
}
return bestMatch;
}
@@ -88760,7 +88761,7 @@ var ts;
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
value === 62 ? 43 /* plus */ :
value === 63 ? 47 /* slash */ :
- ts.Debug.fail(value + ": not a base64 value");
+ ts.Debug.fail("".concat(value, ": not a base64 value"));
}
function base64FormatDecode(ch) {
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
@@ -88835,7 +88836,7 @@ var ts;
var mappings = ts.arrayFrom(decoder, processMapping);
if (decoder.error !== undefined) {
if (host.log) {
- host.log("Encountered error while decoding sourcemap: " + decoder.error);
+ host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
}
decodedMappings = ts.emptyArray;
}
@@ -92510,7 +92511,7 @@ var ts;
var propertyName = ts.isPropertyAccessExpression(originalNode)
? ts.declarationNameToString(originalNode.name)
: ts.getTextOfNode(originalNode.argumentExpression);
- ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
+ ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
}
return substitute;
}
@@ -93986,8 +93987,8 @@ var ts;
}
function createHoistedVariableForClass(name, node) {
var className = getPrivateIdentifierEnvironment().className;
- var prefix = className ? "_" + className : "";
- var identifier = factory.createUniqueName(prefix + "_" + name, 16 /* Optimistic */);
+ var prefix = className ? "_".concat(className) : "";
+ var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
addBlockScopedVariable(identifier);
}
@@ -95992,7 +95993,7 @@ var ts;
specifierSourceImports = new ts.Map();
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
}
- var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
+ var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
generatedName.generatedImportReference = specifier;
specifierSourceImports.set(name, specifier);
@@ -97140,11 +97141,11 @@ var ts;
}
else {
if (node.kind === 245 /* BreakStatement */) {
- labelMarker = "break-" + label.escapedText;
+ labelMarker = "break-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
}
else {
- labelMarker = "continue-" + label.escapedText;
+ labelMarker = "continue-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
}
}
@@ -106001,7 +106002,7 @@ var ts;
return getTypeAliasDeclarationVisibilityError;
}
else {
- return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
+ return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
@@ -106212,7 +106213,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
- return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
+ return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
}
}
function getTypeParameterConstraintVisibilityError() {
@@ -106970,7 +106971,7 @@ var ts;
while (ts.length(lateMarkedStatements)) {
var i = lateMarkedStatements.shift();
if (!ts.isLateVisibilityPaintedStatement(i)) {
- return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
+ 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));
}
var priorNeedsDeclare = needsDeclare;
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
@@ -107159,7 +107160,7 @@ var ts;
return cleanup(input);
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));
}
- default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
+ default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
}
}
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
@@ -107450,7 +107451,7 @@ var ts;
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
// We must add a temporary declaration for the extends clause expression
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
- var newId_1 = factory.createUniqueName(oldId + "_base", 16 /* Optimistic */);
+ var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
getSymbolAccessibilityDiagnostic = function () { return ({
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
errorNode: extendsClause_1,
@@ -107491,7 +107492,7 @@ var ts;
}
}
// Anything left unhandled is an error, so this should be unreachable
- return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
+ return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
function cleanup(node) {
if (isEnclosingDeclaration(input)) {
enclosingDeclaration = previousEnclosingDeclaration;
@@ -108383,13 +108384,13 @@ var ts;
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
return;
if (js && configFile.options.sourceMap) {
- addOutput(js + ".map");
+ addOutput("".concat(js, ".map"));
}
if (ts.getEmitDeclarations(configFile.options)) {
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
addOutput(dts);
if (configFile.options.declarationMap) {
- addOutput(dts + ".map");
+ addOutput("".concat(dts, ".map"));
}
}
}
@@ -108458,7 +108459,7 @@ var ts;
function getFirstProjectOutput(configFile, ignoreCase) {
if (ts.outFile(configFile.options)) {
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
- return ts.Debug.checkDefined(jsFilePath, "project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
@@ -108477,7 +108478,7 @@ var ts;
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
if (buildInfoPath)
return buildInfoPath;
- return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
ts.getFirstProjectOutput = getFirstProjectOutput;
/*@internal*/
@@ -108703,7 +108704,7 @@ var ts;
if (sourceMappingURL) {
if (!writer.isAtStartOfLine())
writer.rawWrite(newLine);
- writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Tools can sometimes see this line as a source mapping url comment
+ writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
}
// Write the source map
if (sourceMapFilePath) {
@@ -108752,7 +108753,7 @@ var ts;
// Encode the sourceMap into the sourceMap url
var sourceMapText = sourceMapGenerator.toString();
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
- return "data:application/json;base64," + base64SourceMapText;
+ return "data:application/json;base64,".concat(base64SourceMapText);
}
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
if (mapOptions.mapRoot) {
@@ -108932,7 +108933,7 @@ var ts;
return;
break;
default:
- ts.Debug.fail("Unexpected path: " + name);
+ ts.Debug.fail("Unexpected path: ".concat(name));
}
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
},
@@ -109792,7 +109793,7 @@ var ts;
return writeTokenNode(node, writeKeyword);
if (ts.isTokenKind(node.kind))
return writeTokenNode(node, writePunctuation);
- ts.Debug.fail("Unhandled SyntaxKind: " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
}
function emitMappedTypeParameter(node) {
emit(node.name);
@@ -109962,16 +109963,16 @@ var ts;
}
}
function emitPlaceholder(hint, node, snippet) {
- nonEscapingWrite("${" + snippet.order + ":"); // `${2:`
+ nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
nonEscapingWrite("}"); // `}`
// `${2:...}`
}
function emitTabStop(hint, node, snippet) {
// A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
- ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
- nonEscapingWrite("$" + snippet.order);
+ nonEscapingWrite("$".concat(snippet.order));
}
//
// Identifiers
@@ -111733,17 +111734,17 @@ var ts;
writeLine();
}
if (currentSourceFile && currentSourceFile.moduleName) {
- writeComment("/// ");
+ writeComment("/// "));
writeLine();
}
if (currentSourceFile && currentSourceFile.amdDependencies) {
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
var dep = _b[_a];
if (dep.name) {
- writeComment("/// ");
+ writeComment("/// "));
}
else {
- writeComment("/// ");
+ writeComment("/// "));
}
writeLine();
}
@@ -111751,7 +111752,7 @@ var ts;
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
var directive = files_2[_c];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
writeLine();
@@ -111759,7 +111760,7 @@ var ts;
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
var directive = types_24[_d];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
writeLine();
@@ -111767,7 +111768,7 @@ var ts;
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
var directive = libs_1[_e];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
writeLine();
@@ -112547,9 +112548,9 @@ var ts;
var textSourceNode = node.textSourceNode;
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
- return jsxAttributeEscape ? "\"" + ts.escapeJsxAttributeString(text) + "\"" :
- neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"" + ts.escapeString(text) + "\"" :
- "\"" + ts.escapeNonAsciiString(text) + "\"";
+ return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
+ neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
+ "\"".concat(ts.escapeNonAsciiString(text), "\"");
}
else {
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
@@ -113026,8 +113027,8 @@ var ts;
}
function formatSynthesizedComment(comment) {
return comment.kind === 3 /* MultiLineCommentTrivia */
- ? "/*" + comment.text + "*/"
- : "//" + comment.text;
+ ? "/*".concat(comment.text, "*/")
+ : "//".concat(comment.text);
}
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
enterComment();
@@ -113748,7 +113749,7 @@ var ts;
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;
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
if (!newPath) {
- writeLog("Project: " + configFileName + " Detected ignored path: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
return true;
}
fileOrDirectoryPath = newPath;
@@ -113757,11 +113758,11 @@ var ts;
// If the the added or created file or directory is not supported file name, ignore the file
// But when watched directory is added/removed, we need to reload the file list
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
- writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
return true;
}
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
- writeLog("Project: " + configFileName + " Detected excluded file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
return true;
}
if (!program)
@@ -113785,7 +113786,7 @@ var ts;
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
- writeLog("Project: " + configFileName + " Detected output file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
return true;
}
return false;
@@ -113853,36 +113854,36 @@ var ts;
host.useCaseSensitiveFileNames();
}
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
- log("ExcludeWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
return {
- close: function () { return log("ExcludeWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }
+ close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
};
}
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- log("FileWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
return {
close: function () {
- log("FileWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
watcher.close();
}
};
}
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- var watchInfo = "DirectoryWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
return {
close: function () {
- var watchInfo = "DirectoryWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
watcher.close();
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
}
};
}
@@ -113892,16 +113893,16 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
- var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher") + ":: Triggered with " + args[0] + " " + (args[1] !== undefined ? args[1] : "") + ":: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ 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));
log(triggerredInfo);
var start = ts.timestamp();
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + triggerredInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
}, flags, options, detailInfo1, detailInfo2); };
}
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
- return "WatchInfo: " + file + " " + flags + " " + JSON.stringify(options) + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2);
+ return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
}
}
ts.getWatchFactory = getWatchFactory;
@@ -114208,12 +114209,12 @@ var ts;
}
ts.formatDiagnostics = formatDiagnostics;
function formatDiagnostic(diagnostic, host) {
- var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();
+ var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
if (diagnostic.file) {
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
var fileName = diagnostic.file.fileName;
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
- return relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): " + errorMessage;
+ return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
}
return errorMessage;
}
@@ -114301,9 +114302,9 @@ var ts;
var output = "";
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
output += ":";
- output += color("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
output += ":";
- output += color("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
return output;
}
ts.formatLocation = formatLocation;
@@ -114317,7 +114318,7 @@ var ts;
output += " - ";
}
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
- output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
+ output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
if (diagnostic.file) {
output += host.getNewLine();
@@ -114426,7 +114427,7 @@ var ts;
var result = void 0;
var mode = getModeForResolutionAtIndex(containingFile, i);
i++;
- var cacheKey = mode !== undefined ? mode + "|" + name : name;
+ var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
if (cache.has(cacheKey)) {
result = cache.get(cacheKey);
}
@@ -116615,7 +116616,7 @@ var ts;
path += (i === 2 ? "/" : "-") + components[i];
i++;
}
- var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
+ var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
return localOverrideModuleResult.resolvedModule.resolvedFileName;
@@ -117436,12 +117437,12 @@ var ts;
}
function directoryExistsIfProjectReferenceDeclDir(dir) {
var dirPath = host.toPath(dir);
- var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
+ var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
// Any parent directory of declaration dir
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
// Any directory inside declaration dir
- ts.startsWith(dirPath, declDirPath + "/"); });
+ ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
}
function handleDirectoryCouldBeSymlink(directory) {
var _a;
@@ -117494,7 +117495,7 @@ var ts;
if (isFile && result) {
// Store the real path for the file'
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
- symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), ""));
+ symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
}
return result;
}) || false;
@@ -117952,7 +117953,7 @@ var ts;
/*forceDtsEmit*/ true);
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
if (firstDts_1) {
- 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: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
+ 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; }))); });
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
if (exportedModulesMapCache && latestSignature !== prevSignature) {
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
@@ -118460,7 +118461,7 @@ var ts;
return;
}
else {
- 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: " + affectedFile.fileName);
+ 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));
}
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
@@ -119605,7 +119606,7 @@ var ts;
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
- ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: " + failedLookupLocation + " failedLookupLocationPath: " + failedLookupLocationPath);
+ ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
if (failedLookupPathSplit.length > rootSplitLength + 1) {
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
return {
@@ -120687,7 +120688,7 @@ var ts;
}
function getJSExtensionForFile(fileName, options) {
var _a;
- return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension " + ts.extensionFromPath(fileName) + " is unsupported:: FileName:: " + fileName);
+ return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
}
function tryGetJSExtensionForFile(fileName, options) {
var ext = ts.tryGetExtensionFromPath(fileName);
@@ -120790,8 +120791,8 @@ var ts;
return pretty ?
function (diagnostic, newLine, options) {
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
- var output = "[" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);
+ var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
system.write(output);
} :
function (diagnostic, newLine, options) {
@@ -120799,8 +120800,8 @@ var ts;
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
output += newLine;
}
- output += getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);
+ output += "".concat(getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
system.write(output);
};
}
@@ -120823,7 +120824,7 @@ var ts;
.map(function (errorDiagnostic) {
if (errorDiagnostic.file === undefined)
return;
- return "" + errorDiagnostic.file.fileName;
+ return "".concat(errorDiagnostic.file.fileName);
});
return filesInError.map(function (fileName) {
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
@@ -120856,7 +120857,7 @@ var ts;
if (errorCount === 0)
return "";
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
- var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return "".concat(fileInError.fileName, ":").concat(fileInError.line); })
.filter(function (value, index, self) { return self.indexOf(value) === index; });
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
var d = errorCount === 1 ?
@@ -120869,7 +120870,7 @@ var ts;
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
+ return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix);
}
ts.getErrorSummaryText = getErrorSummaryText;
function createTabularErrorsDisplay(filesInError, host) {
@@ -120892,7 +120893,7 @@ var ts;
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
: "";
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
- tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
+ tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n");
});
return tabularData;
}
@@ -120919,9 +120920,9 @@ var ts;
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
var file = _c[_i];
- write("" + toFileName(file, relativeFileName));
- (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" " + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });
- (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" " + d.messageText); });
+ write("".concat(toFileName(file, relativeFileName)));
+ (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
+ (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
}
}
ts.explainFiles = explainFiles;
@@ -120961,7 +120962,7 @@ var ts;
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
return false;
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
- return !!pattern && ts.getRegexFromPattern("(" + pattern + ")$", useCaseSensitiveFileNames).test(fileName);
+ return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
});
}
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
@@ -120970,7 +120971,7 @@ var ts;
var options = program.getCompilerOptions();
if (ts.isReferencedFile(reason)) {
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
- var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"" + referenceLocation.text + "\"";
+ var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
var message = void 0;
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
switch (reason.kind) {
@@ -121094,7 +121095,7 @@ var ts;
var currentDir_1 = program.getCurrentDirectory();
ts.forEach(emittedFiles, function (file) {
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
- write("TSFILE: " + filepath);
+ write("TSFILE: ".concat(filepath));
});
listFiles(program, write);
}
@@ -121423,7 +121424,7 @@ var ts;
}
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
- writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames);
+ writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
var configFileWatcher;
if (configFileName) {
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
@@ -121579,10 +121580,10 @@ var ts;
function createNewProgram(hasInvalidatedResolution) {
// Compile the program
writeLog("CreatingProgramWith::");
- writeLog(" roots: " + JSON.stringify(rootFileNames));
- writeLog(" options: " + JSON.stringify(compilerOptions));
+ writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
+ writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
if (projectReferences)
- writeLog(" projectReferences: " + JSON.stringify(projectReferences));
+ writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
hasChangedCompilerOptions = false;
hasChangedConfigFileParsingErrors = false;
@@ -121743,7 +121744,7 @@ var ts;
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
}
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
- writeLog("Scheduling invalidateFailedLookup" + (pending ? ", Cancelled earlier one" : ""));
+ writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
}
function invalidateResolutionsOfFailedLookup() {
@@ -121803,7 +121804,7 @@ var ts;
synchronizeProgram();
}
function reloadConfigFile() {
- writeLog("Reloading config file: " + configFileName);
+ writeLog("Reloading config file: ".concat(configFileName));
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
if (cachedDirectoryStructureHost) {
cachedDirectoryStructureHost.clearCache();
@@ -121844,7 +121845,7 @@ var ts;
return config.parsedCommandLine;
}
}
- writeLog("Loading config file: " + configFileName);
+ writeLog("Loading config file: ".concat(configFileName));
var parsedCommandLine = host.getParsedCommandLine ?
host.getParsedCommandLine(configFileName) :
getParsedCommandLineFromConfigFileHost(configFileName);
@@ -122148,8 +122149,8 @@ var ts;
*/
function createBuilderStatusReporter(system, pretty) {
return function (diagnostic) {
- var output = pretty ? "[" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] " : ts.getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);
+ var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
system.write(output);
};
}
@@ -122924,7 +122925,7 @@ var ts;
function listEmittedFile(_a, proj, file) {
var write = _a.write;
if (write && proj.options.listEmittedFiles) {
- write("TSFILE: " + file);
+ write("TSFILE: ".concat(file));
}
}
function getOldProgram(_a, proj, parsed) {
@@ -122953,7 +122954,7 @@ var ts;
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
reportAndStoreErrors(state, resolvedPath, diagnostics);
- state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
+ state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
if (canEmitBuildInfo)
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
afterProgramDone(state, program, config);
@@ -122981,7 +122982,7 @@ var ts;
if (!host.fileExists(inputFile)) {
return {
type: ts.UpToDateStatusType.Unbuildable,
- reason: inputFile + " does not exist"
+ reason: "".concat(inputFile, " does not exist")
};
}
if (!force) {
@@ -123340,7 +123341,7 @@ var ts;
}
}
if (filesToDelete) {
- reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ 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(""));
}
return ts.ExitStatus.Success;
}
@@ -123678,7 +123679,7 @@ var ts;
function nowString() {
// E.g. "12:34:56.789"
var d = new Date();
- return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0");
+ 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"));
}
server.nowString = nowString;
})(server = ts.server || (ts.server = {}));
@@ -123689,7 +123690,7 @@ var ts;
var JsTyping;
(function (JsTyping) {
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
- var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest"));
+ var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
return availableVersion.compareTo(cachedTyping.version) <= 0;
}
JsTyping.isTypingUpToDate = isTypingUpToDate;
@@ -123742,7 +123743,7 @@ var ts;
"worker_threads",
"zlib"
];
- JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:" + name; });
+ JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
function nonRelativeModuleNameForTypingCache(moduleName) {
@@ -123815,7 +123816,7 @@ var ts;
var excludeTypingName = exclude_1[_i];
var didDelete = inferredTypings.delete(excludeTypingName);
if (didDelete && log)
- log("Typing for " + excludeTypingName + " is in exclude list, will be ignored.");
+ log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
}
var newTypingNames = [];
var cachedTypingPaths = [];
@@ -123829,7 +123830,7 @@ var ts;
});
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
if (log)
- log("Result: " + JSON.stringify(result));
+ log("Result: ".concat(JSON.stringify(result)));
return result;
function addInferredTyping(typingName) {
if (!inferredTypings.has(typingName)) {
@@ -123838,7 +123839,7 @@ var ts;
}
function addInferredTypings(typingNames, message) {
if (log)
- log(message + ": " + JSON.stringify(typingNames));
+ log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
ts.forEach(typingNames, addInferredTyping);
}
/**
@@ -123860,7 +123861,7 @@ var ts;
filesToWatch.push(manifestPath);
manifest = ts.readConfigFile(manifestPath, function (path) { return host.readFile(path); }).config;
manifestTypingNames = ts.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts.getOwnKeys);
- addInferredTypings(manifestTypingNames, "Typing names in '" + manifestPath + "' dependencies");
+ addInferredTypings(manifestTypingNames, "Typing names in '".concat(manifestPath, "' dependencies"));
}
// Now we scan the directories for typing information in
// already-installed dependencies (if present). Note that this
@@ -123904,7 +123905,7 @@ var ts;
!isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; // `node_modules/foo`
});
if (log)
- log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(dependencyManifestNames));
+ log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(dependencyManifestNames)));
// Once we have the names of things to look up, we iterate over
// and either collect their included typings, or add them to the
// list of typings we need to look up separately.
@@ -123923,12 +123924,12 @@ var ts;
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
if (host.fileExists(absolutePath)) {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types."));
inferredTypings.set(manifest_1.name, absolutePath);
}
else {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types but they are missing.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types but they are missing."));
}
}
else {
@@ -124024,15 +124025,15 @@ var ts;
var kind = isScopeName ? "Scope" : "Package";
switch (result) {
case 1 /* EmptyName */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot be empty";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
case 2 /* NameTooLong */:
- return "'" + typing + "':: " + kind + " name '" + name + "' should be less than " + maxPackageNameLength + " characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
case 3 /* NameStartsWithDot */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '.'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
case 4 /* NameStartsWithUnderscore */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '_'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
case 5 /* NameContainsNonURISafeCharacters */:
- return "'" + typing + "':: " + kind + " name '" + name + "' contains non URI safe characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
case 0 /* Ok */:
return ts.Debug.fail(); // Shouldn't have called this.
default:
@@ -126587,7 +126588,7 @@ var ts;
var prefix = ts.isJSDocLink(link) ? "link"
: ts.isJSDocLinkCode(link) ? "linkcode"
: "linkplain";
- var parts = [linkPart("{@" + prefix + " ")];
+ var parts = [linkPart("{@".concat(prefix, " "))];
if (!link.name) {
if (link.text)
parts.push(linkTextPart(link.text));
@@ -126835,7 +126836,7 @@ var ts;
function getUniqueName(baseName, sourceFile) {
var nameText = baseName;
for (var i = 1; !ts.isFileLevelUniqueName(sourceFile, nameText); i++) {
- nameText = baseName + "_" + i;
+ nameText = "".concat(baseName, "_").concat(i);
}
return nameText;
}
@@ -126945,7 +126946,7 @@ var ts;
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
var quotePreference = getQuotePreference(sourceFile, preferences);
var quoted = JSON.stringify(text);
- return quotePreference === 0 /* Single */ ? "'" + ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"') + "'" : quoted;
+ return quotePreference === 0 /* Single */ ? "'".concat(ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"'), "'") : quoted;
}
ts.quote = quote;
function isEqualityOperatorKind(kind) {
@@ -127329,7 +127330,7 @@ var ts;
var components = ts.getPathComponents(ts.getPackageNameFromTypesPackageName(fullSpecifier)).slice(1);
// Scoped packages
if (ts.startsWith(components[0], "@")) {
- return components[0] + "/" + components[1];
+ return "".concat(components[0], "/").concat(components[1]);
}
return components[0];
}
@@ -127456,13 +127457,13 @@ var ts;
}
function getSymbolParentOrFail(symbol) {
var _a;
- return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: " + ts.Debug.formatSymbolFlags(symbol.flags) + ". " +
- ("Declarations: " + ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
+ return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: ".concat(ts.Debug.formatSymbolFlags(symbol.flags), ". ") +
+ "Declarations: ".concat((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
var kind = ts.Debug.formatSyntaxKind(d.kind);
var inJS = ts.isInJSFile(d);
var expression = d.expression;
- return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: " + ts.Debug.formatSyntaxKind(expression.kind) + ")" : "");
- }).join(", ")) + "."));
+ return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: ".concat(ts.Debug.formatSyntaxKind(expression.kind), ")") : "");
+ }).join(", "), "."));
}
/**
* Useful to check whether a string contains another string at a specific index
@@ -127723,7 +127724,7 @@ var ts;
: checker.tryFindAmbientModule(info.moduleName));
var symbol = info.symbol || cachedSymbol || ts.Debug.checkDefined(exportKind === 2 /* ExportEquals */
? checker.resolveExternalModuleSymbol(moduleSymbol)
- : checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '" + info.symbolName + "' by key '" + info.symbolTableKey + "' in module " + moduleSymbol.name);
+ : checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '".concat(info.symbolName, "' by key '").concat(info.symbolTableKey, "' in module ").concat(moduleSymbol.name));
symbols.set(id, [symbol, moduleSymbol]);
return {
symbol: symbol,
@@ -127736,7 +127737,7 @@ var ts;
}
function key(importedName, symbol, ambientModuleName, checker) {
var moduleKey = ambientModuleName || "";
- return importedName + "|" + ts.getSymbolId(ts.skipAlias(symbol, checker)) + "|" + moduleKey;
+ return "".concat(importedName, "|").concat(ts.getSymbolId(ts.skipAlias(symbol, checker)), "|").concat(moduleKey);
}
function parseKey(key) {
var symbolName = key.substring(0, key.indexOf("|"));
@@ -127822,7 +127823,7 @@ var ts;
if (autoImportProvider) {
var start = ts.timestamp();
forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), function (module, file) { return cb(module, file, autoImportProvider, /*isFromPackageJson*/ true); });
- (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: " + (ts.timestamp() - start));
+ (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: ".concat(ts.timestamp() - start));
}
}
ts.forEachExternalModuleToImportFrom = forEachExternalModuleToImportFrom;
@@ -127875,7 +127876,7 @@ var ts;
}
});
});
- (_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in " + (ts.timestamp() - start) + " ms");
+ (_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in ".concat(ts.timestamp() - start, " ms"));
return cache;
}
ts.getExportInfoMap = getExportInfoMap;
@@ -128408,7 +128409,7 @@ var ts;
return { spans: spans, endOfLineState: 0 /* None */ };
function pushClassification(start, end, type) {
var length = end - start;
- ts.Debug.assert(length > 0, "Classification had non-positive length of " + length);
+ ts.Debug.assert(length > 0, "Classification had non-positive length of ".concat(length));
spans.push(start);
spans.push(length);
spans.push(type);
@@ -129280,7 +129281,7 @@ var ts;
case ".d.cts" /* Dcts */: return ".d.cts" /* dctsModifier */;
case ".cjs" /* Cjs */: return ".cjs" /* cjsModifier */;
case ".cts" /* Cts */: return ".cts" /* ctsModifier */;
- case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension " + ".tsbuildinfo" /* TsBuildInfo */ + " is unsupported.");
+ case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension ".concat(".tsbuildinfo" /* TsBuildInfo */, " is unsupported."));
case undefined: return "" /* none */;
default:
return ts.Debug.assertNever(extension);
@@ -130016,10 +130017,10 @@ var ts;
var resolvedFromCacheCount = 0;
var cacheAttemptCount = 0;
var result = cb({ tryResolve: tryResolve, resolutionLimitExceeded: function () { return resolutionLimitExceeded; } });
- var hitRateMessage = cacheAttemptCount ? " (" + (resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1) + "% hit rate)" : "";
- (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, logPrefix + ": resolved " + resolvedCount + " module specifiers, plus " + ambientCount + " ambient and " + resolvedFromCacheCount + " from cache" + hitRateMessage);
- (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, logPrefix + ": response is " + (resolutionLimitExceeded ? "incomplete" : "complete"));
- (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, logPrefix + ": " + (ts.timestamp() - start));
+ var hitRateMessage = cacheAttemptCount ? " (".concat((resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1), "% hit rate)") : "";
+ (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, "".concat(logPrefix, ": resolved ").concat(resolvedCount, " module specifiers, plus ").concat(ambientCount, " ambient and ").concat(resolvedFromCacheCount, " from cache").concat(hitRateMessage));
+ (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "".concat(logPrefix, ": response is ").concat(resolutionLimitExceeded ? "incomplete" : "complete"));
+ (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, "".concat(logPrefix, ": ").concat(ts.timestamp() - start));
return result;
function tryResolve(exportInfo, isFromAmbientModule) {
if (isFromAmbientModule) {
@@ -130352,15 +130353,15 @@ var ts;
var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess;
if (origin && originIsThisType(origin)) {
insertText = needsConvertPropertyAccess
- ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(sourceFile, preferences, name) + "]"
- : "this" + (insertQuestionDot ? "?." : ".") + name;
+ ? "this".concat(insertQuestionDot ? "?." : "", "[").concat(quotePropertyName(sourceFile, preferences, name), "]")
+ : "this".concat(insertQuestionDot ? "?." : ".").concat(name);
}
// We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790.
// Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro.
else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) {
- insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(sourceFile, preferences, name) + "]" : "[" + name + "]" : name;
+ insertText = useBraces ? needsConvertPropertyAccess ? "[".concat(quotePropertyName(sourceFile, preferences, name), "]") : "[".concat(name, "]") : name;
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
- insertText = "?." + insertText;
+ insertText = "?.".concat(insertText);
}
var dot = ts.findChildOfKind(propertyAccessToConvert, 24 /* DotToken */, sourceFile) ||
ts.findChildOfKind(propertyAccessToConvert, 28 /* QuestionDotToken */, sourceFile);
@@ -130374,7 +130375,7 @@ var ts;
if (isJsxInitializer) {
if (insertText === undefined)
insertText = name;
- insertText = "{" + insertText + "}";
+ insertText = "{".concat(insertText, "}");
if (typeof isJsxInitializer !== "boolean") {
replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile);
}
@@ -130387,8 +130388,8 @@ var ts;
if (precedingToken && ts.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) {
awaitText = ";";
}
- awaitText += "(await " + propertyAccessToConvert.expression.getText() + ")";
- insertText = needsConvertPropertyAccess ? "" + awaitText + insertText : "" + awaitText + (insertQuestionDot ? "?." : ".") + insertText;
+ awaitText += "(await ".concat(propertyAccessToConvert.expression.getText(), ")");
+ insertText = needsConvertPropertyAccess ? "".concat(awaitText).concat(insertText) : "".concat(awaitText).concat(insertQuestionDot ? "?." : ".").concat(insertText);
replacementSpan = ts.createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end);
}
if (originIsResolvedExport(origin)) {
@@ -130421,7 +130422,7 @@ var ts;
&& !(type.flags & 1048576 /* Union */ && ts.find(type.types, function (type) { return !!(type.flags & 528 /* BooleanLike */); }))) {
if (type.flags & 402653316 /* StringLike */ || (type.flags & 1048576 /* Union */ && ts.every(type.types, function (type) { return !!(type.flags & (402653316 /* StringLike */ | 32768 /* Undefined */)); }))) {
// If is string like or undefined use quotes
- insertText = ts.escapeSnippetText(name) + "=" + ts.quote(sourceFile, preferences, "$1");
+ insertText = "".concat(ts.escapeSnippetText(name), "=").concat(ts.quote(sourceFile, preferences, "$1"));
isSnippet = true;
}
else {
@@ -130430,7 +130431,7 @@ var ts;
}
}
if (useBraces_1) {
- insertText = ts.escapeSnippetText(name) + "={$1}";
+ insertText = "".concat(ts.escapeSnippetText(name), "={$1}");
isSnippet = true;
}
}
@@ -130715,14 +130716,14 @@ var ts;
var importKind = ts.codefix.getImportKind(sourceFile, exportKind, options, /*forceImportKeyword*/ true);
var isTopLevelTypeOnly = ((_b = (_a = ts.tryCast(importCompletionNode, ts.isImportDeclaration)) === null || _a === void 0 ? void 0 : _a.importClause) === null || _b === void 0 ? void 0 : _b.isTypeOnly) || ((_c = ts.tryCast(importCompletionNode, ts.isImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.isTypeOnly);
var isImportSpecifierTypeOnly = couldBeTypeOnlyImportSpecifier(importCompletionNode, contextToken);
- var topLevelTypeOnlyText = isTopLevelTypeOnly ? " " + ts.tokenToString(151 /* TypeKeyword */) + " " : " ";
- var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? ts.tokenToString(151 /* TypeKeyword */) + " " : "";
+ var topLevelTypeOnlyText = isTopLevelTypeOnly ? " ".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : " ";
+ var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? "".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : "";
var suffix = useSemicolons ? ";" : "";
switch (importKind) {
- case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " = require(" + quotedModuleSpecifier + ")" + suffix };
- case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " from " + quotedModuleSpecifier + suffix };
- case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "* as " + ts.escapeSnippetText(name) + " from " + quotedModuleSpecifier + suffix };
- case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "{ " + importSpecifierTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " } from " + quotedModuleSpecifier + suffix };
+ case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " = require(").concat(quotedModuleSpecifier, ")").concat(suffix) };
+ case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " from ").concat(quotedModuleSpecifier).concat(suffix) };
+ case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "* as ").concat(ts.escapeSnippetText(name), " from ").concat(quotedModuleSpecifier).concat(suffix) };
+ case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "{ ").concat(importSpecifierTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " } from ").concat(quotedModuleSpecifier).concat(suffix) };
}
}
function quotePropertyName(sourceFile, preferences, name) {
@@ -133684,7 +133685,7 @@ var ts;
}
function getDocumentRegistryEntry(bucketEntry, scriptKind) {
var entry = isDocumentRegistryEntry(bucketEntry) ? bucketEntry : bucketEntry.get(ts.Debug.checkDefined(scriptKind, "If there are more than one scriptKind's for same document the scriptKind should be provided"));
- ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:" + scriptKind + " and sourceFile.scriptKind: " + (entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind) + ", !entry: " + !entry);
+ ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:".concat(scriptKind, " and sourceFile.scriptKind: ").concat(entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind, ", !entry: ").concat(!entry));
return entry;
}
function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
@@ -134713,7 +134714,7 @@ var ts;
sourceFile: def.file,
name: def.reference.fileName,
kind: "string" /* string */,
- displayParts: [ts.displayPart("\"" + def.reference.fileName + "\"", ts.SymbolDisplayPartKind.stringLiteral)]
+ displayParts: [ts.displayPart("\"".concat(def.reference.fileName, "\""), ts.SymbolDisplayPartKind.stringLiteral)]
};
}
default:
@@ -135293,7 +135294,7 @@ var ts;
if (symbol.flags & 33554432 /* Transient */)
return undefined;
// Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here.
- ts.Debug.fail("Unexpected symbol at " + ts.Debug.formatSyntaxKind(node.kind) + ": " + ts.Debug.formatSymbol(symbol));
+ ts.Debug.fail("Unexpected symbol at ".concat(ts.Debug.formatSyntaxKind(node.kind), ": ").concat(ts.Debug.formatSymbol(symbol)));
}
return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent)
? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name)
@@ -136578,8 +136579,8 @@ var ts;
var end = pos + 6; /* "static".length */
var typeChecker = program.getTypeChecker();
var symbol = typeChecker.getSymbolAtLocation(node.parent);
- var prefix = symbol ? typeChecker.symbolToString(symbol, node.parent) + " " : "";
- return { text: prefix + "static {}", pos: pos, end: end };
+ var prefix = symbol ? "".concat(typeChecker.symbolToString(symbol, node.parent), " ") : "";
+ return { text: "".concat(prefix, "static {}"), pos: pos, end: end };
}
var declName = isConstNamedExpression(node) ? node.parent.name :
ts.Debug.checkDefined(ts.getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
@@ -137863,7 +137864,7 @@ var ts;
function getJSDocTagCompletions() {
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) {
return {
- name: "@" + tagName,
+ name: "@".concat(tagName),
kind: "keyword" /* keyword */,
kindModifiers: "",
sortText: ts.Completions.SortText.LocationPriority
@@ -137995,11 +137996,11 @@ var ts;
var name = _a.name, dotDotDotToken = _a.dotDotDotToken;
var paramName = name.kind === 79 /* Identifier */ ? name.text : "param" + i;
var type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : "";
- return indentationStr + " * @param " + type + paramName + newLine;
+ return "".concat(indentationStr, " * @param ").concat(type).concat(paramName).concat(newLine);
}).join("");
}
function returnsDocComment(indentationStr, newLine) {
- return indentationStr + " * @returns" + newLine;
+ return "".concat(indentationStr, " * @returns").concat(newLine);
}
function getCommentOwnerInfo(tokenAtPos, options) {
return ts.forEachAncestor(tokenAtPos, function (n) { return getCommentOwnerInfoWorker(n, options); });
@@ -138842,7 +138843,7 @@ var ts;
}
if (name) {
var text = ts.isIdentifier(name) ? name.text
- : ts.isElementAccessExpression(name) ? "[" + nodeText(name.argumentExpression) + "]"
+ : ts.isElementAccessExpression(name) ? "[".concat(nodeText(name.argumentExpression), "]")
: nodeText(name);
if (text.length > 0) {
return cleanText(text);
@@ -138852,7 +138853,7 @@ var ts;
case 303 /* SourceFile */:
var sourceFile = node;
return ts.isExternalModule(sourceFile)
- ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\""
+ ? "\"".concat(ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))), "\"")
: "";
case 270 /* ExportAssignment */:
return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
@@ -139048,10 +139049,10 @@ var ts;
if (name !== undefined) {
name = cleanText(name);
if (name.length > maxLength) {
- return name + " callback";
+ return "".concat(name, " callback");
}
var args = cleanText(ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined; }).join(", "));
- return name + "(" + args + ") callback";
+ return "".concat(name, "(").concat(args, ") callback");
}
}
return "";
@@ -139064,7 +139065,7 @@ var ts;
else if (ts.isPropertyAccessExpression(expr)) {
var left = getCalledExpressionName(expr.expression);
var right = expr.name.text;
- return left === undefined ? right : left + "." + right;
+ return left === undefined ? right : "".concat(left, ".").concat(right);
}
else {
return undefined;
@@ -141511,7 +141512,7 @@ var ts;
var _loop_9 = function (n) {
// If the node is not a subspan of its parent, this is a big problem.
// There have been crashes that might be caused by this violation.
- ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.formatSyntaxKind(n.kind) + ", parent: " + ts.Debug.formatSyntaxKind(n.parent.kind); });
+ ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: ".concat(ts.Debug.formatSyntaxKind(n.kind), ", parent: ").concat(ts.Debug.formatSyntaxKind(n.parent.kind)); });
var argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n, position, sourceFile, checker);
if (argumentInfo) {
return { value: argumentInfo };
@@ -141683,7 +141684,7 @@ var ts;
(function (InlayHints) {
var maxHintsLength = 30;
var leadingParameterNameCommentRegexFactory = function (name) {
- return new RegExp("^\\s?/\\*\\*?\\s?" + name + "\\s?\\*\\/\\s?$");
+ return new RegExp("^\\s?/\\*\\*?\\s?".concat(name, "\\s?\\*\\/\\s?$"));
};
function shouldShowParameterNameHints(preferences) {
return preferences.includeInlayParameterNameHints === "literals" || preferences.includeInlayParameterNameHints === "all";
@@ -141747,7 +141748,7 @@ var ts;
}
function addParameterHints(text, position, isFirstVariadicArgument) {
result.push({
- text: "" + (isFirstVariadicArgument ? "..." : "") + truncation(text, maxHintsLength) + ":",
+ text: "".concat(isFirstVariadicArgument ? "..." : "").concat(truncation(text, maxHintsLength), ":"),
position: position,
kind: "Parameter" /* Parameter */,
whitespaceAfter: true,
@@ -141755,7 +141756,7 @@ var ts;
}
function addTypeHints(text, position) {
result.push({
- text: ": " + truncation(text, maxHintsLength),
+ text: ": ".concat(truncation(text, maxHintsLength)),
position: position,
kind: "Type" /* Type */,
whitespaceBefore: true,
@@ -141763,7 +141764,7 @@ var ts;
}
function addEnumMemberValueHints(text, position) {
result.push({
- text: "= " + truncation(text, maxHintsLength),
+ text: "= ".concat(truncation(text, maxHintsLength)),
position: position,
kind: "Enum" /* Enum */,
whitespaceBefore: true,
@@ -142298,7 +142299,7 @@ var ts;
}
}
function getKeyFromNode(exp) {
- return exp.pos.toString() + ":" + exp.end.toString();
+ return "".concat(exp.pos.toString(), ":").concat(exp.end.toString());
}
function canBeConvertedToClass(node, checker) {
var _a, _b, _c, _d;
@@ -146447,7 +146448,7 @@ var ts;
var insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition);
var token = ts.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position);
var indent = sourceFile.text.slice(lineStartPosition, startPosition);
- var text = (insertAtLineStart ? "" : this.newLineCharacter) + "//" + commentText + this.newLineCharacter + indent;
+ var text = "".concat(insertAtLineStart ? "" : this.newLineCharacter, "//").concat(commentText).concat(this.newLineCharacter).concat(indent);
this.insertText(sourceFile, token.getStart(sourceFile), text);
};
ChangeTracker.prototype.insertJsdocCommentBefore = function (sourceFile, node, tag) {
@@ -146671,7 +146672,7 @@ var ts;
};
ChangeTracker.prototype.getInsertNodeAfterOptions = function (sourceFile, after) {
var options = this.getInsertNodeAfterOptionsWorker(after);
- return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n" + options.prefix : "\n") : options.prefix });
+ return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n".concat(options.prefix) : "\n") : options.prefix });
};
ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) {
switch (node.kind) {
@@ -146705,7 +146706,7 @@ var ts;
}
else {
// `x => {}` -> `function f(x) {}`
- this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function " + name + "(");
+ this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function ".concat(name, "("));
// Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)`
this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */));
}
@@ -146771,7 +146772,7 @@ var ts;
var nextNode = containingList[index + 1];
var startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart());
// write separator and leading trivia of the next element as suffix
- var suffix = "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, startPos);
+ var suffix = "".concat(ts.tokenToString(nextToken.kind)).concat(sourceFile.text.substring(nextToken.end, startPos));
this.insertNodesAt(sourceFile, startPos, [newNode], { suffix: suffix });
}
}
@@ -146816,7 +146817,7 @@ var ts;
this.replaceRange(sourceFile, ts.createRange(insertPos), newNode, { indentation: indentation, prefix: this.newLineCharacter });
}
else {
- this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + " " });
+ this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: "".concat(ts.tokenToString(separator), " ") });
}
}
};
@@ -146947,7 +146948,7 @@ var ts;
var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); });
var _loop_12 = function (i) {
ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () {
- return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range);
+ return "".concat(JSON.stringify(normalized[i].range), " and ").concat(JSON.stringify(normalized[i + 1].range));
});
};
// verify that change intervals do not overlap, except possibly at end points.
@@ -147038,7 +147039,7 @@ var ts;
function applyChanges(text, changes) {
for (var i = changes.length - 1; i >= 0; i--) {
var _a = changes[i], span = _a.span, newText = _a.newText;
- text = "" + text.substring(0, span.start) + newText + text.substring(ts.textSpanEnd(span));
+ text = "".concat(text.substring(0, span.start)).concat(newText).concat(text.substring(ts.textSpanEnd(span)));
}
return text;
}
@@ -149523,7 +149524,7 @@ var ts;
if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind)
|| checker.resolveName(text, node, 111551 /* Value */, /*excludeGlobals*/ true))) {
// Unconditionally add an underscore in case `text` is a keyword.
- res.set(text, makeUniqueName("_" + text, identifiers));
+ res.set(text, makeUniqueName("_".concat(text), identifiers));
}
});
return res;
@@ -149623,7 +149624,7 @@ var ts;
// `const a = require("b").c` --> `import { c as a } from "./b";
return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]);
default:
- return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form " + name.kind);
+ return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form ".concat(name.kind));
}
}
function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) {
@@ -149674,7 +149675,7 @@ var ts;
case 168 /* MethodDeclaration */:
return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(93 /* ExportKeyword */)], prop, useSitesToUnqualify);
default:
- ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind);
+ ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind ".concat(prop.kind));
}
});
return statements && [statements, false];
@@ -149806,7 +149807,7 @@ var ts;
case 79 /* Identifier */:
return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference);
default:
- return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind " + name.kind);
+ return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind ".concat(name.kind));
}
}
/**
@@ -149863,7 +149864,7 @@ var ts;
// Identifiers helpers
function makeUniqueName(name, identifiers) {
while (identifiers.original.has(name) || identifiers.additional.has(name)) {
- name = "_" + name;
+ name = "_".concat(name);
}
identifiers.additional.add(name);
return name;
@@ -149943,7 +149944,7 @@ var ts;
if (!qualifiedName)
return undefined;
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); });
- var newText = qualifiedName.left.text + "[\"" + qualifiedName.right.text + "\"]";
+ var newText = "".concat(qualifiedName.left.text, "[\"").concat(qualifiedName.right.text, "\"]");
return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, ts.Diagnostics.Rewrite_all_as_indexed_access_types)];
},
fixIds: [fixId],
@@ -150345,7 +150346,7 @@ var ts;
// Excluding from fix-all
break;
default:
- ts.Debug.assertNever(fix, "fix wasn't never - got kind " + fix.kind);
+ ts.Debug.assertNever(fix, "fix wasn't never - got kind ".concat(fix.kind));
}
function reduceAddAsTypeOnlyValues(prevValue, newValue) {
// `NotAllowed` overrides `Required` because one addition of a new import might be required to be type-only
@@ -150389,7 +150390,7 @@ var ts;
return newEntry;
}
function newImportsKey(moduleSpecifier, topLevelTypeOnly) {
- return (topLevelTypeOnly ? 1 : 0) + "|" + moduleSpecifier;
+ return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier);
}
}
function writeFixes(changeTracker) {
@@ -150887,7 +150888,7 @@ var ts;
case ts.ModuleKind.NodeNext:
return importingFile.impliedNodeFormat === ts.ModuleKind.ESNext ? 2 /* Namespace */ : 3 /* CommonJS */;
default:
- return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind " + moduleKind);
+ return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind ".concat(moduleKind));
}
}
function getFixesInfoForNonUMDImport(_a, symbolToken, useAutoImportProvider) {
@@ -151010,7 +151011,7 @@ var ts;
switch (fix.kind) {
case 0 /* UseNamespace */:
addNamespaceQualifier(changes, sourceFile, fix);
- return [ts.Diagnostics.Change_0_to_1, symbolName, fix.namespacePrefix + "." + symbolName];
+ return [ts.Diagnostics.Change_0_to_1, symbolName, "".concat(fix.namespacePrefix, ".").concat(symbolName)];
case 1 /* JsdocTypeImport */:
addImportType(changes, sourceFile, fix, quotePreference);
return [ts.Diagnostics.Change_0_to_1, symbolName, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName];
@@ -151041,7 +151042,7 @@ var ts;
: [ts.Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
}
default:
- return ts.Debug.assertNever(fix, "Unexpected fix kind " + fix.kind);
+ return ts.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind));
}
}
function getModuleSpecifierText(promotedDeclaration) {
@@ -151194,7 +151195,7 @@ var ts;
}
function getImportTypePrefix(moduleSpecifier, quotePreference) {
var quote = ts.getQuoteFromPreference(quotePreference);
- return "import(" + quote + moduleSpecifier + quote + ").";
+ return "import(".concat(quote).concat(moduleSpecifier).concat(quote, ").");
}
function needsTypeOnly(_a) {
var addAsTypeOnly = _a.addAsTypeOnly;
@@ -151290,7 +151291,7 @@ var ts;
lastCharWasValid = isValid;
}
// Need `|| "_"` to ensure result isn't empty.
- return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res;
+ return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_".concat(res);
}
codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier;
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -152546,7 +152547,7 @@ var ts;
break;
}
default:
- ts.Debug.fail("Bad fixId: " + context.fixId);
+ ts.Debug.fail("Bad fixId: ".concat(context.fixId));
}
});
},
@@ -152994,7 +152995,7 @@ var ts;
if (!isValidCharacter(character)) {
return;
}
- var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(sourceFile, preferences, character) + "}";
+ var replacement = useHtmlEntity ? htmlEntity[character] : "{".concat(ts.quote(sourceFile, preferences, character), "}");
changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement);
}
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -153274,11 +153275,11 @@ var ts;
token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name;
}
if (ts.isIdentifier(token) && canPrefix(token)) {
- changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_" + token.text));
+ changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_".concat(token.text)));
if (ts.isParameter(token.parent)) {
ts.getJSDocParameterTags(token.parent).forEach(function (tag) {
if (ts.isIdentifier(tag.name)) {
- changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_" + tag.name.text));
+ changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_".concat(tag.name.text)));
}
});
}
@@ -153620,7 +153621,7 @@ var ts;
}); }
});
function doChange(changes, sourceFile, name) {
- changes.replaceNodeWithText(sourceFile, name, name.text + "()");
+ changes.replaceNodeWithText(sourceFile, name, "".concat(name.text, "()"));
}
function getCallName(sourceFile, start) {
var token = ts.getTokenAtPosition(sourceFile, start);
@@ -154744,7 +154745,7 @@ var ts;
var parameters = [];
var length = Math.max.apply(Math, calls.map(function (c) { return c.argumentTypes.length; }));
var _loop_16 = function (i) {
- var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg" + i));
+ var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg".concat(i)));
symbol.type = combineTypes(calls.map(function (call) { return call.argumentTypes[i] || checker.getUndefinedType(); }));
if (calls.some(function (call) { return call.argumentTypes[i] === undefined; })) {
symbol.flags |= 16777216 /* Optional */;
@@ -154847,7 +154848,7 @@ var ts;
codefix.createCodeFixActionWithoutFixAll(fixName, [codefix.createFileTextChanges(sourceFile.fileName, [
ts.createTextChange(sourceFile.checkJsDirective
? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end)
- : ts.createTextSpan(0, 0), "// @ts-nocheck" + newLineCharacter),
+ : ts.createTextSpan(0, 0), "// @ts-nocheck".concat(newLineCharacter)),
])], ts.Diagnostics.Disable_checking_for_this_file),
];
if (ts.textChanges.isValidLocationToAddComment(sourceFile, span.start)) {
@@ -155113,7 +155114,7 @@ var ts;
var typeParameters = isJs || typeArguments === undefined
? undefined
: ts.map(typeArguments, function (_, i) {
- return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T" + i);
+ return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T".concat(i));
});
var parameters = createDummyParameters(args.length, names, types, /*minArgumentCount*/ undefined, isJs);
var type = isJs || contextualType === undefined
@@ -155148,7 +155149,7 @@ var ts;
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
- /*name*/ names && names[i] || "arg" + i,
+ /*name*/ names && names[i] || "arg".concat(i),
/*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.factory.createToken(57 /* QuestionToken */) : undefined,
/*type*/ inJs ? undefined : types && types[i] || ts.factory.createKeywordTypeNode(130 /* AnyKeyword */),
/*initializer*/ undefined);
@@ -155399,7 +155400,7 @@ var ts;
}
var name = declaration.name.text;
var startWithUnderscore = ts.startsWithUnderscore(name);
- var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file), declaration.name);
+ var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_".concat(name), file), declaration.name);
var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name);
return {
isStatic: ts.hasStaticModifier(declaration),
@@ -156438,7 +156439,7 @@ var ts;
changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text)));
break;
default:
- ts.Debug.fail("Unexpected exportNode kind " + exportNode.kind);
+ ts.Debug.fail("Unexpected exportNode kind ".concat(exportNode.kind));
}
}
}
@@ -156526,7 +156527,7 @@ var ts;
break;
}
default:
- ts.Debug.assertNever(parent, "Unexpected parent kind " + parent.kind);
+ ts.Debug.assertNever(parent, "Unexpected parent kind ".concat(parent.kind));
}
}
function makeImportSpecifier(propertyName, name) {
@@ -157109,7 +157110,7 @@ var ts;
var newComment = ts.displayPartsToString(parameterDocComment);
if (newComment.length) {
ts.setSyntheticLeadingComments(result, [{
- text: "*\n" + newComment.split("\n").map(function (c) { return " * " + c; }).join("\n") + "\n ",
+ text: "*\n".concat(newComment.split("\n").map(function (c) { return " * ".concat(c); }).join("\n"), "\n "),
kind: 3 /* MultiLineCommentTrivia */,
pos: -1,
end: -1,
@@ -157254,7 +157255,7 @@ var ts;
usedFunctionNames.set(description, true);
functionActions.push({
description: description,
- name: "function_scope_" + i,
+ name: "function_scope_".concat(i),
kind: extractFunctionAction.kind
});
}
@@ -157262,7 +157263,7 @@ var ts;
else if (!innermostErrorFunctionAction) {
innermostErrorFunctionAction = {
description: description,
- name: "function_scope_" + i,
+ name: "function_scope_".concat(i),
notApplicableReason: getStringError(functionExtraction.errors),
kind: extractFunctionAction.kind
};
@@ -157278,7 +157279,7 @@ var ts;
usedConstantNames.set(description_1, true);
constantActions.push({
description: description_1,
- name: "constant_scope_" + i,
+ name: "constant_scope_".concat(i),
kind: extractConstantAction.kind
});
}
@@ -157286,7 +157287,7 @@ var ts;
else if (!innermostErrorConstantAction) {
innermostErrorConstantAction = {
description: description,
- name: "constant_scope_" + i,
+ name: "constant_scope_".concat(i),
notApplicableReason: getStringError(constantExtraction.errors),
kind: extractConstantAction.kind
};
@@ -157428,7 +157429,7 @@ var ts;
// cannot find either start or end node
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };
}
- if (ts.isJSDoc(start)) {
+ if (start.flags & 4194304 /* JSDoc */) {
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractJSDoc)] };
}
if (start.parent !== end.parent) {
@@ -157870,28 +157871,28 @@ var ts;
case 212 /* FunctionExpression */:
case 255 /* FunctionDeclaration */:
return scope.name
- ? "function '" + scope.name.text + "'"
+ ? "function '".concat(scope.name.text, "'")
: ts.ANONYMOUS;
case 213 /* ArrowFunction */:
return "arrow function";
case 168 /* MethodDeclaration */:
- return "method '" + scope.name.getText() + "'";
+ return "method '".concat(scope.name.getText(), "'");
case 171 /* GetAccessor */:
- return "'get " + scope.name.getText() + "'";
+ return "'get ".concat(scope.name.getText(), "'");
case 172 /* SetAccessor */:
- return "'set " + scope.name.getText() + "'";
+ return "'set ".concat(scope.name.getText(), "'");
default:
- throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind);
+ throw ts.Debug.assertNever(scope, "Unexpected scope kind ".concat(scope.kind));
}
}
function getDescriptionForClassLikeDeclaration(scope) {
return scope.kind === 256 /* ClassDeclaration */
- ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration"
- : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression";
+ ? scope.name ? "class '".concat(scope.name.text, "'") : "anonymous class declaration"
+ : scope.name ? "class expression '".concat(scope.name.text, "'") : "anonymous class expression";
}
function getDescriptionForModuleLikeDeclaration(scope) {
return scope.kind === 261 /* ModuleBlock */
- ? "namespace '" + scope.parent.name.getText() + "'"
+ ? "namespace '".concat(scope.parent.name.getText(), "'")
: scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */;
}
var SpecialScope;
@@ -159367,7 +159368,7 @@ var ts;
case 253 /* VariableDeclaration */:
return ts.tryCast(node.name, ts.isIdentifier);
default:
- return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
+ return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
}
}
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) {
@@ -159404,7 +159405,7 @@ var ts;
case 253 /* VariableDeclaration */:
return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString));
default:
- return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
+ return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
}
}
function moduleSpecifierFromImport(i) {
@@ -159491,7 +159492,7 @@ var ts;
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
break;
default:
- ts.Debug.assertNever(importDecl, "Unexpected import decl kind " + importDecl.kind);
+ ts.Debug.assertNever(importDecl, "Unexpected import decl kind ".concat(importDecl.kind));
}
}
function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused) {
@@ -159591,7 +159592,7 @@ var ts;
var name = ts.combinePaths(inDirectory, newModuleName + extension);
if (!host.fileExists(name))
return newModuleName; // TODO: GH#18217
- newModuleName = moduleName + "." + i;
+ newModuleName = "".concat(moduleName, ".").concat(i);
}
}
function getNewModuleName(movedSymbols) {
@@ -159698,7 +159699,7 @@ var ts;
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined;
}
default:
- return ts.Debug.assertNever(i, "Unexpected import kind " + i.kind);
+ return ts.Debug.assertNever(i, "Unexpected import kind ".concat(i.kind));
}
}
function filterNamedBindings(namedBindings, keep) {
@@ -159813,7 +159814,7 @@ var ts;
case 200 /* ObjectBindingPattern */:
return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); });
default:
- return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind);
+ return ts.Debug.assertNever(name, "Unexpected name kind ".concat(name.kind));
}
}
function nameOfTopLevelDeclaration(d) {
@@ -159874,7 +159875,7 @@ var ts;
case 237 /* ExpressionStatement */:
return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...`
default:
- return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind);
+ return ts.Debug.assertNever(d, "Unexpected declaration kind ".concat(d.kind));
}
}
function addCommonjsExport(decl) {
@@ -159896,7 +159897,7 @@ var ts;
case 237 /* ExpressionStatement */:
return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...`
default:
- return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind);
+ return ts.Debug.assertNever(decl, "Unexpected decl kind ".concat(decl.kind));
}
}
/** Creates `exports.x = x;` */
@@ -160534,7 +160535,7 @@ var ts;
return [functionDeclaration.name, functionDeclaration.parent.name];
return [functionDeclaration.parent.name];
default:
- return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind " + functionDeclaration.kind);
+ return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind ".concat(functionDeclaration.kind));
}
}
})(convertParamsToDestructuredObject = refactor.convertParamsToDestructuredObject || (refactor.convertParamsToDestructuredObject = {}));
@@ -161238,7 +161239,7 @@ var ts;
var textPos = ts.scanner.getTextPos();
if (textPos <= end) {
if (token === 79 /* Identifier */) {
- ts.Debug.fail("Did not expect " + ts.Debug.formatSyntaxKind(parent.kind) + " to have an Identifier in its trivia");
+ ts.Debug.fail("Did not expect ".concat(ts.Debug.formatSyntaxKind(parent.kind), " to have an Identifier in its trivia"));
}
nodes.push(createNode(token, pos, textPos, parent));
}
@@ -162168,7 +162169,7 @@ var ts;
function getValidSourceFile(fileName) {
var sourceFile = program.getSourceFile(fileName);
if (!sourceFile) {
- var error = new Error("Could not find source file: '" + fileName + "'.");
+ var error = new Error("Could not find source file: '".concat(fileName, "'."));
// We've been having trouble debugging this, so attach sidecar data for the tsserver log.
// See https://github.com/microsoft/TypeScript/issues/30180.
error.ProgramFiles = program.getSourceFiles().map(function (f) { return f.fileName; });
@@ -162844,7 +162845,7 @@ var ts;
var element = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningElement(token.parent) ? token.parent.parent
: ts.isJsxText(token) && ts.isJsxElement(token.parent) ? token.parent : undefined;
if (element && isUnclosedTag(element)) {
- return { newText: "" + element.openingElement.tagName.getText(sourceFile) + ">" };
+ return { newText: "".concat(element.openingElement.tagName.getText(sourceFile), ">") };
}
var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent
: ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined;
@@ -162950,7 +162951,7 @@ var ts;
pos = commentRange.end + 1;
}
else { // If it's not in a comment range, then we need to comment the uncommented portions.
- var newPos = text.substring(pos, textRange.end).search("(" + openMultilineRegex + ")|(" + closeMultilineRegex + ")");
+ var newPos = text.substring(pos, textRange.end).search("(".concat(openMultilineRegex, ")|(").concat(closeMultilineRegex, ")"));
isCommenting = insertComment !== undefined
? insertComment
: isCommenting || !ts.isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); // If isCommenting is already true we don't need to check whitespace again.
@@ -163345,14 +163346,14 @@ var ts;
case ts.LanguageServiceMode.PartialSemantic:
invalidOperationsInPartialSemanticMode.forEach(function (key) {
return ls[key] = function () {
- throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.PartialSemantic");
+ throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.PartialSemantic"));
};
});
break;
case ts.LanguageServiceMode.Syntactic:
invalidOperationsInSyntacticMode.forEach(function (key) {
return ls[key] = function () {
- throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.Syntactic");
+ throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.Syntactic"));
};
});
break;
@@ -164334,13 +164335,13 @@ var ts;
var result = action();
if (logPerformance) {
var end = ts.timestamp();
- logger.log(actionDescription + " completed in " + (end - start) + " msec");
+ logger.log("".concat(actionDescription, " completed in ").concat(end - start, " msec"));
if (ts.isString(result)) {
var str = result;
if (str.length > 128) {
str = str.substring(0, 128) + "...";
}
- logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'");
+ logger.log(" result.length=".concat(str.length, ", result='").concat(JSON.stringify(str), "'"));
}
}
return result;
@@ -164422,7 +164423,7 @@ var ts;
* Update the list of scripts known to the compiler
*/
LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
- this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; } // eslint-disable-line no-null/no-null
+ this.forwardJSONCall("refresh(".concat(throwOnError, ")"), function () { return null; } // eslint-disable-line no-null/no-null
);
};
LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
@@ -164438,43 +164439,43 @@ var ts;
};
LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
+ return this.forwardJSONCall("getSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
};
LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
+ return this.forwardJSONCall("getSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
};
LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")",
+ return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
// directly serialize the spans out to a string. This is much faster to decode
// on the managed side versus a full JSON array.
function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
};
LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")",
+ return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
// directly serialize the spans out to a string. This is much faster to decode
// on the managed side versus a full JSON array.
function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
};
LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () {
+ return this.forwardJSONCall("getSyntacticDiagnostics('".concat(fileName, "')"), function () {
var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
return _this.realizeDiagnostics(diagnostics);
});
};
LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () {
+ return this.forwardJSONCall("getSemanticDiagnostics('".concat(fileName, "')"), function () {
var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
return _this.realizeDiagnostics(diagnostics);
});
};
LanguageServiceShimObject.prototype.getSuggestionDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSuggestionDiagnostics('" + fileName + "')", function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
+ return this.forwardJSONCall("getSuggestionDiagnostics('".concat(fileName, "')"), function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
};
LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
var _this = this;
@@ -164490,7 +164491,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
+ return this.forwardJSONCall("getQuickInfoAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
};
/// NAMEORDOTTEDNAMESPAN
/**
@@ -164499,7 +164500,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
var _this = this;
- return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
+ return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(fileName, "', ").concat(startPos, ", ").concat(endPos, ")"), function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
};
/**
* STATEMENTSPAN
@@ -164507,12 +164508,12 @@ var ts;
*/
LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
+ return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
};
/// SIGNATUREHELP
LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
+ return this.forwardJSONCall("getSignatureHelpItems('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
};
/// GOTO DEFINITION
/**
@@ -164521,7 +164522,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
+ return this.forwardJSONCall("getDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
};
/**
* Computes the definition location and file for the symbol
@@ -164529,7 +164530,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getDefinitionAndBoundSpan = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getDefinitionAndBoundSpan('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
+ return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
};
/// GOTO Type
/**
@@ -164538,7 +164539,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
+ return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
};
/// GOTO Implementation
/**
@@ -164547,37 +164548,37 @@ var ts;
*/
LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
+ return this.forwardJSONCall("getImplementationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position, options); });
+ return this.forwardJSONCall("getRenameInfo('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getRenameInfo(fileName, position, options); });
};
LanguageServiceShimObject.prototype.getSmartSelectionRange = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getSmartSelectionRange('" + fileName + "', " + position + ")", function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
+ return this.forwardJSONCall("getSmartSelectionRange('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
};
LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) {
var _this = this;
- return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ", " + providePrefixAndSuffixTextForRename + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
+ return this.forwardJSONCall("findRenameLocations('".concat(fileName, "', ").concat(position, ", ").concat(findInStrings, ", ").concat(findInComments, ", ").concat(providePrefixAndSuffixTextForRename, ")"), function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
};
/// GET BRACE MATCHING
LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
+ return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
var _this = this;
- return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
+ return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(openingBrace, ")"), function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
};
LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) {
var _this = this;
- return this.forwardJSONCall("getSpanOfEnclosingComment('" + fileName + "', " + position + ")", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
+ return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
};
/// GET SMART INDENT
LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) {
var _this = this;
- return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () {
+ return this.forwardJSONCall("getIndentationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
});
@@ -164585,23 +164586,23 @@ var ts;
/// GET REFERENCES
LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
+ return this.forwardJSONCall("getReferencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); });
+ return this.forwardJSONCall("findReferences('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.findReferences(fileName, position); });
};
LanguageServiceShimObject.prototype.getFileReferences = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getFileReferences('" + fileName + ")", function () { return _this.languageService.getFileReferences(fileName); });
+ return this.forwardJSONCall("getFileReferences('".concat(fileName, ")"), function () { return _this.languageService.getFileReferences(fileName); });
};
LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
+ return this.forwardJSONCall("getOccurrencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
var _this = this;
- return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () {
+ return this.forwardJSONCall("getDocumentHighlights('".concat(fileName, "', ").concat(position, ")"), function () {
var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
// workaround for VS document highlighting issue - keep only items from the initial file
var normalizedName = ts.toFileNameLowerCase(ts.normalizeSlashes(fileName));
@@ -164616,108 +164617,108 @@ var ts;
*/
LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences, formattingSettings) {
var _this = this;
- return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ", " + formattingSettings + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
+ return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ", ").concat(formattingSettings, ")"), function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
};
/** Get a string based representation of a completion list entry details */
LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, formatOptions, source, preferences, data) {
var _this = this;
- return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () {
+ return this.forwardJSONCall("getCompletionEntryDetails('".concat(fileName, "', ").concat(position, ", '").concat(entryName, "')"), function () {
var localOptions = formatOptions === undefined ? undefined : JSON.parse(formatOptions);
return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () {
+ return this.forwardJSONCall("getFormattingEditsForRange('".concat(fileName, "', ").concat(start, ", ").concat(end, ")"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () {
+ return this.forwardJSONCall("getFormattingEditsForDocument('".concat(fileName, "')"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () {
+ return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(fileName, "', ").concat(position, ", '").concat(key, "')"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
});
};
LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
+ return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
};
/// NAVIGATE TO
/** Return a list of symbols that are interesting to navigate to */
LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ", " + fileName + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
+ return this.forwardJSONCall("getNavigateToItems('".concat(searchValue, "', ").concat(maxResultCount, ", ").concat(fileName, ")"), function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
};
LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); });
+ return this.forwardJSONCall("getNavigationBarItems('".concat(fileName, "')"), function () { return _this.languageService.getNavigationBarItems(fileName); });
};
LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
+ return this.forwardJSONCall("getNavigationTree('".concat(fileName, "')"), function () { return _this.languageService.getNavigationTree(fileName); });
};
LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
+ return this.forwardJSONCall("getOutliningSpans('".concat(fileName, "')"), function () { return _this.languageService.getOutliningSpans(fileName); });
};
LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
var _this = this;
- return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
+ return this.forwardJSONCall("getTodoComments('".concat(fileName, "')"), function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
};
/// CALL HIERARCHY
LanguageServiceShimObject.prototype.prepareCallHierarchy = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("prepareCallHierarchy('" + fileName + "', " + position + ")", function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
+ return this.forwardJSONCall("prepareCallHierarchy('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
};
LanguageServiceShimObject.prototype.provideCallHierarchyIncomingCalls = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("provideCallHierarchyIncomingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
+ return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
};
LanguageServiceShimObject.prototype.provideCallHierarchyOutgoingCalls = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
+ return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
};
LanguageServiceShimObject.prototype.provideInlayHints = function (fileName, span, preference) {
var _this = this;
- return this.forwardJSONCall("provideInlayHints('" + fileName + "', '" + JSON.stringify(span) + "', " + JSON.stringify(preference) + ")", function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
+ return this.forwardJSONCall("provideInlayHints('".concat(fileName, "', '").concat(JSON.stringify(span), "', ").concat(JSON.stringify(preference), ")"), function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
};
/// Emit
LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () {
+ return this.forwardJSONCall("getEmitOutput('".concat(fileName, "')"), function () {
var _a = _this.languageService.getEmitOutput(fileName), diagnostics = _a.diagnostics, rest = __rest(_a, ["diagnostics"]);
return __assign(__assign({}, rest), { diagnostics: _this.realizeDiagnostics(diagnostics) });
});
};
LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
var _this = this;
- return forwardCall(this.logger, "getEmitOutput('" + fileName + "')",
+ return forwardCall(this.logger, "getEmitOutput('".concat(fileName, "')"),
/*returnJson*/ false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
};
LanguageServiceShimObject.prototype.toggleLineComment = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("toggleLineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleLineComment(fileName, textRange); });
+ return this.forwardJSONCall("toggleLineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleLineComment(fileName, textRange); });
};
LanguageServiceShimObject.prototype.toggleMultilineComment = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("toggleMultilineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
+ return this.forwardJSONCall("toggleMultilineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
};
LanguageServiceShimObject.prototype.commentSelection = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("commentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.commentSelection(fileName, textRange); });
+ return this.forwardJSONCall("commentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.commentSelection(fileName, textRange); });
};
LanguageServiceShimObject.prototype.uncommentSelection = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("uncommentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.uncommentSelection(fileName, textRange); });
+ return this.forwardJSONCall("uncommentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.uncommentSelection(fileName, textRange); });
};
return LanguageServiceShimObject;
}(ShimBase));
@@ -164767,7 +164768,7 @@ var ts;
};
CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("resolveModuleName('" + fileName + "')", function () {
+ return this.forwardJSONCall("resolveModuleName('".concat(fileName, "')"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;
@@ -164782,7 +164783,7 @@ var ts;
};
CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("resolveTypeReferenceDirective(" + fileName + ")", function () {
+ return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(fileName, ")"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
return {
@@ -164794,7 +164795,7 @@ var ts;
};
CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
var _this = this;
- return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () {
+ return this.forwardJSONCall("getPreProcessedFileInfo('".concat(fileName, "')"), function () {
// for now treat files as JavaScript
var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true);
return {
@@ -164809,7 +164810,7 @@ var ts;
};
CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("getAutomaticTypeDirectiveNames('" + compilerOptionsJson + "')", function () {
+ return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(compilerOptionsJson, "')"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
});
@@ -164831,7 +164832,7 @@ var ts;
};
CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
var _this = this;
- return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () {
+ return this.forwardJSONCall("getTSConfigFileInfo('".concat(fileName, "')"), function () {
var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot));
var normalizedFileName = ts.normalizeSlashes(fileName);
var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName);
diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js
index 23408717f05..3f3862aee42 100644
--- a/lib/typescriptServices.js
+++ b/lib/typescriptServices.js
@@ -21,7 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
ar[i] = from[i];
}
}
- return to.concat(ar || from);
+ return to.concat(ar || Array.prototype.slice.call(from));
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
@@ -294,7 +294,7 @@ var ts;
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
- ts.version = ts.versionMajorMinor + ".1-rc";
+ ts.version = "4.6.2";
/* @internal */
var Comparison;
(function (Comparison) {
@@ -341,7 +341,7 @@ var ts;
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
if (constructor)
return constructor;
- throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
+ throw new Error("TypeScript requires an environment that provides a compatible native ".concat(name, " implementation."));
}
})(ts || (ts = {}));
/* @internal */
@@ -1691,7 +1691,7 @@ var ts;
function cast(value, test) {
if (value !== undefined && test(value))
return value;
- return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'.");
+ return ts.Debug.fail("Invalid cast. The supplied value ".concat(value, " did not pass the test '").concat(ts.Debug.getFunctionName(test), "'."));
}
ts.cast = cast;
/** Does nothing. */
@@ -1782,7 +1782,7 @@ var ts;
function memoizeOne(callback) {
var map = new ts.Map();
return function (arg) {
- var key = typeof arg + ":" + arg;
+ var key = "".concat(typeof arg, ":").concat(arg);
var value = map.get(key);
if (value === undefined && !map.has(key)) {
value = callback(arg);
@@ -2232,7 +2232,7 @@ var ts;
ts.createGetCanonicalFileName = createGetCanonicalFileName;
function patternText(_a) {
var prefix = _a.prefix, suffix = _a.suffix;
- return prefix + "*" + suffix;
+ return "".concat(prefix, "*").concat(suffix);
}
ts.patternText = patternText;
/**
@@ -2545,7 +2545,7 @@ var ts;
}
function fail(message, stackCrawlMark) {
debugger;
- var e = new Error(message ? "Debug Failure. " + message : "Debug Failure.");
+ var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");
if (Error.captureStackTrace) {
Error.captureStackTrace(e, stackCrawlMark || fail);
}
@@ -2553,12 +2553,12 @@ var ts;
}
Debug.fail = fail;
function failBadSyntaxKind(node, message, stackCrawlMark) {
- return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", stackCrawlMark || failBadSyntaxKind);
+ return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind);
}
Debug.failBadSyntaxKind = failBadSyntaxKind;
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
if (!expression) {
- message = message ? "False expression: " + message : "False expression.";
+ message = message ? "False expression: ".concat(message) : "False expression.";
if (verboseDebugInfo) {
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
}
@@ -2568,26 +2568,26 @@ var ts;
Debug.assert = assert;
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
if (a !== b) {
- var message = msg ? msg2 ? msg + " " + msg2 : msg : "";
- fail("Expected " + a + " === " + b + ". " + message, stackCrawlMark || assertEqual);
+ var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
+ fail("Expected ".concat(a, " === ").concat(b, ". ").concat(message), stackCrawlMark || assertEqual);
}
}
Debug.assertEqual = assertEqual;
function assertLessThan(a, b, msg, stackCrawlMark) {
if (a >= b) {
- fail("Expected " + a + " < " + b + ". " + (msg || ""), stackCrawlMark || assertLessThan);
+ fail("Expected ".concat(a, " < ").concat(b, ". ").concat(msg || ""), stackCrawlMark || assertLessThan);
}
}
Debug.assertLessThan = assertLessThan;
function assertLessThanOrEqual(a, b, stackCrawlMark) {
if (a > b) {
- fail("Expected " + a + " <= " + b, stackCrawlMark || assertLessThanOrEqual);
+ fail("Expected ".concat(a, " <= ").concat(b), stackCrawlMark || assertLessThanOrEqual);
}
}
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
if (a < b) {
- fail("Expected " + a + " >= " + b, stackCrawlMark || assertGreaterThanOrEqual);
+ fail("Expected ".concat(a, " >= ").concat(b), stackCrawlMark || assertGreaterThanOrEqual);
}
}
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
@@ -2618,42 +2618,42 @@ var ts;
function assertNever(member, message, stackCrawlMark) {
if (message === void 0) { message = "Illegal value:"; }
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
- return fail(message + " " + detail, stackCrawlMark || assertNever);
+ return fail("".concat(message, " ").concat(detail), stackCrawlMark || assertNever);
}
Debug.assertNever = assertNever;
function assertEachNode(nodes, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) {
- assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertEachNode);
+ assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '".concat(getFunctionName(test), "'."); }, stackCrawlMark || assertEachNode);
}
}
Debug.assertEachNode = assertEachNode;
function assertNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNode")) {
- assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNode);
+ 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);
}
}
Debug.assertNode = assertNode;
function assertNotNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) {
- assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " should not have passed test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNotNode);
+ 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);
}
}
Debug.assertNotNode = assertNotNode;
function assertOptionalNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) {
- assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertOptionalNode);
+ 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);
}
}
Debug.assertOptionalNode = assertOptionalNode;
function assertOptionalToken(node, kind, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) {
- assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, stackCrawlMark || assertOptionalToken);
+ 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);
}
}
Debug.assertOptionalToken = assertOptionalToken;
function assertMissingNode(node, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) {
- assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, stackCrawlMark || assertMissingNode);
+ assert(node === undefined, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); }, stackCrawlMark || assertMissingNode);
}
}
Debug.assertMissingNode = assertMissingNode;
@@ -2674,7 +2674,7 @@ var ts;
}
Debug.getFunctionName = getFunctionName;
function formatSymbol(symbol) {
- return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }";
+ return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");
}
Debug.formatSymbol = formatSymbol;
/**
@@ -2695,7 +2695,7 @@ var ts;
break;
}
if (enumValue !== 0 && enumValue & value) {
- result = "" + result + (result ? "|" : "") + enumName;
+ result = "".concat(result).concat(result ? "|" : "").concat(enumName);
remainingFlags &= ~enumValue;
}
}
@@ -2805,7 +2805,7 @@ var ts;
this.flags & 1 /* Unreachable */ ? "FlowUnreachable" :
"UnknownFlow";
var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);
- return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : "");
+ return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : "");
}
},
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },
@@ -2844,7 +2844,7 @@ var ts;
// We don't care, this is debug code that's only enabled with a debugger attached -
// we're just taking note of it for anyone checking regex performance in the future.
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
- return "NodeArray " + defaultValue;
+ return "NodeArray ".concat(defaultValue);
}
}
});
@@ -2899,7 +2899,7 @@ var ts;
var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" :
"Symbol";
var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;
- return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : "");
+ return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
@@ -2909,11 +2909,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" :
- this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) :
- this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" :
+ this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType ".concat(JSON.stringify(this.value)) :
+ this.flags & 2048 /* BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") :
this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" :
this.flags & 32 /* Enum */ ? "EnumType" :
- this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName :
+ this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType ".concat(this.intrinsicName) :
this.flags & 1048576 /* Union */ ? "UnionType" :
this.flags & 2097152 /* Intersection */ ? "IntersectionType" :
this.flags & 4194304 /* Index */ ? "IndexType" :
@@ -2932,7 +2932,7 @@ var ts;
"ObjectType" :
"Type";
var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
- return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : "");
+ return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
@@ -2968,11 +2968,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
- ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" :
- ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" :
- ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") :
- ts.isNumericLiteral(this) ? "NumericLiteral " + this.text :
- ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" :
+ ts.isIdentifier(this) ? "Identifier '".concat(ts.idText(this), "'") :
+ ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
+ ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
+ ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
+ ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") :
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
ts.isParameter(this) ? "ParameterDeclaration" :
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
@@ -3004,7 +3004,7 @@ var ts;
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
ts.isImportTypeNode(this) ? "ImportTypeNode" :
formatSyntaxKind(this.kind);
- return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : "");
+ return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : "");
}
},
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
@@ -3051,10 +3051,10 @@ var ts;
Debug.enableDebugInfo = enableDebugInfo;
function formatDeprecationMessage(name, error, errorAfter, since, message) {
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
- deprecationMessage += "'" + name + "' ";
- deprecationMessage += since ? "has been deprecated since v" + since : "is deprecated";
- deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v" + errorAfter + "." : ".";
- deprecationMessage += message ? " " + ts.formatStringFromArgs(message, [name], 0) : "";
+ deprecationMessage += "'".concat(name, "' ");
+ deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
+ deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
+ deprecationMessage += message ? " ".concat(ts.formatStringFromArgs(message, [name], 0)) : "";
return deprecationMessage;
}
function createErrorDeprecation(name, errorAfter, since, message) {
@@ -3185,11 +3185,11 @@ var ts;
}
};
Version.prototype.toString = function () {
- var result = this.major + "." + this.minor + "." + this.patch;
+ var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
if (ts.some(this.prerelease))
- result += "-" + this.prerelease.join(".");
+ result += "-".concat(this.prerelease.join("."));
if (ts.some(this.build))
- result += "+" + this.build.join(".");
+ result += "+".concat(this.build.join("."));
return result;
};
Version.zero = new Version(0, 0, 0);
@@ -3456,7 +3456,7 @@ var ts;
return ts.map(comparators, formatComparator).join(" ");
}
function formatComparator(comparator) {
- return "" + comparator.operator + comparator.operand;
+ return "".concat(comparator.operator).concat(comparator.operand);
}
})(ts || (ts = {}));
/*@internal*/
@@ -3754,7 +3754,7 @@ var ts;
fs = require("fs");
}
catch (e) {
- throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
+ throw new Error("tracing requires having fs\n(original error: ".concat(e.message || e, ")"));
}
}
mode = tracingMode;
@@ -3766,11 +3766,11 @@ var ts;
if (!fs.existsSync(traceDir)) {
fs.mkdirSync(traceDir, { recursive: true });
}
- var countPart = mode === "build" ? "." + process.pid + "-" + ++traceCount
- : mode === "server" ? "." + process.pid
+ var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount)
+ : mode === "server" ? ".".concat(process.pid)
: "";
- var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
- var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
+ var tracePath = ts.combinePaths(traceDir, "trace".concat(countPart, ".json"));
+ var typesPath = ts.combinePaths(traceDir, "types".concat(countPart, ".json"));
legend.push({
configFilePath: configFilePath,
tracePath: tracePath,
@@ -3860,7 +3860,7 @@ var ts;
}
// test if [time,endTime) straddles a sampling point
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
- writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
+ writeEvent("X", phase, name, args, "\"dur\":".concat(endTime - time), time);
}
}
function writeEvent(eventType, phase, name, args, extras, time) {
@@ -3869,11 +3869,11 @@ var ts;
if (mode === "server" && phase === "checkTypes" /* CheckTypes */)
return;
ts.performance.mark("beginTracing");
- fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\"");
+ fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
if (extras)
- fs.writeSync(traceFd, "," + extras);
+ fs.writeSync(traceFd, ",".concat(extras));
if (args)
- fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args));
+ fs.writeSync(traceFd, ",\"args\":".concat(JSON.stringify(args)));
fs.writeSync(traceFd, "}");
ts.performance.mark("endTracing");
ts.performance.measure("Tracing", "beginTracing", "endTracing");
@@ -5034,6 +5034,8 @@ var ts;
TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike";
TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike";
/* @internal */
+ TypeFlags[TypeFlags["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable";
+ /* @internal */
TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains";
TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection";
TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType";
@@ -5986,7 +5988,7 @@ var ts;
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
function getLevel(envVar, level) {
- return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase());
+ return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
}
function getCustomLevels(baseVariable) {
var customLevels;
@@ -6455,7 +6457,7 @@ var ts;
}
function onTimerToUpdateChildWatches() {
timerToUpdateChildWatches = undefined;
- sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
var start = ts.timestamp();
var invokeMap = new ts.Map();
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
@@ -6468,7 +6470,7 @@ var ts;
var hasChanges = updateChildWatches(dirName, dirPath, options);
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
}
- sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
callbackCache.forEach(function (callbacks, rootDirName) {
var existing = invokeMap.get(rootDirName);
if (existing) {
@@ -6484,7 +6486,7 @@ var ts;
}
});
var elapsed = ts.timestamp() - start;
- sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
+ sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
}
function removeChildWatches(parentWatcher) {
if (!parentWatcher)
@@ -6944,7 +6946,7 @@ var ts;
var remappedPaths = new ts.Map();
var normalizedDir = ts.normalizeSlashes(__dirname);
// Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
- var fileUrlRoot = "file://" + (ts.getRootLength(normalizedDir) === 1 ? "" : "/") + normalizedDir;
+ var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
var node = _a[_i];
if (node.callFrame.url) {
@@ -6953,7 +6955,7 @@ var ts;
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
}
else if (!nativePattern.test(url)) {
- node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external" + externalFileCounter + ".js")).get(url);
+ node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
externalFileCounter++;
}
}
@@ -6969,7 +6971,7 @@ var ts;
if (!err) {
try {
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
- profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
+ profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
}
}
catch (_c) {
@@ -7071,7 +7073,7 @@ var ts;
* @param createWatcher
*/
function invokeCallbackAndUpdateWatcher(createWatcher) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
// Call the callback for current directory
callback("rename", "");
// If watcher is not closed, update it
@@ -7096,7 +7098,7 @@ var ts;
}
}
if (hitSystemWatcherLimit) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
@@ -7112,7 +7114,7 @@ var ts;
// 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
// so instead of throwing error, use fs.watchFile
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
}
@@ -8275,6 +8277,8 @@ var ts;
Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),
+ Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, ts.DiagnosticCategory.Error, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."),
+ Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, ts.DiagnosticCategory.Error, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
@@ -10127,7 +10131,7 @@ var ts;
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
}
else {
- ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
+ 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"));
}
}
var res = lineStarts[line] + character;
@@ -13017,7 +13021,7 @@ var ts;
: "linkplain";
var name = link.name ? ts.entityNameToString(link.name) : "";
var space = link.name && link.text.startsWith("://") ? "" : " ";
- return "{@" + kind + " " + name + space + link.text + "}";
+ return "{@".concat(kind, " ").concat(name).concat(space).concat(link.text, "}");
}
/**
* Gets the effective type parameters. If the node was parsed in a
@@ -14274,11 +14278,11 @@ var ts;
}
function packageIdToPackageName(_a) {
var name = _a.name, subModuleName = _a.subModuleName;
- return subModuleName ? name + "/" + subModuleName : name;
+ return subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
}
ts.packageIdToPackageName = packageIdToPackageName;
function packageIdToString(packageId) {
- return packageIdToPackageName(packageId) + "@" + packageId.version;
+ return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version);
}
ts.packageIdToString = packageIdToString;
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
@@ -14361,7 +14365,7 @@ var ts;
function nodePosToString(node) {
var file = getSourceFileOfNode(node);
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
- return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
+ return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
}
ts.nodePosToString = nodePosToString;
function getEndLinePosition(line, sourceFile) {
@@ -14500,7 +14504,7 @@ var ts;
ts.isPinnedComment = isPinnedComment;
function createCommentDirectivesMap(sourceFile, commentDirectives) {
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
- "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,
+ "".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
commentDirective,
]); }));
var usedLines = new ts.Map();
@@ -14517,10 +14521,10 @@ var ts;
});
}
function markUsed(line) {
- if (!directivesByLine.has("" + line)) {
+ if (!directivesByLine.has("".concat(line))) {
return false;
}
- usedLines.set("" + line, true);
+ usedLines.set("".concat(line), true);
return true;
}
}
@@ -14750,7 +14754,7 @@ var ts;
}
return node.text;
}
- return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
+ return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
}
ts.getLiteralText = getLiteralText;
function canUseOriginalText(node, flags) {
@@ -17331,11 +17335,11 @@ var ts;
}
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
function getPropertyNameForUniqueESSymbol(symbol) {
- return "__@" + ts.getSymbolId(symbol) + "@" + symbol.escapedName;
+ return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
}
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
- return "__#" + ts.getSymbolId(containingClassSymbol) + "@" + description;
+ return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
}
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
function isKnownSymbol(symbol) {
@@ -20037,7 +20041,7 @@ var ts;
}
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
function getJSXRuntimeImport(base, options) {
- return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
+ return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
}
ts.getJSXRuntimeImport = getJSXRuntimeImport;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -20144,7 +20148,7 @@ var ts;
}
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
- var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))";
+ var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
var filesMatcher = {
/**
* Matches any single directory segment unless it is the last segment and a .min.js file
@@ -20157,7 +20161,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
};
var directoriesMatcher = {
@@ -20166,7 +20170,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
};
var excludeMatcher = {
@@ -20184,10 +20188,10 @@ var ts;
if (!patterns || !patterns.length) {
return undefined;
}
- var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|");
+ var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
var terminator = usage === "exclude" ? "($|/)" : "$";
- return "^(" + pattern + ")" + terminator;
+ return "^(".concat(pattern, ")").concat(terminator);
}
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
function getRegularExpressionsForWildcards(specs, basePath, usage) {
@@ -20209,7 +20213,7 @@ var ts;
ts.isImplicitGlob = isImplicitGlob;
function getPatternFromSpec(spec, basePath, usage) {
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
- return pattern && "^(" + pattern + ")" + (usage === "exclude" ? "($|/)" : "$");
+ return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
}
ts.getPatternFromSpec = getPatternFromSpec;
function getSubPatternFromSpec(spec, basePath, usage, _a) {
@@ -20287,7 +20291,7 @@ var ts;
currentDirectory = ts.normalizePath(currentDirectory);
var absolutePath = ts.combinePaths(currentDirectory, path);
return {
- includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
+ includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
@@ -20568,7 +20572,7 @@ var ts;
*/
function extensionFromPath(path) {
var ext = tryGetExtensionFromPath(path);
- return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension.");
+ return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
}
ts.extensionFromPath = extensionFromPath;
function isAnySupportedFileExtension(path) {
@@ -26651,7 +26655,7 @@ var ts;
case 326 /* JSDocAugmentsTag */: return "augments";
case 327 /* JSDocImplementsTag */: return "implements";
default:
- return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
+ return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
}
}
var rawTextScanner;
@@ -26979,7 +26983,7 @@ var ts;
};
var definedTextGetter_1 = function (path) {
var result = textGetter_1(path);
- return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
+ return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
};
var buildInfo_1;
var getAndCacheBuildInfo_1 = function (getText) {
@@ -31517,7 +31521,7 @@ var ts;
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
var keyword = viableKeywordSuggestions_1[_i];
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
- return keyword + " " + expressionText.slice(keyword.length);
+ return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
}
}
return undefined;
@@ -38287,7 +38291,7 @@ var ts;
if (namedArgRegExCache.has(name)) {
return namedArgRegExCache.get(name);
}
- var result = new RegExp("(\\s" + name + "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))", "im");
+ var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
namedArgRegExCache.set(name, result);
return result;
}
@@ -39765,8 +39769,8 @@ var ts;
}
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
- var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
- return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
+ var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
+ return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
}
/* @internal */
function parseCustomTypeOption(opt, value, errors) {
@@ -40560,10 +40564,10 @@ var ts;
var newValue = compilerOptionsMap.get(cmd.name);
var defaultValue = getDefaultValueForOption(cmd);
if (newValue !== defaultValue) {
- result.push("" + tab + cmd.name + ": " + newValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
}
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
- result.push("" + tab + cmd.name + ": " + defaultValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
}
});
return result.join(newLine) + newLine;
@@ -40614,19 +40618,19 @@ var ts;
if (entries.length !== 0) {
entries.push({ value: "" });
}
- entries.push({ value: "/* " + category + " */" });
+ entries.push({ value: "/* ".concat(category, " */") });
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
var option = options_1[_i];
var optionName = void 0;
if (compilerOptionsMap.has(option.name)) {
- optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
+ optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
}
else {
- optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ",";
+ optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
}
entries.push({
value: optionName,
- description: "/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"
+ description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
});
marginLength = Math.max(optionName.length, marginLength);
}
@@ -40635,25 +40639,25 @@ var ts;
var tab = makePadding(2);
var result = [];
result.push("{");
- result.push(tab + "\"compilerOptions\": {");
- result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + " */");
+ result.push("".concat(tab, "\"compilerOptions\": {"));
+ 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), " */"));
result.push("");
// Print out each row, aligning all the descriptions on the same column.
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
var entry = entries_2[_a];
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
- result.push(value && "" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));
+ result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
}
if (fileNames.length) {
- result.push(tab + "},");
- result.push(tab + "\"files\": [");
+ result.push("".concat(tab, "},"));
+ result.push("".concat(tab, "\"files\": ["));
for (var i = 0; i < fileNames.length; i++) {
- result.push("" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? "" : ","));
+ result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
}
- result.push(tab + "]");
+ result.push("".concat(tab, "]"));
}
else {
- result.push(tab + "}");
+ result.push("".concat(tab, "}"));
}
result.push("}");
return result.join(newLine) + newLine;
@@ -41051,7 +41055,7 @@ var ts;
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
- extendedConfigPath = extendedConfigPath + ".json";
+ extendedConfigPath = "".concat(extendedConfigPath, ".json");
if (!host.fileExists(extendedConfigPath)) {
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
return undefined;
@@ -41296,7 +41300,7 @@ var ts;
// Valid only if *.json specified
if (!jsonOnlyIncludeRegexes) {
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
- var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^" + pattern + "$"; });
+ var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
}
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
@@ -41732,7 +41736,7 @@ var ts;
var bestVersionKey = result.version, bestVersionPaths = result.paths;
if (typeof bestVersionPaths !== "object") {
if (state.traceEnabled) {
- trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['" + bestVersionKey + "']", "object", typeof bestVersionPaths);
+ trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
}
return;
}
@@ -42139,7 +42143,7 @@ var ts;
};
return cache;
function getUnderlyingCacheKey(specifier, mode) {
- var result = mode === undefined ? specifier : mode + "|" + specifier;
+ var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
memoizedReverseKeys.set(result, [specifier, mode]);
return result;
}
@@ -42170,7 +42174,7 @@ var ts;
}
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
- return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode + "|" + nonRelativeModuleName, createPerModuleNameCache);
+ return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
}
function createPerModuleNameCache() {
var directoryPathMap = new ts.Map();
@@ -42317,10 +42321,10 @@ var ts;
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
break;
default:
- return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
+ return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
}
if (result && result.resolvedModule)
- ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
+ ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
if (perFolderCache) {
perFolderCache.set(moduleName, resolutionMode, result);
@@ -42523,7 +42527,7 @@ var ts;
function resolveJSModule(moduleName, initialDir, host) {
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
if (!resolvedModule) {
- throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", "));
+ throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
}
return resolvedModule.resolvedFileName;
}
@@ -42633,7 +42637,7 @@ var ts;
if (traceEnabled) {
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
}
- ts.Debug.assert(host.fileExists(real), path + " linked to nonexistent file " + real);
+ ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
return real;
}
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
@@ -43110,7 +43114,7 @@ var ts;
return undefined;
}
var trailingParts = parts.slice(nameParts.length);
- return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
+ return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
}
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
if (!scope.packageJsonContent.exports) {
@@ -43438,7 +43442,7 @@ var ts;
}
/* @internal */
function getTypesPackageName(packageName) {
- return "@types/" + mangleScopedPackageName(packageName);
+ return "@types/".concat(mangleScopedPackageName(packageName));
}
ts.getTypesPackageName = getTypesPackageName;
/* @internal */
@@ -43839,7 +43843,7 @@ var ts;
if (name) {
if (ts.isAmbientModule(node)) {
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
- return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
+ return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
}
if (name.kind === 161 /* ComputedPropertyName */) {
var nameExpression = name.expression;
@@ -43896,7 +43900,7 @@ var ts;
case 163 /* Parameter */:
// Parameters with names are handled at the top of this function. Parameters
// without names can only come from JSDocFunctionTypes.
- ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ 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"); });
var functionType = node.parent;
var index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -44008,7 +44012,7 @@ var ts;
var relatedInformation_1 = [];
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
// export type T; - may have meant export type { T }?
- relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { " + ts.unescapeLeadingUnderscores(node.name.escapedText) + " }"));
+ relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
}
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
ts.forEach(symbol.declarations, function (declaration, index) {
@@ -46084,7 +46088,7 @@ var ts;
}
}
function bindSourceFileAsExternalModule() {
- bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\"");
+ bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
}
function bindExportAssignment(node) {
if (!container.symbol || !container.symbol.exports) {
@@ -47135,8 +47139,7 @@ var ts;
IntersectionState[IntersectionState["Source"] = 1] = "Source";
IntersectionState[IntersectionState["Target"] = 2] = "Target";
IntersectionState[IntersectionState["PropertyCheck"] = 4] = "PropertyCheck";
- IntersectionState[IntersectionState["UnionIntersectionCheck"] = 8] = "UnionIntersectionCheck";
- IntersectionState[IntersectionState["InPropertyCheck"] = 16] = "InPropertyCheck";
+ IntersectionState[IntersectionState["InPropertyCheck"] = 8] = "InPropertyCheck";
})(IntersectionState || (IntersectionState = {}));
var RecursionFlags;
(function (RecursionFlags) {
@@ -48184,7 +48187,7 @@ var ts;
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
- var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + "|" + secondFile_1.path, function () {
+ var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
});
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
@@ -50837,7 +50840,7 @@ var ts;
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
- var key = (useOnlyExternalAliasing ? 0 : 1) + "|" + (firstRelevantLocation && getNodeId(firstRelevantLocation)) + "|" + meaning;
+ var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
if (cache.has(key)) {
return cache.get(key);
}
@@ -51686,7 +51689,7 @@ var ts;
context.symbolDepth = new ts.Map();
}
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
- var key = getTypeId(type) + "|" + context.flags;
+ var key = "".concat(getTypeId(type), "|").concat(context.flags);
if (links) {
links.serializedTypes || (links.serializedTypes = new ts.Map());
}
@@ -51955,7 +51958,7 @@ var ts;
}
}
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
- typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... " + (properties.length - i) + " more ...", /*questionToken*/ undefined, /*type*/ undefined));
+ typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
break;
}
@@ -52070,7 +52073,7 @@ var ts;
else if (types.length > 2) {
return [
typeToTypeNodeHelper(types[0], context),
- ts.factory.createTypeReferenceNode("... " + (types.length - 2) + " more ...", /*typeArguments*/ undefined),
+ ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
typeToTypeNodeHelper(types[types.length - 1], context)
];
}
@@ -52084,7 +52087,7 @@ var ts;
var type = types_2[_i];
i++;
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
- result_5.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined));
+ result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
if (typeNode_1) {
result_5.push(typeNode_1);
@@ -52607,7 +52610,7 @@ var ts;
var text = rawtext;
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
i++;
- text = rawtext + "_" + i;
+ text = "".concat(rawtext, "_").concat(i);
}
if (text !== rawtext) {
result = ts.factory.createIdentifier(text, result.typeArguments);
@@ -52927,7 +52930,7 @@ var ts;
function getNameForJSDocFunctionParameter(p, index) {
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
: getEffectiveDotDotDotForParameter(p) ? "args"
- : "arg" + index;
+ : "arg".concat(index);
}
function rewriteModuleSpecifier(parent, lit) {
if (bundled) {
@@ -54012,7 +54015,7 @@ var ts;
return results_1;
}
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
- return ts.Debug.fail("Unhandled class member kind! " + (p.__debugFlags || p.flags));
+ return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
};
}
function serializePropertySymbolForInterface(p, baseType) {
@@ -54087,7 +54090,7 @@ var ts;
if (ref) {
return ref;
}
- var tempName = getUnusedName(rootName + "_base");
+ var tempName = getUnusedName("".concat(rootName, "_base"));
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
], 2 /* Const */));
@@ -54134,7 +54137,7 @@ var ts;
var original = input;
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
i++;
- input = original + "_" + i;
+ input = "".concat(original, "_").concat(i);
}
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
if (id) {
@@ -54242,15 +54245,15 @@ var ts;
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
var name = "" + nameType.value;
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
- return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\"";
+ return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
}
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
- return "[" + name + "]";
+ return "[".concat(name, "]");
}
return name;
}
if (nameType.flags & 8192 /* UniqueESSymbol */) {
- return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
+ return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
}
}
}
@@ -57081,7 +57084,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -59032,7 +59035,7 @@ var ts;
return result;
}
function getAliasId(aliasSymbol, aliasTypeArguments) {
- return aliasSymbol ? "@" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? ":" + getTypeListId(aliasTypeArguments) : "") : "";
+ return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
}
// This function is used to propagate certain flags when creating new object type references and union types.
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
@@ -59218,7 +59221,7 @@ var ts;
return undefined;
}
function getSymbolPath(symbol) {
- return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
+ return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
@@ -59229,7 +59232,7 @@ var ts;
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
undefined;
- var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
+ var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
var result = unresolvedSymbols.get(path);
if (!result) {
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
@@ -59302,7 +59305,7 @@ var ts;
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
return baseType;
}
- var id = getTypeId(baseType) + ">" + getTypeId(substitute);
+ var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
var cached = substitutionTypes.get(id);
if (cached) {
return cached;
@@ -60226,9 +60229,9 @@ var ts;
return types[0];
}
var typeKey = !origin ? getTypeListId(types) :
- origin.flags & 1048576 /* Union */ ? "|" + getTypeListId(origin.types) :
- origin.flags & 2097152 /* Intersection */ ? "&" + getTypeListId(origin.types) :
- "#" + origin.type.id + "|" + getTypeListId(types); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
+ origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
+ origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
+ "#".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
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
var type = unionTypes.get(id);
if (!type) {
@@ -60750,7 +60753,7 @@ var ts;
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
return stringType;
}
- var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join("");
+ var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
var type = templateLiteralTypes.get(id);
if (!type) {
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
@@ -60810,7 +60813,7 @@ var ts;
return str;
}
function getStringMappingTypeForGenericType(symbol, type) {
- var id = getSymbolId(symbol) + "," + getTypeId(type);
+ var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
var result = stringMappingTypes.get(id);
if (!result) {
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
@@ -61827,7 +61830,7 @@ var ts;
function createUniqueESSymbolType(symbol) {
var type = createType(8192 /* UniqueESSymbol */);
type.symbol = symbol;
- type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
+ type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
return type;
}
function getESSymbolLikeTypeForNode(node) {
@@ -63422,11 +63425,11 @@ var ts;
var overflow = false;
var overrideNextErrorInfo = 0; // How many `reportRelationError` calls should be skipped in the elaboration pyramid
var lastSkippedInfo;
- var incompatibleStack = [];
+ var incompatibleStack;
var inPropertyCheck = false;
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
var result = isRelatedTo(source, target, 3 /* Both */, /*reportErrors*/ !!errorNode, headMessage);
- if (incompatibleStack.length) {
+ if (incompatibleStack) {
reportIncompatibleStack();
}
if (overflow) {
@@ -63483,19 +63486,19 @@ var ts;
return {
errorInfo: errorInfo,
lastSkippedInfo: lastSkippedInfo,
- incompatibleStack: incompatibleStack.slice(),
+ incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
overrideNextErrorInfo: overrideNextErrorInfo,
- relatedInfo: !relatedInfo ? undefined : relatedInfo.slice()
+ relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
};
}
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
overrideNextErrorInfo++; // Suppress the next relation error
lastSkippedInfo = undefined; // Reset skipped info cache
- incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
+ (incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
}
function reportIncompatibleStack() {
- var stack = incompatibleStack;
- incompatibleStack = [];
+ var stack = incompatibleStack || [];
+ incompatibleStack = undefined;
var info = lastSkippedInfo;
lastSkippedInfo = undefined;
if (stack.length === 1) {
@@ -63516,24 +63519,24 @@ var ts;
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
// Parenthesize a `new` if there is one
if (path.indexOf("new ") === 0) {
- path = "(" + path + ")";
+ path = "(".concat(path, ")");
}
var str = "" + args[0];
// If leading, just print back the arg (irrespective of if it's a valid identifier)
if (path.length === 0) {
- path = "" + str;
+ path = "".concat(str);
}
// Otherwise write a dotted name if possible
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
- path = path + "." + str;
+ path = "".concat(path, ".").concat(str);
}
// Failing that, check if the name is already a computed name
else if (str[0] === "[" && str[str.length - 1] === "]") {
- path = "" + path + str;
+ path = "".concat(path).concat(str);
}
// And finally write out a computed name as a last resort
else {
- path = path + "[" + str + "]";
+ path = "".concat(path, "[").concat(str, "]");
}
break;
}
@@ -63562,7 +63565,7 @@ var ts;
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
? ""
: "...";
- path = "" + prefix + path + "(" + params + ")";
+ path = "".concat(prefix).concat(path, "(").concat(params, ")");
}
break;
}
@@ -63575,7 +63578,7 @@ var ts;
break;
}
default:
- return ts.Debug.fail("Unhandled Diagnostic: " + msg.code);
+ return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
}
}
if (path) {
@@ -63601,7 +63604,7 @@ var ts;
}
function reportError(message, arg0, arg1, arg2, arg3) {
ts.Debug.assert(!!errorNode);
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
if (message.elidedInCompatabilityPyramid)
return;
@@ -63617,7 +63620,7 @@ var ts;
}
}
function reportRelationError(message, source, target) {
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
var generalizedSource = source;
@@ -63729,7 +63732,9 @@ var ts;
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
return -1 /* True */;
}
- reportErrorResults(originalSource, originalTarget, 0 /* False */, !!(ts.getObjectFlags(originalSource) & 2048 /* JsxAttributes */));
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
+ }
return 0 /* False */;
}
// Normalize the source and target types: Turn fresh literal types into regular literal types,
@@ -63741,7 +63746,12 @@ var ts;
if (source === target)
return -1 /* True */;
if (relation === identityRelation) {
- return isIdenticalTo(source, target, recursionFlags);
+ if (source.flags !== target.flags)
+ return 0 /* False */;
+ if (source.flags & 67358815 /* Singleton */)
+ return -1 /* True */;
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
}
// We fastpath comparing a type parameter to exactly its constraint, as this is _super_ common,
// and otherwise, for type parameters in large unions, causes us to need to compare the union to itself,
@@ -63751,163 +63761,130 @@ var ts;
if (source.flags & 262144 /* TypeParameter */ && getConstraintOfType(source) === target) {
return -1 /* True */;
}
- // Try to see if we're relating something like `Foo` -> `Bar | null | undefined`.
- // If so, reporting the `null` and `undefined` in the type is hardly useful.
- // First, see if we're even relating an object type to a union.
- // Then see if the target is stripped down to a single non-union type.
- // Note
- // * We actually want to remove null and undefined naively here (rather than using getNonNullableType),
- // since we don't want to end up with a worse error like "`Foo` is not assignable to `NonNullable`"
- // when dealing with generics.
- // * We also don't deal with primitive source types, since we already halt elaboration below.
- if (target.flags & 1048576 /* Union */ && source.flags & 524288 /* Object */ &&
- target.types.length <= 3 && maybeTypeOfKind(target, 98304 /* Nullable */)) {
- var nullStrippedTarget = extractTypesOfKind(target, ~98304 /* Nullable */);
- if (!(nullStrippedTarget.flags & (1048576 /* Union */ | 131072 /* Never */))) {
- target = getNormalizedType(nullStrippedTarget, /*writing*/ true);
+ // See if we're relating a definitely non-nullable type to a union that includes null and/or undefined
+ // plus a single non-nullable type. If so, remove null and/or undefined from the target type.
+ if (source.flags & 470302716 /* DefinitelyNonNullable */ && target.flags & 1048576 /* Union */) {
+ var types = target.types;
+ var candidate = types.length === 2 && types[0].flags & 98304 /* Nullable */ ? types[1] :
+ types.length === 3 && types[0].flags & 98304 /* Nullable */ && types[1].flags & 98304 /* Nullable */ ? types[2] :
+ undefined;
+ if (candidate && !(candidate.flags & 98304 /* Nullable */)) {
+ target = getNormalizedType(candidate, /*writing*/ true);
+ if (source === target)
+ return -1 /* True */;
}
- if (source === nullStrippedTarget)
- return -1 /* True */;
}
if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) ||
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
return -1 /* True */;
- var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
- var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
- if (isPerformingExcessPropertyChecks) {
- if (hasExcessProperties(source, target, reportErrors)) {
+ if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {
+ var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
+ if (isPerformingExcessPropertyChecks) {
+ if (hasExcessProperties(source, target, reportErrors)) {
+ if (reportErrors) {
+ reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ }
+ return 0 /* False */;
+ }
+ }
+ var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
+ source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
+ target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
+ (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
+ var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
+ if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
if (reportErrors) {
- reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
+ var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
+ var calls = getSignaturesOfType(source, 0 /* Call */);
+ var constructs = getSignaturesOfType(source, 1 /* Construct */);
+ if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
+ constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
+ reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
+ }
+ else {
+ reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
+ }
}
return 0 /* False */;
}
- }
- var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
- source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
- target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
- (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
- if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
- if (reportErrors) {
- var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
- var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
- var calls = getSignaturesOfType(source, 0 /* Call */);
- var constructs = getSignaturesOfType(source, 1 /* Construct */);
- if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
- constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
- reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
- }
- else {
- reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
- }
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ var skipCaching = source.flags & 1048576 /* Union */ && source.types.length < 4 && !(target.flags & 1048576 /* Union */) ||
+ target.flags & 1048576 /* Union */ && target.types.length < 4 && !(source.flags & 469499904 /* StructuredOrInstantiable */);
+ var result_7 = skipCaching ?
+ unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
+ recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
+ // For certain combinations involving intersections and optional, excess, or mismatched properties we need
+ // an extra property check where the intersection is viewed as a single object. The following are motivating
+ // examples that all should be errors, but aren't without this extra property check:
+ //
+ // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
+ //
+ // declare let wrong: { a: { y: string } };
+ // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
+ //
+ // function foo(x: { a?: string }, y: T & { a: boolean }) {
+ // x = y; // Mismatched property in source intersection
+ // }
+ //
+ // We suppress recursive intersection property checks because they can generate lots of work when relating
+ // recursive intersections that are structurally similar but not exactly identical. See #37854.
+ if (result_7 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
+ isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
+ inPropertyCheck = true;
+ result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
+ inPropertyCheck = false;
}
- return 0 /* False */;
- }
- traceUnionsOrIntersectionsTooLarge(source, target);
- var result = 0 /* False */;
- var saveErrorInfo = captureErrorCalculationState();
- if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
- // We skip caching when source or target is a union with no more than three constituents.
- result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
- }
- else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
- result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
- }
- if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
- if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
- resetErrorInfo(saveErrorInfo);
+ if (result_7) {
+ return result_7;
}
}
- if (!result && source.flags & (2097152 /* Intersection */ | 262144 /* TypeParameter */)) {
- // The combined constraint of an intersection type is the intersection of the constraints of
- // the constituents. When an intersection type contains instantiable types with union type
- // constraints, there are situations where we need to examine the combined constraint. One is
- // when the target is a union type. Another is when the intersection contains types belonging
- // to one of the disjoint domains. For example, given type variables T and U, each with the
- // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
- // we need to check this constraint against a union on the target side. Also, given a type
- // variable V constrained to 'string | number', 'V & number' has a combined constraint of
- // 'string & number | number & number' which reduces to just 'number'.
- // This also handles type parameters, as a type parameter with a union constraint compared against a union
- // needs to have its constraint hoisted into an intersection with said type parameter, this way
- // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
- // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
- var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
- if (constraint && (source.flags & 2097152 /* Intersection */ || target.flags & 1048576 /* Union */)) {
- if (everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
- // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
- if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
- resetErrorInfo(saveErrorInfo);
- }
- }
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, source, target, headMessage);
+ }
+ return 0 /* False */;
+ }
+ function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
+ var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
+ var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
+ source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
+ target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
+ var maybeSuppress = overrideNextErrorInfo > 0;
+ if (maybeSuppress) {
+ overrideNextErrorInfo--;
+ }
+ if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
+ var currentError = errorInfo;
+ tryElaborateArrayLikeErrors(source, target, /*reportErrors*/ true);
+ if (errorInfo !== currentError) {
+ maybeSuppress = !!errorInfo;
}
}
- // For certain combinations involving intersections and optional, excess, or mismatched properties we need
- // an extra property check where the intersection is viewed as a single object. The following are motivating
- // examples that all should be errors, but aren't without this extra property check:
- //
- // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
- //
- // declare let wrong: { a: { y: string } };
- // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
- //
- // function foo(x: { a?: string }, y: T & { a: boolean }) {
- // x = y; // Mismatched property in source intersection
- // }
- //
- // We suppress recursive intersection property checks because they can generate lots of work when relating
- // recursive intersections that are structurally similar but not exactly identical. See #37854.
- if (result && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
- isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
- inPropertyCheck = true;
- result &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
- inPropertyCheck = false;
+ if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
+ tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
- reportErrorResults(source, target, result, isComparingJsxAttributes);
- return result;
- function reportErrorResults(source, target, result, isComparingJsxAttributes) {
- if (!result && reportErrors) {
- var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
- var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
- source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
- target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
- var maybeSuppress = overrideNextErrorInfo > 0;
- if (maybeSuppress) {
- overrideNextErrorInfo--;
- }
- if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
- var currentError = errorInfo;
- tryElaborateArrayLikeErrors(source, target, reportErrors);
- if (errorInfo !== currentError) {
- maybeSuppress = !!errorInfo;
- }
- }
- if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
- tryElaborateErrorsForPrimitivesAndObjects(source, target);
- }
- else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
- reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
- }
- else if (isComparingJsxAttributes && target.flags & 2097152 /* Intersection */) {
- var targetTypes = target.types;
- var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
- var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
- if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
- (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
- // do not report top error
- return result;
- }
- }
- else {
- errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
- }
- if (!headMessage && maybeSuppress) {
- lastSkippedInfo = [source, target];
- // Used by, eg, missing property checking to replace the top-level message with a more informative one
- return result;
- }
- reportRelationError(headMessage, source, target);
+ else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
+ reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
+ }
+ else if (ts.getObjectFlags(source) & 2048 /* JsxAttributes */ && target.flags & 2097152 /* Intersection */) {
+ var targetTypes = target.types;
+ var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
+ var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
+ if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
+ (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
+ // do not report top error
+ return;
}
}
+ else {
+ errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
+ }
+ if (!headMessage && maybeSuppress) {
+ lastSkippedInfo = [source, target];
+ // Used by, eg, missing property checking to replace the top-level message with a more informative one
+ return;
+ }
+ reportRelationError(headMessage, source, target);
}
function traceUnionsOrIntersectionsTooLarge(source, target) {
if (!ts.tracing) {
@@ -63934,21 +63911,6 @@ var ts;
}
}
}
- function isIdenticalTo(source, target, recursionFlags) {
- if (source.flags !== target.flags)
- return 0 /* False */;
- if (source.flags & 67358815 /* Singleton */)
- return -1 /* True */;
- traceUnionsOrIntersectionsTooLarge(source, target);
- if (source.flags & 3145728 /* UnionOrIntersection */) {
- var result_7 = eachTypeRelatedToSomeType(source, target);
- if (result_7) {
- result_7 &= eachTypeRelatedToSomeType(target, source);
- }
- return result_7;
- }
- return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
- }
function getTypeOfPropertyInTypes(types, name) {
var appendPropType = function (propTypes, type) {
var _a;
@@ -64047,6 +64009,41 @@ var ts;
function shouldCheckAsExcessProperty(prop, container) {
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
}
+ function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
+ // Note that these checks are specifically ordered to produce correct results. In particular,
+ // we need to deconstruct unions before intersections (because unions are always at the top),
+ // and we need to handle "each" relations before "some" relations for the same kind of type.
+ if (source.flags & 1048576 /* Union */) {
+ return relation === comparableRelation ?
+ someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) :
+ eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState);
+ }
+ if (target.flags & 1048576 /* Union */) {
+ return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
+ }
+ if (target.flags & 2097152 /* Intersection */) {
+ return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
+ }
+ // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
+ // constraints of all non-primitive types in the source into a new intersection. We do this because the
+ // intersection may further constrain the constraints of the non-primitive types. For example, given a type
+ // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
+ // appear to be comparable to '2'.
+ if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
+ var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
+ if (constraints !== source.types) {
+ source = getIntersectionType(constraints);
+ if (!(source.flags & 2097152 /* Intersection */)) {
+ return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
+ }
+ }
+ }
+ // Check to see if any constituents of the intersection are immediately related to the target.
+ // Don't report errors though. Elaborating on whether a source constituent is related to the target is
+ // not actually useful and leads to some confusing error messages. Instead, we rely on the caller
+ // checking whether the full intersection viewed as an object is related to the target.
+ return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
+ }
function eachTypeRelatedToSomeType(source, target) {
var result = -1 /* True */;
var sourceTypes = source.types;
@@ -64082,8 +64079,11 @@ var ts;
}
}
if (reportErrors) {
+ // Elaborate only if we can find a best matching type in the target union
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
- isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], 2 /* Target */, /*reportErrors*/ true);
+ if (bestMatchingType) {
+ isRelatedTo(source, bestMatchingType, 2 /* Target */, /*reportErrors*/ true);
+ }
}
return 0 /* False */;
}
@@ -64219,7 +64219,7 @@ var ts;
if (overflow) {
return 0 /* False */;
}
- var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0);
+ var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 /* InPropertyCheck */ : 0);
var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false);
var entry = relation.get(id);
if (entry !== undefined) {
@@ -64287,6 +64287,7 @@ var ts;
return originalHandler(onlyUnreliable);
};
}
+ var result;
if (expandingFlags === 3 /* Both */) {
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "recursiveTypeRelatedTo_DepthLimit", {
sourceId: source.id,
@@ -64296,8 +64297,13 @@ var ts;
depth: sourceDepth,
targetDepth: targetDepth
});
+ result = 3 /* Maybe */;
+ }
+ else {
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
+ result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
}
- var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */;
if (outofbandVarianceMarkerHandler) {
outofbandVarianceMarkerHandler = originalHandler;
}
@@ -64329,98 +64335,97 @@ var ts;
return result;
}
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
- var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
- return result;
- }
- function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
if (intersectionState & 4 /* PropertyCheck */) {
return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */);
}
- if (intersectionState & 8 /* UnionIntersectionCheck */) {
- // Note that these checks are specifically ordered to produce correct results. In particular,
- // we need to deconstruct unions before intersections (because unions are always at the top),
- // and we need to handle "each" relations before "some" relations for the same kind of type.
- if (source.flags & 1048576 /* Union */) {
- return relation === comparableRelation ?
- someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */) :
- eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */);
- }
- if (target.flags & 1048576 /* Union */) {
- return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
- }
- if (target.flags & 2097152 /* Intersection */) {
- return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
- }
- // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
- // constraints of all non-primitive types in the source into a new intersection. We do this because the
- // intersection may further constrain the constraints of the non-primitive types. For example, given a type
- // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
- // appear to be comparable to '2'.
- if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
- var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
- if (constraints !== source.types) {
- source = getIntersectionType(constraints);
- if (!(source.flags & 2097152 /* Intersection */)) {
- return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
- }
+ var result;
+ var originalErrorInfo;
+ var varianceCheckFailed = false;
+ var saveErrorInfo = captureErrorCalculationState();
+ var sourceFlags = source.flags;
+ var targetFlags = target.flags;
+ if (relation === identityRelation) {
+ // We've already checked that source.flags and target.flags are identical
+ if (sourceFlags & 3145728 /* UnionOrIntersection */) {
+ var result_8 = eachTypeRelatedToSomeType(source, target);
+ if (result_8) {
+ result_8 &= eachTypeRelatedToSomeType(target, source);
}
+ return result_8;
}
- // Check to see if any constituents of the intersection are immediately related to the target.
- //
- // Don't report errors though. Checking whether a constituent is related to the source is not actually
- // useful and leads to some confusing error messages. Instead it is better to let the below checks
- // take care of this, or to not elaborate at all. For instance,
- //
- // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors.
- //
- // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection
- // than to report that 'D' is not assignable to 'A' or 'B'.
- //
- // - For a primitive type or type parameter (such as 'number = A & B') there is no point in
- // breaking the intersection apart.
- return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
- }
- var flags = source.flags & target.flags;
- if (relation === identityRelation && !(flags & 524288 /* Object */)) {
- if (flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
return isRelatedTo(source.type, target.type, 3 /* Both */, /*reportErrors*/ false);
}
- var result_8 = 0 /* False */;
- if (flags & 8388608 /* IndexedAccess */) {
- if (result_8 = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
+ if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
- if (flags & 16777216 /* Conditional */) {
+ if (sourceFlags & 16777216 /* Conditional */) {
if (source.root.isDistributive === target.root.isDistributive) {
- if (result_8 = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (result = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
}
}
}
- if (flags & 33554432 /* Substitution */) {
+ if (sourceFlags & 33554432 /* Substitution */) {
return isRelatedTo(source.substitute, target.substitute, 3 /* Both */, /*reportErrors*/ false);
}
- return 0 /* False */;
+ if (!(sourceFlags & 524288 /* Object */)) {
+ return 0 /* False */;
+ }
+ }
+ else if (sourceFlags & 3145728 /* UnionOrIntersection */ || targetFlags & 3145728 /* UnionOrIntersection */) {
+ if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
+ return result;
+ }
+ if (source.flags & 2097152 /* Intersection */ || source.flags & 262144 /* TypeParameter */ && target.flags & 1048576 /* Union */) {
+ // The combined constraint of an intersection type is the intersection of the constraints of
+ // the constituents. When an intersection type contains instantiable types with union type
+ // constraints, there are situations where we need to examine the combined constraint. One is
+ // when the target is a union type. Another is when the intersection contains types belonging
+ // to one of the disjoint domains. For example, given type variables T and U, each with the
+ // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
+ // we need to check this constraint against a union on the target side. Also, given a type
+ // variable V constrained to 'string | number', 'V & number' has a combined constraint of
+ // 'string & number | number & number' which reduces to just 'number'.
+ // This also handles type parameters, as a type parameter with a union constraint compared against a union
+ // needs to have its constraint hoisted into an intersection with said type parameter, this way
+ // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
+ // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
+ var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
+ if (constraint && everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
+ // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
+ if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
+ resetErrorInfo(saveErrorInfo);
+ return result;
+ }
+ }
+ }
+ // The ordered decomposition above doesn't handle all cases. Specifically, we also need to handle:
+ // Source is instantiable (e.g. source has union or intersection constraint).
+ // Source is an object, target is a union (e.g. { a, b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target is an object (e.g. { a } & { b } <=> { a, b }).
+ // Source is an intersection, target is a union (e.g. { a } & { b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target instantiable (e.g. string & { tag } <=> T["a"] constrained to string & { tag }).
+ if (!(sourceFlags & 465829888 /* Instantiable */ ||
+ sourceFlags & 524288 /* Object */ && targetFlags & 1048576 /* Union */ ||
+ sourceFlags & 2097152 /* Intersection */ && targetFlags & (524288 /* Object */ | 1048576 /* Union */ | 465829888 /* Instantiable */))) {
+ return 0 /* False */;
+ }
}
- var result;
- var originalErrorInfo;
- var varianceCheckFailed = false;
- var saveErrorInfo = captureErrorCalculationState();
// We limit alias variance probing to only object and conditional types since their alias behavior
// is more predictable than other, interned types, which may or may not have an alias depending on
// the order in which things were checked.
- if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
+ if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
var variances = getAliasVariances(source.aliasSymbol);
@@ -64438,7 +64443,7 @@ var ts;
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2 /* Target */))) {
return result;
}
- if (target.flags & 262144 /* TypeParameter */) {
+ if (targetFlags & 262144 /* TypeParameter */) {
// A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q].
if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3 /* Both */)) {
if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) {
@@ -64450,10 +64455,10 @@ var ts;
}
}
}
- else if (target.flags & 4194304 /* Index */) {
+ else if (targetFlags & 4194304 /* Index */) {
var targetType_1 = target.type;
// A keyof S is related to a keyof T if T is related to S.
- if (source.flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(targetType_1, source.type, 3 /* Both */, /*reportErrors*/ false)) {
return result;
}
@@ -64504,8 +64509,8 @@ var ts;
}
}
}
- else if (target.flags & 8388608 /* IndexedAccess */) {
- if (source.flags & 8388608 /* IndexedAccess */) {
+ else if (targetFlags & 8388608 /* IndexedAccess */) {
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
// Relate components directly before falling back to constraint relationships
// A type S[K] is related to a type T[J] if S is related to T and K is related to J.
if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, reportErrors)) {
@@ -64611,7 +64616,7 @@ var ts;
}
}
}
- else if (target.flags & 16777216 /* Conditional */) {
+ else if (targetFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
@@ -64636,8 +64641,8 @@ var ts;
}
}
}
- else if (target.flags & 134217728 /* TemplateLiteral */) {
- if (source.flags & 134217728 /* TemplateLiteral */) {
+ else if (targetFlags & 134217728 /* TemplateLiteral */) {
+ if (sourceFlags & 134217728 /* TemplateLiteral */) {
if (relation === comparableRelation) {
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 /* False */ : -1 /* True */;
}
@@ -64649,11 +64654,11 @@ var ts;
return -1 /* True */;
}
}
- if (source.flags & 8650752 /* TypeVariable */) {
- // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
- if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
+ if (sourceFlags & 8650752 /* TypeVariable */) {
+ // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
+ if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
var constraint = getConstraintOfType(source);
- if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
+ if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
// A type variable with no constraint is not related to the non-primitive object type.
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
resetErrorInfo(saveErrorInfo);
@@ -64666,7 +64671,7 @@ var ts;
return result;
}
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(target.flags & source.flags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
+ else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
resetErrorInfo(saveErrorInfo);
return result;
}
@@ -64683,14 +64688,14 @@ var ts;
}
}
}
- else if (source.flags & 4194304 /* Index */) {
+ else if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(keyofConstraintType, target, 1 /* Source */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
}
}
- else if (source.flags & 134217728 /* TemplateLiteral */ && !(target.flags & 524288 /* Object */)) {
- if (!(target.flags & 134217728 /* TemplateLiteral */)) {
+ else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
+ if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
var constraint = getBaseConstraintOfType(source);
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1 /* Source */, reportErrors))) {
resetErrorInfo(saveErrorInfo);
@@ -64698,8 +64703,8 @@ var ts;
}
}
}
- else if (source.flags & 268435456 /* StringMapping */) {
- if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
+ else if (sourceFlags & 268435456 /* StringMapping */) {
+ if (targetFlags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
@@ -64713,14 +64718,14 @@ var ts;
}
}
}
- else if (source.flags & 16777216 /* Conditional */) {
+ else if (sourceFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
resetErrorInfo(saveErrorInfo);
return 3 /* Maybe */;
}
- if (target.flags & 16777216 /* Conditional */) {
+ if (targetFlags & 16777216 /* Conditional */) {
// Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if
// one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2,
// and Y1 is related to Y2.
@@ -64780,9 +64785,10 @@ var ts;
}
return 0 /* False */;
}
- var sourceIsPrimitive = !!(source.flags & 131068 /* Primitive */);
+ var sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */);
if (relation !== identityRelation) {
source = getApparentType(source);
+ sourceFlags = source.flags;
}
else if (isGenericMappedType(source)) {
return 0 /* False */;
@@ -64824,7 +64830,7 @@ var ts;
// In a check of the form X = A & B, we will have previously checked if A relates to X or B relates
// to X. Failing both of those we want to check if the aggregation of A and B's members structurally
// relates to X. Thus, we include intersection types on the source side here.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 524288 /* Object */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
// Report structural errors only if we haven't reported any errors yet
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined, intersectionState);
@@ -64848,7 +64854,7 @@ var ts;
// there exists a constituent of T for every combination of the discriminants of S
// with respect to T. We do not report errors here, as we will use the existing
// error result from checking each constituent of the union.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 1048576 /* Union */) {
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
if (objectOnlyTarget.flags & 1048576 /* Union */) {
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
@@ -65363,7 +65369,6 @@ var ts;
}
}
var result = -1 /* True */;
- var saveErrorInfo = captureErrorCalculationState();
var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
var sourceObjectFlags = ts.getObjectFlags(source);
var targetObjectFlags = ts.getObjectFlags(target);
@@ -65404,6 +65409,7 @@ var ts;
else {
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
var t = targetSignatures_1[_i];
+ var saveErrorInfo = captureErrorCalculationState();
// Only elaborate errors from the first failure
var shouldElaborateErrors = reportErrors;
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
@@ -65777,7 +65783,7 @@ var ts;
var constraintMarker = "";
var sourceId = getTypeReferenceId(source, 0);
var targetId = getTypeReferenceId(target, 0);
- return "" + constraintMarker + sourceId + "," + targetId + postFix;
+ return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
// getTypeReferenceId(A) returns "111=0-12=1"
// where A.id=111 and number.id=12
function getTypeReferenceId(type, depth) {
@@ -65821,7 +65827,7 @@ var ts;
var postFix = intersectionState ? ":" + intersectionState : "";
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
- source.id + "," + target.id + postFix;
+ "".concat(source.id, ",").concat(target.id).concat(postFix);
}
// Invoke the callback for each underlying property symbol of the given symbol and return the first
// value that isn't undefined.
@@ -67948,11 +67954,11 @@ var ts;
case 79 /* Identifier */:
if (!ts.isThisInTypeQuery(node)) {
var symbol = getResolvedSymbol(node);
- return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
+ return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
}
// falls through
case 108 /* ThisKeyword */:
- return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
+ return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
case 229 /* NonNullExpression */:
case 211 /* ParenthesizedExpression */:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
@@ -68574,9 +68580,6 @@ var ts;
getUnionType(ts.map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) :
mapType(type, mapper);
}
- function getConstituentCount(type) {
- return type.flags & 1048576 /* Union */ ? type.types.length : 1;
- }
function extractTypesOfKind(type, kind) {
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
}
@@ -70150,7 +70153,7 @@ var ts;
var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
+ return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
}
function isExportOrExportExpression(location) {
return !!ts.findAncestor(location, function (n) {
@@ -71841,7 +71844,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -76242,21 +76245,22 @@ var ts;
if (links.type === unknownType) {
links.type = getTypeFromBindingPattern(declaration.name);
}
- assignBindingElementTypes(declaration.name);
+ assignBindingElementTypes(declaration.name, links.type);
}
}
}
// When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push
// the destructured type into the contained binding elements.
- function assignBindingElementTypes(pattern) {
+ function assignBindingElementTypes(pattern, parentType) {
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
+ var type = getBindingElementTypeFromParentType(element, parentType);
if (element.name.kind === 79 /* Identifier */) {
- getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
+ getSymbolLinks(getSymbolOfNode(element)).type = type;
}
else {
- assignBindingElementTypes(element.name);
+ assignBindingElementTypes(element.name, type);
}
}
}
@@ -79997,28 +80001,24 @@ var ts;
if (returnType.flags & 1 /* Any */) {
return;
}
+ var headMessage;
var expectedReturnType;
- var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
- var errorInfo;
switch (node.parent.kind) {
case 256 /* ClassDeclaration */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 163 /* Parameter */:
- expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
- break;
case 166 /* PropertyDeclaration */:
+ case 163 /* Parameter */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
case 168 /* MethodDeclaration */:
case 171 /* GetAccessor */:
case 172 /* SetAccessor */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -80026,7 +80026,7 @@ var ts;
default:
return ts.Debug.fail();
}
- checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; });
+ checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
}
/**
* If a TypeNode can be resolved to a value symbol imported from an external module, it is
@@ -81708,7 +81708,7 @@ var ts;
function getPropertyNameForKnownSymbolName(symbolName) {
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
- return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
+ return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
}
/**
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
@@ -82299,9 +82299,9 @@ var ts;
var containsArguments = containsArgumentsReference(node);
if (containsArguments) {
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
- if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
+ if (isJs && lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
- errorOrSuggestion(isJs, lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
+ error(lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
}
}
else {
@@ -82311,7 +82311,9 @@ var ts;
return;
}
if (ts.isQualifiedName(name)) {
- errorOrSuggestion(isJs, name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ if (isJs) {
+ error(name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ }
}
else {
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
@@ -87490,29 +87492,28 @@ var ts;
}
function findMostOverlappyType(source, unionTarget) {
var bestMatch;
- var matchingCount = 0;
- for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
- var target = _a[_i];
- var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
- if (overlap.flags & 4194304 /* Index */) {
- // perfect overlap of keys
- bestMatch = target;
- matchingCount = Infinity;
- }
- else if (overlap.flags & 1048576 /* Union */) {
- // We only want to account for literal types otherwise.
- // If we have a union of index types, it seems likely that we
- // needed to elaborate between two generic mapped types anyway.
- var len = ts.length(ts.filter(overlap.types, isUnitType));
- if (len >= matchingCount) {
- bestMatch = target;
- matchingCount = len;
+ if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var matchingCount = 0;
+ for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
+ var target = _a[_i];
+ if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
+ if (overlap.flags & 4194304 /* Index */) {
+ // perfect overlap of keys
+ return target;
+ }
+ else if (isUnitType(overlap) || overlap.flags & 1048576 /* Union */) {
+ // We only want to account for literal types otherwise.
+ // If we have a union of index types, it seems likely that we
+ // needed to elaborate between two generic mapped types anyway.
+ var len = overlap.flags & 1048576 /* Union */ ? ts.countWhere(overlap.types, isUnitType) : 1;
+ if (len >= matchingCount) {
+ bestMatch = target;
+ matchingCount = len;
+ }
+ }
}
}
- else if (isUnitType(overlap) && 1 >= matchingCount) {
- bestMatch = target;
- matchingCount = 1;
- }
}
return bestMatch;
}
@@ -88760,7 +88761,7 @@ var ts;
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
value === 62 ? 43 /* plus */ :
value === 63 ? 47 /* slash */ :
- ts.Debug.fail(value + ": not a base64 value");
+ ts.Debug.fail("".concat(value, ": not a base64 value"));
}
function base64FormatDecode(ch) {
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
@@ -88835,7 +88836,7 @@ var ts;
var mappings = ts.arrayFrom(decoder, processMapping);
if (decoder.error !== undefined) {
if (host.log) {
- host.log("Encountered error while decoding sourcemap: " + decoder.error);
+ host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
}
decodedMappings = ts.emptyArray;
}
@@ -92510,7 +92511,7 @@ var ts;
var propertyName = ts.isPropertyAccessExpression(originalNode)
? ts.declarationNameToString(originalNode.name)
: ts.getTextOfNode(originalNode.argumentExpression);
- ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
+ ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
}
return substitute;
}
@@ -93986,8 +93987,8 @@ var ts;
}
function createHoistedVariableForClass(name, node) {
var className = getPrivateIdentifierEnvironment().className;
- var prefix = className ? "_" + className : "";
- var identifier = factory.createUniqueName(prefix + "_" + name, 16 /* Optimistic */);
+ var prefix = className ? "_".concat(className) : "";
+ var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
addBlockScopedVariable(identifier);
}
@@ -95992,7 +95993,7 @@ var ts;
specifierSourceImports = new ts.Map();
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
}
- var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
+ var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
generatedName.generatedImportReference = specifier;
specifierSourceImports.set(name, specifier);
@@ -97140,11 +97141,11 @@ var ts;
}
else {
if (node.kind === 245 /* BreakStatement */) {
- labelMarker = "break-" + label.escapedText;
+ labelMarker = "break-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
}
else {
- labelMarker = "continue-" + label.escapedText;
+ labelMarker = "continue-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
}
}
@@ -106001,7 +106002,7 @@ var ts;
return getTypeAliasDeclarationVisibilityError;
}
else {
- return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
+ return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
@@ -106212,7 +106213,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
- return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
+ return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
}
}
function getTypeParameterConstraintVisibilityError() {
@@ -106970,7 +106971,7 @@ var ts;
while (ts.length(lateMarkedStatements)) {
var i = lateMarkedStatements.shift();
if (!ts.isLateVisibilityPaintedStatement(i)) {
- return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
+ 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));
}
var priorNeedsDeclare = needsDeclare;
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
@@ -107159,7 +107160,7 @@ var ts;
return cleanup(input);
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));
}
- default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
+ default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
}
}
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
@@ -107450,7 +107451,7 @@ var ts;
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
// We must add a temporary declaration for the extends clause expression
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
- var newId_1 = factory.createUniqueName(oldId + "_base", 16 /* Optimistic */);
+ var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
getSymbolAccessibilityDiagnostic = function () { return ({
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
errorNode: extendsClause_1,
@@ -107491,7 +107492,7 @@ var ts;
}
}
// Anything left unhandled is an error, so this should be unreachable
- return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
+ return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
function cleanup(node) {
if (isEnclosingDeclaration(input)) {
enclosingDeclaration = previousEnclosingDeclaration;
@@ -108383,13 +108384,13 @@ var ts;
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
return;
if (js && configFile.options.sourceMap) {
- addOutput(js + ".map");
+ addOutput("".concat(js, ".map"));
}
if (ts.getEmitDeclarations(configFile.options)) {
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
addOutput(dts);
if (configFile.options.declarationMap) {
- addOutput(dts + ".map");
+ addOutput("".concat(dts, ".map"));
}
}
}
@@ -108458,7 +108459,7 @@ var ts;
function getFirstProjectOutput(configFile, ignoreCase) {
if (ts.outFile(configFile.options)) {
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
- return ts.Debug.checkDefined(jsFilePath, "project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
@@ -108477,7 +108478,7 @@ var ts;
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
if (buildInfoPath)
return buildInfoPath;
- return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
ts.getFirstProjectOutput = getFirstProjectOutput;
/*@internal*/
@@ -108703,7 +108704,7 @@ var ts;
if (sourceMappingURL) {
if (!writer.isAtStartOfLine())
writer.rawWrite(newLine);
- writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Tools can sometimes see this line as a source mapping url comment
+ writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
}
// Write the source map
if (sourceMapFilePath) {
@@ -108752,7 +108753,7 @@ var ts;
// Encode the sourceMap into the sourceMap url
var sourceMapText = sourceMapGenerator.toString();
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
- return "data:application/json;base64," + base64SourceMapText;
+ return "data:application/json;base64,".concat(base64SourceMapText);
}
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
if (mapOptions.mapRoot) {
@@ -108932,7 +108933,7 @@ var ts;
return;
break;
default:
- ts.Debug.fail("Unexpected path: " + name);
+ ts.Debug.fail("Unexpected path: ".concat(name));
}
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
},
@@ -109792,7 +109793,7 @@ var ts;
return writeTokenNode(node, writeKeyword);
if (ts.isTokenKind(node.kind))
return writeTokenNode(node, writePunctuation);
- ts.Debug.fail("Unhandled SyntaxKind: " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
}
function emitMappedTypeParameter(node) {
emit(node.name);
@@ -109962,16 +109963,16 @@ var ts;
}
}
function emitPlaceholder(hint, node, snippet) {
- nonEscapingWrite("${" + snippet.order + ":"); // `${2:`
+ nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
nonEscapingWrite("}"); // `}`
// `${2:...}`
}
function emitTabStop(hint, node, snippet) {
// A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
- ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
- nonEscapingWrite("$" + snippet.order);
+ nonEscapingWrite("$".concat(snippet.order));
}
//
// Identifiers
@@ -111733,17 +111734,17 @@ var ts;
writeLine();
}
if (currentSourceFile && currentSourceFile.moduleName) {
- writeComment("/// ");
+ writeComment("/// "));
writeLine();
}
if (currentSourceFile && currentSourceFile.amdDependencies) {
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
var dep = _b[_a];
if (dep.name) {
- writeComment("/// ");
+ writeComment("/// "));
}
else {
- writeComment("/// ");
+ writeComment("/// "));
}
writeLine();
}
@@ -111751,7 +111752,7 @@ var ts;
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
var directive = files_2[_c];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
writeLine();
@@ -111759,7 +111760,7 @@ var ts;
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
var directive = types_24[_d];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
writeLine();
@@ -111767,7 +111768,7 @@ var ts;
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
var directive = libs_1[_e];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
writeLine();
@@ -112547,9 +112548,9 @@ var ts;
var textSourceNode = node.textSourceNode;
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
- return jsxAttributeEscape ? "\"" + ts.escapeJsxAttributeString(text) + "\"" :
- neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"" + ts.escapeString(text) + "\"" :
- "\"" + ts.escapeNonAsciiString(text) + "\"";
+ return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
+ neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
+ "\"".concat(ts.escapeNonAsciiString(text), "\"");
}
else {
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
@@ -113026,8 +113027,8 @@ var ts;
}
function formatSynthesizedComment(comment) {
return comment.kind === 3 /* MultiLineCommentTrivia */
- ? "/*" + comment.text + "*/"
- : "//" + comment.text;
+ ? "/*".concat(comment.text, "*/")
+ : "//".concat(comment.text);
}
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
enterComment();
@@ -113748,7 +113749,7 @@ var ts;
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;
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
if (!newPath) {
- writeLog("Project: " + configFileName + " Detected ignored path: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
return true;
}
fileOrDirectoryPath = newPath;
@@ -113757,11 +113758,11 @@ var ts;
// If the the added or created file or directory is not supported file name, ignore the file
// But when watched directory is added/removed, we need to reload the file list
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
- writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
return true;
}
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
- writeLog("Project: " + configFileName + " Detected excluded file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
return true;
}
if (!program)
@@ -113785,7 +113786,7 @@ var ts;
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
- writeLog("Project: " + configFileName + " Detected output file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
return true;
}
return false;
@@ -113853,36 +113854,36 @@ var ts;
host.useCaseSensitiveFileNames();
}
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
- log("ExcludeWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
return {
- close: function () { return log("ExcludeWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }
+ close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
};
}
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- log("FileWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
return {
close: function () {
- log("FileWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
watcher.close();
}
};
}
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- var watchInfo = "DirectoryWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
return {
close: function () {
- var watchInfo = "DirectoryWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
watcher.close();
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
}
};
}
@@ -113892,16 +113893,16 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
- var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher") + ":: Triggered with " + args[0] + " " + (args[1] !== undefined ? args[1] : "") + ":: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ 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));
log(triggerredInfo);
var start = ts.timestamp();
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + triggerredInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
}, flags, options, detailInfo1, detailInfo2); };
}
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
- return "WatchInfo: " + file + " " + flags + " " + JSON.stringify(options) + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2);
+ return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
}
}
ts.getWatchFactory = getWatchFactory;
@@ -114208,12 +114209,12 @@ var ts;
}
ts.formatDiagnostics = formatDiagnostics;
function formatDiagnostic(diagnostic, host) {
- var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();
+ var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
if (diagnostic.file) {
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
var fileName = diagnostic.file.fileName;
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
- return relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): " + errorMessage;
+ return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
}
return errorMessage;
}
@@ -114301,9 +114302,9 @@ var ts;
var output = "";
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
output += ":";
- output += color("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
output += ":";
- output += color("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
return output;
}
ts.formatLocation = formatLocation;
@@ -114317,7 +114318,7 @@ var ts;
output += " - ";
}
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
- output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
+ output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
if (diagnostic.file) {
output += host.getNewLine();
@@ -114426,7 +114427,7 @@ var ts;
var result = void 0;
var mode = getModeForResolutionAtIndex(containingFile, i);
i++;
- var cacheKey = mode !== undefined ? mode + "|" + name : name;
+ var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
if (cache.has(cacheKey)) {
result = cache.get(cacheKey);
}
@@ -116615,7 +116616,7 @@ var ts;
path += (i === 2 ? "/" : "-") + components[i];
i++;
}
- var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
+ var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
return localOverrideModuleResult.resolvedModule.resolvedFileName;
@@ -117436,12 +117437,12 @@ var ts;
}
function directoryExistsIfProjectReferenceDeclDir(dir) {
var dirPath = host.toPath(dir);
- var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
+ var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
// Any parent directory of declaration dir
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
// Any directory inside declaration dir
- ts.startsWith(dirPath, declDirPath + "/"); });
+ ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
}
function handleDirectoryCouldBeSymlink(directory) {
var _a;
@@ -117494,7 +117495,7 @@ var ts;
if (isFile && result) {
// Store the real path for the file'
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
- symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), ""));
+ symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
}
return result;
}) || false;
@@ -117952,7 +117953,7 @@ var ts;
/*forceDtsEmit*/ true);
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
if (firstDts_1) {
- 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: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
+ 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; }))); });
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
if (exportedModulesMapCache && latestSignature !== prevSignature) {
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
@@ -118460,7 +118461,7 @@ var ts;
return;
}
else {
- 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: " + affectedFile.fileName);
+ 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));
}
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
@@ -119605,7 +119606,7 @@ var ts;
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
- ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: " + failedLookupLocation + " failedLookupLocationPath: " + failedLookupLocationPath);
+ ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
if (failedLookupPathSplit.length > rootSplitLength + 1) {
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
return {
@@ -120687,7 +120688,7 @@ var ts;
}
function getJSExtensionForFile(fileName, options) {
var _a;
- return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension " + ts.extensionFromPath(fileName) + " is unsupported:: FileName:: " + fileName);
+ return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
}
function tryGetJSExtensionForFile(fileName, options) {
var ext = ts.tryGetExtensionFromPath(fileName);
@@ -120790,8 +120791,8 @@ var ts;
return pretty ?
function (diagnostic, newLine, options) {
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
- var output = "[" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);
+ var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
system.write(output);
} :
function (diagnostic, newLine, options) {
@@ -120799,8 +120800,8 @@ var ts;
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
output += newLine;
}
- output += getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);
+ output += "".concat(getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
system.write(output);
};
}
@@ -120823,7 +120824,7 @@ var ts;
.map(function (errorDiagnostic) {
if (errorDiagnostic.file === undefined)
return;
- return "" + errorDiagnostic.file.fileName;
+ return "".concat(errorDiagnostic.file.fileName);
});
return filesInError.map(function (fileName) {
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
@@ -120856,7 +120857,7 @@ var ts;
if (errorCount === 0)
return "";
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
- var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return "".concat(fileInError.fileName, ":").concat(fileInError.line); })
.filter(function (value, index, self) { return self.indexOf(value) === index; });
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
var d = errorCount === 1 ?
@@ -120869,7 +120870,7 @@ var ts;
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
+ return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix);
}
ts.getErrorSummaryText = getErrorSummaryText;
function createTabularErrorsDisplay(filesInError, host) {
@@ -120892,7 +120893,7 @@ var ts;
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
: "";
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
- tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
+ tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n");
});
return tabularData;
}
@@ -120919,9 +120920,9 @@ var ts;
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
var file = _c[_i];
- write("" + toFileName(file, relativeFileName));
- (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" " + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });
- (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" " + d.messageText); });
+ write("".concat(toFileName(file, relativeFileName)));
+ (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
+ (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
}
}
ts.explainFiles = explainFiles;
@@ -120961,7 +120962,7 @@ var ts;
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
return false;
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
- return !!pattern && ts.getRegexFromPattern("(" + pattern + ")$", useCaseSensitiveFileNames).test(fileName);
+ return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
});
}
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
@@ -120970,7 +120971,7 @@ var ts;
var options = program.getCompilerOptions();
if (ts.isReferencedFile(reason)) {
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
- var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"" + referenceLocation.text + "\"";
+ var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
var message = void 0;
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
switch (reason.kind) {
@@ -121094,7 +121095,7 @@ var ts;
var currentDir_1 = program.getCurrentDirectory();
ts.forEach(emittedFiles, function (file) {
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
- write("TSFILE: " + filepath);
+ write("TSFILE: ".concat(filepath));
});
listFiles(program, write);
}
@@ -121423,7 +121424,7 @@ var ts;
}
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
- writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames);
+ writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
var configFileWatcher;
if (configFileName) {
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
@@ -121579,10 +121580,10 @@ var ts;
function createNewProgram(hasInvalidatedResolution) {
// Compile the program
writeLog("CreatingProgramWith::");
- writeLog(" roots: " + JSON.stringify(rootFileNames));
- writeLog(" options: " + JSON.stringify(compilerOptions));
+ writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
+ writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
if (projectReferences)
- writeLog(" projectReferences: " + JSON.stringify(projectReferences));
+ writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
hasChangedCompilerOptions = false;
hasChangedConfigFileParsingErrors = false;
@@ -121743,7 +121744,7 @@ var ts;
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
}
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
- writeLog("Scheduling invalidateFailedLookup" + (pending ? ", Cancelled earlier one" : ""));
+ writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
}
function invalidateResolutionsOfFailedLookup() {
@@ -121803,7 +121804,7 @@ var ts;
synchronizeProgram();
}
function reloadConfigFile() {
- writeLog("Reloading config file: " + configFileName);
+ writeLog("Reloading config file: ".concat(configFileName));
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
if (cachedDirectoryStructureHost) {
cachedDirectoryStructureHost.clearCache();
@@ -121844,7 +121845,7 @@ var ts;
return config.parsedCommandLine;
}
}
- writeLog("Loading config file: " + configFileName);
+ writeLog("Loading config file: ".concat(configFileName));
var parsedCommandLine = host.getParsedCommandLine ?
host.getParsedCommandLine(configFileName) :
getParsedCommandLineFromConfigFileHost(configFileName);
@@ -122148,8 +122149,8 @@ var ts;
*/
function createBuilderStatusReporter(system, pretty) {
return function (diagnostic) {
- var output = pretty ? "[" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] " : ts.getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);
+ var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
system.write(output);
};
}
@@ -122924,7 +122925,7 @@ var ts;
function listEmittedFile(_a, proj, file) {
var write = _a.write;
if (write && proj.options.listEmittedFiles) {
- write("TSFILE: " + file);
+ write("TSFILE: ".concat(file));
}
}
function getOldProgram(_a, proj, parsed) {
@@ -122953,7 +122954,7 @@ var ts;
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
reportAndStoreErrors(state, resolvedPath, diagnostics);
- state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
+ state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
if (canEmitBuildInfo)
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
afterProgramDone(state, program, config);
@@ -122981,7 +122982,7 @@ var ts;
if (!host.fileExists(inputFile)) {
return {
type: ts.UpToDateStatusType.Unbuildable,
- reason: inputFile + " does not exist"
+ reason: "".concat(inputFile, " does not exist")
};
}
if (!force) {
@@ -123340,7 +123341,7 @@ var ts;
}
}
if (filesToDelete) {
- reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ 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(""));
}
return ts.ExitStatus.Success;
}
@@ -123678,7 +123679,7 @@ var ts;
function nowString() {
// E.g. "12:34:56.789"
var d = new Date();
- return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0");
+ 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"));
}
server.nowString = nowString;
})(server = ts.server || (ts.server = {}));
@@ -123689,7 +123690,7 @@ var ts;
var JsTyping;
(function (JsTyping) {
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
- var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest"));
+ var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
return availableVersion.compareTo(cachedTyping.version) <= 0;
}
JsTyping.isTypingUpToDate = isTypingUpToDate;
@@ -123742,7 +123743,7 @@ var ts;
"worker_threads",
"zlib"
];
- JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:" + name; });
+ JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
function nonRelativeModuleNameForTypingCache(moduleName) {
@@ -123815,7 +123816,7 @@ var ts;
var excludeTypingName = exclude_1[_i];
var didDelete = inferredTypings.delete(excludeTypingName);
if (didDelete && log)
- log("Typing for " + excludeTypingName + " is in exclude list, will be ignored.");
+ log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
}
var newTypingNames = [];
var cachedTypingPaths = [];
@@ -123829,7 +123830,7 @@ var ts;
});
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
if (log)
- log("Result: " + JSON.stringify(result));
+ log("Result: ".concat(JSON.stringify(result)));
return result;
function addInferredTyping(typingName) {
if (!inferredTypings.has(typingName)) {
@@ -123838,7 +123839,7 @@ var ts;
}
function addInferredTypings(typingNames, message) {
if (log)
- log(message + ": " + JSON.stringify(typingNames));
+ log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
ts.forEach(typingNames, addInferredTyping);
}
/**
@@ -123860,7 +123861,7 @@ var ts;
filesToWatch.push(manifestPath);
manifest = ts.readConfigFile(manifestPath, function (path) { return host.readFile(path); }).config;
manifestTypingNames = ts.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts.getOwnKeys);
- addInferredTypings(manifestTypingNames, "Typing names in '" + manifestPath + "' dependencies");
+ addInferredTypings(manifestTypingNames, "Typing names in '".concat(manifestPath, "' dependencies"));
}
// Now we scan the directories for typing information in
// already-installed dependencies (if present). Note that this
@@ -123904,7 +123905,7 @@ var ts;
!isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; // `node_modules/foo`
});
if (log)
- log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(dependencyManifestNames));
+ log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(dependencyManifestNames)));
// Once we have the names of things to look up, we iterate over
// and either collect their included typings, or add them to the
// list of typings we need to look up separately.
@@ -123923,12 +123924,12 @@ var ts;
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
if (host.fileExists(absolutePath)) {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types."));
inferredTypings.set(manifest_1.name, absolutePath);
}
else {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types but they are missing.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types but they are missing."));
}
}
else {
@@ -124024,15 +124025,15 @@ var ts;
var kind = isScopeName ? "Scope" : "Package";
switch (result) {
case 1 /* EmptyName */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot be empty";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
case 2 /* NameTooLong */:
- return "'" + typing + "':: " + kind + " name '" + name + "' should be less than " + maxPackageNameLength + " characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
case 3 /* NameStartsWithDot */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '.'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
case 4 /* NameStartsWithUnderscore */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '_'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
case 5 /* NameContainsNonURISafeCharacters */:
- return "'" + typing + "':: " + kind + " name '" + name + "' contains non URI safe characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
case 0 /* Ok */:
return ts.Debug.fail(); // Shouldn't have called this.
default:
@@ -126587,7 +126588,7 @@ var ts;
var prefix = ts.isJSDocLink(link) ? "link"
: ts.isJSDocLinkCode(link) ? "linkcode"
: "linkplain";
- var parts = [linkPart("{@" + prefix + " ")];
+ var parts = [linkPart("{@".concat(prefix, " "))];
if (!link.name) {
if (link.text)
parts.push(linkTextPart(link.text));
@@ -126835,7 +126836,7 @@ var ts;
function getUniqueName(baseName, sourceFile) {
var nameText = baseName;
for (var i = 1; !ts.isFileLevelUniqueName(sourceFile, nameText); i++) {
- nameText = baseName + "_" + i;
+ nameText = "".concat(baseName, "_").concat(i);
}
return nameText;
}
@@ -126945,7 +126946,7 @@ var ts;
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
var quotePreference = getQuotePreference(sourceFile, preferences);
var quoted = JSON.stringify(text);
- return quotePreference === 0 /* Single */ ? "'" + ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"') + "'" : quoted;
+ return quotePreference === 0 /* Single */ ? "'".concat(ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"'), "'") : quoted;
}
ts.quote = quote;
function isEqualityOperatorKind(kind) {
@@ -127329,7 +127330,7 @@ var ts;
var components = ts.getPathComponents(ts.getPackageNameFromTypesPackageName(fullSpecifier)).slice(1);
// Scoped packages
if (ts.startsWith(components[0], "@")) {
- return components[0] + "/" + components[1];
+ return "".concat(components[0], "/").concat(components[1]);
}
return components[0];
}
@@ -127456,13 +127457,13 @@ var ts;
}
function getSymbolParentOrFail(symbol) {
var _a;
- return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: " + ts.Debug.formatSymbolFlags(symbol.flags) + ". " +
- ("Declarations: " + ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
+ return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: ".concat(ts.Debug.formatSymbolFlags(symbol.flags), ". ") +
+ "Declarations: ".concat((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
var kind = ts.Debug.formatSyntaxKind(d.kind);
var inJS = ts.isInJSFile(d);
var expression = d.expression;
- return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: " + ts.Debug.formatSyntaxKind(expression.kind) + ")" : "");
- }).join(", ")) + "."));
+ return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: ".concat(ts.Debug.formatSyntaxKind(expression.kind), ")") : "");
+ }).join(", "), "."));
}
/**
* Useful to check whether a string contains another string at a specific index
@@ -127723,7 +127724,7 @@ var ts;
: checker.tryFindAmbientModule(info.moduleName));
var symbol = info.symbol || cachedSymbol || ts.Debug.checkDefined(exportKind === 2 /* ExportEquals */
? checker.resolveExternalModuleSymbol(moduleSymbol)
- : checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '" + info.symbolName + "' by key '" + info.symbolTableKey + "' in module " + moduleSymbol.name);
+ : checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '".concat(info.symbolName, "' by key '").concat(info.symbolTableKey, "' in module ").concat(moduleSymbol.name));
symbols.set(id, [symbol, moduleSymbol]);
return {
symbol: symbol,
@@ -127736,7 +127737,7 @@ var ts;
}
function key(importedName, symbol, ambientModuleName, checker) {
var moduleKey = ambientModuleName || "";
- return importedName + "|" + ts.getSymbolId(ts.skipAlias(symbol, checker)) + "|" + moduleKey;
+ return "".concat(importedName, "|").concat(ts.getSymbolId(ts.skipAlias(symbol, checker)), "|").concat(moduleKey);
}
function parseKey(key) {
var symbolName = key.substring(0, key.indexOf("|"));
@@ -127822,7 +127823,7 @@ var ts;
if (autoImportProvider) {
var start = ts.timestamp();
forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), function (module, file) { return cb(module, file, autoImportProvider, /*isFromPackageJson*/ true); });
- (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: " + (ts.timestamp() - start));
+ (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: ".concat(ts.timestamp() - start));
}
}
ts.forEachExternalModuleToImportFrom = forEachExternalModuleToImportFrom;
@@ -127875,7 +127876,7 @@ var ts;
}
});
});
- (_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in " + (ts.timestamp() - start) + " ms");
+ (_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in ".concat(ts.timestamp() - start, " ms"));
return cache;
}
ts.getExportInfoMap = getExportInfoMap;
@@ -128408,7 +128409,7 @@ var ts;
return { spans: spans, endOfLineState: 0 /* None */ };
function pushClassification(start, end, type) {
var length = end - start;
- ts.Debug.assert(length > 0, "Classification had non-positive length of " + length);
+ ts.Debug.assert(length > 0, "Classification had non-positive length of ".concat(length));
spans.push(start);
spans.push(length);
spans.push(type);
@@ -129280,7 +129281,7 @@ var ts;
case ".d.cts" /* Dcts */: return ".d.cts" /* dctsModifier */;
case ".cjs" /* Cjs */: return ".cjs" /* cjsModifier */;
case ".cts" /* Cts */: return ".cts" /* ctsModifier */;
- case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension " + ".tsbuildinfo" /* TsBuildInfo */ + " is unsupported.");
+ case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension ".concat(".tsbuildinfo" /* TsBuildInfo */, " is unsupported."));
case undefined: return "" /* none */;
default:
return ts.Debug.assertNever(extension);
@@ -130016,10 +130017,10 @@ var ts;
var resolvedFromCacheCount = 0;
var cacheAttemptCount = 0;
var result = cb({ tryResolve: tryResolve, resolutionLimitExceeded: function () { return resolutionLimitExceeded; } });
- var hitRateMessage = cacheAttemptCount ? " (" + (resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1) + "% hit rate)" : "";
- (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, logPrefix + ": resolved " + resolvedCount + " module specifiers, plus " + ambientCount + " ambient and " + resolvedFromCacheCount + " from cache" + hitRateMessage);
- (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, logPrefix + ": response is " + (resolutionLimitExceeded ? "incomplete" : "complete"));
- (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, logPrefix + ": " + (ts.timestamp() - start));
+ var hitRateMessage = cacheAttemptCount ? " (".concat((resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1), "% hit rate)") : "";
+ (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, "".concat(logPrefix, ": resolved ").concat(resolvedCount, " module specifiers, plus ").concat(ambientCount, " ambient and ").concat(resolvedFromCacheCount, " from cache").concat(hitRateMessage));
+ (_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "".concat(logPrefix, ": response is ").concat(resolutionLimitExceeded ? "incomplete" : "complete"));
+ (_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, "".concat(logPrefix, ": ").concat(ts.timestamp() - start));
return result;
function tryResolve(exportInfo, isFromAmbientModule) {
if (isFromAmbientModule) {
@@ -130352,15 +130353,15 @@ var ts;
var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess;
if (origin && originIsThisType(origin)) {
insertText = needsConvertPropertyAccess
- ? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(sourceFile, preferences, name) + "]"
- : "this" + (insertQuestionDot ? "?." : ".") + name;
+ ? "this".concat(insertQuestionDot ? "?." : "", "[").concat(quotePropertyName(sourceFile, preferences, name), "]")
+ : "this".concat(insertQuestionDot ? "?." : ".").concat(name);
}
// We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790.
// Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro.
else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) {
- insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(sourceFile, preferences, name) + "]" : "[" + name + "]" : name;
+ insertText = useBraces ? needsConvertPropertyAccess ? "[".concat(quotePropertyName(sourceFile, preferences, name), "]") : "[".concat(name, "]") : name;
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
- insertText = "?." + insertText;
+ insertText = "?.".concat(insertText);
}
var dot = ts.findChildOfKind(propertyAccessToConvert, 24 /* DotToken */, sourceFile) ||
ts.findChildOfKind(propertyAccessToConvert, 28 /* QuestionDotToken */, sourceFile);
@@ -130374,7 +130375,7 @@ var ts;
if (isJsxInitializer) {
if (insertText === undefined)
insertText = name;
- insertText = "{" + insertText + "}";
+ insertText = "{".concat(insertText, "}");
if (typeof isJsxInitializer !== "boolean") {
replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile);
}
@@ -130387,8 +130388,8 @@ var ts;
if (precedingToken && ts.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) {
awaitText = ";";
}
- awaitText += "(await " + propertyAccessToConvert.expression.getText() + ")";
- insertText = needsConvertPropertyAccess ? "" + awaitText + insertText : "" + awaitText + (insertQuestionDot ? "?." : ".") + insertText;
+ awaitText += "(await ".concat(propertyAccessToConvert.expression.getText(), ")");
+ insertText = needsConvertPropertyAccess ? "".concat(awaitText).concat(insertText) : "".concat(awaitText).concat(insertQuestionDot ? "?." : ".").concat(insertText);
replacementSpan = ts.createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end);
}
if (originIsResolvedExport(origin)) {
@@ -130421,7 +130422,7 @@ var ts;
&& !(type.flags & 1048576 /* Union */ && ts.find(type.types, function (type) { return !!(type.flags & 528 /* BooleanLike */); }))) {
if (type.flags & 402653316 /* StringLike */ || (type.flags & 1048576 /* Union */ && ts.every(type.types, function (type) { return !!(type.flags & (402653316 /* StringLike */ | 32768 /* Undefined */)); }))) {
// If is string like or undefined use quotes
- insertText = ts.escapeSnippetText(name) + "=" + ts.quote(sourceFile, preferences, "$1");
+ insertText = "".concat(ts.escapeSnippetText(name), "=").concat(ts.quote(sourceFile, preferences, "$1"));
isSnippet = true;
}
else {
@@ -130430,7 +130431,7 @@ var ts;
}
}
if (useBraces_1) {
- insertText = ts.escapeSnippetText(name) + "={$1}";
+ insertText = "".concat(ts.escapeSnippetText(name), "={$1}");
isSnippet = true;
}
}
@@ -130715,14 +130716,14 @@ var ts;
var importKind = ts.codefix.getImportKind(sourceFile, exportKind, options, /*forceImportKeyword*/ true);
var isTopLevelTypeOnly = ((_b = (_a = ts.tryCast(importCompletionNode, ts.isImportDeclaration)) === null || _a === void 0 ? void 0 : _a.importClause) === null || _b === void 0 ? void 0 : _b.isTypeOnly) || ((_c = ts.tryCast(importCompletionNode, ts.isImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.isTypeOnly);
var isImportSpecifierTypeOnly = couldBeTypeOnlyImportSpecifier(importCompletionNode, contextToken);
- var topLevelTypeOnlyText = isTopLevelTypeOnly ? " " + ts.tokenToString(151 /* TypeKeyword */) + " " : " ";
- var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? ts.tokenToString(151 /* TypeKeyword */) + " " : "";
+ var topLevelTypeOnlyText = isTopLevelTypeOnly ? " ".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : " ";
+ var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? "".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : "";
var suffix = useSemicolons ? ";" : "";
switch (importKind) {
- case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " = require(" + quotedModuleSpecifier + ")" + suffix };
- case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " from " + quotedModuleSpecifier + suffix };
- case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "* as " + ts.escapeSnippetText(name) + " from " + quotedModuleSpecifier + suffix };
- case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "{ " + importSpecifierTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " } from " + quotedModuleSpecifier + suffix };
+ case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " = require(").concat(quotedModuleSpecifier, ")").concat(suffix) };
+ case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " from ").concat(quotedModuleSpecifier).concat(suffix) };
+ case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "* as ").concat(ts.escapeSnippetText(name), " from ").concat(quotedModuleSpecifier).concat(suffix) };
+ case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "{ ").concat(importSpecifierTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " } from ").concat(quotedModuleSpecifier).concat(suffix) };
}
}
function quotePropertyName(sourceFile, preferences, name) {
@@ -133684,7 +133685,7 @@ var ts;
}
function getDocumentRegistryEntry(bucketEntry, scriptKind) {
var entry = isDocumentRegistryEntry(bucketEntry) ? bucketEntry : bucketEntry.get(ts.Debug.checkDefined(scriptKind, "If there are more than one scriptKind's for same document the scriptKind should be provided"));
- ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:" + scriptKind + " and sourceFile.scriptKind: " + (entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind) + ", !entry: " + !entry);
+ ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:".concat(scriptKind, " and sourceFile.scriptKind: ").concat(entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind, ", !entry: ").concat(!entry));
return entry;
}
function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
@@ -134713,7 +134714,7 @@ var ts;
sourceFile: def.file,
name: def.reference.fileName,
kind: "string" /* string */,
- displayParts: [ts.displayPart("\"" + def.reference.fileName + "\"", ts.SymbolDisplayPartKind.stringLiteral)]
+ displayParts: [ts.displayPart("\"".concat(def.reference.fileName, "\""), ts.SymbolDisplayPartKind.stringLiteral)]
};
}
default:
@@ -135293,7 +135294,7 @@ var ts;
if (symbol.flags & 33554432 /* Transient */)
return undefined;
// Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here.
- ts.Debug.fail("Unexpected symbol at " + ts.Debug.formatSyntaxKind(node.kind) + ": " + ts.Debug.formatSymbol(symbol));
+ ts.Debug.fail("Unexpected symbol at ".concat(ts.Debug.formatSyntaxKind(node.kind), ": ").concat(ts.Debug.formatSymbol(symbol)));
}
return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent)
? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name)
@@ -136578,8 +136579,8 @@ var ts;
var end = pos + 6; /* "static".length */
var typeChecker = program.getTypeChecker();
var symbol = typeChecker.getSymbolAtLocation(node.parent);
- var prefix = symbol ? typeChecker.symbolToString(symbol, node.parent) + " " : "";
- return { text: prefix + "static {}", pos: pos, end: end };
+ var prefix = symbol ? "".concat(typeChecker.symbolToString(symbol, node.parent), " ") : "";
+ return { text: "".concat(prefix, "static {}"), pos: pos, end: end };
}
var declName = isConstNamedExpression(node) ? node.parent.name :
ts.Debug.checkDefined(ts.getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
@@ -137863,7 +137864,7 @@ var ts;
function getJSDocTagCompletions() {
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) {
return {
- name: "@" + tagName,
+ name: "@".concat(tagName),
kind: "keyword" /* keyword */,
kindModifiers: "",
sortText: ts.Completions.SortText.LocationPriority
@@ -137995,11 +137996,11 @@ var ts;
var name = _a.name, dotDotDotToken = _a.dotDotDotToken;
var paramName = name.kind === 79 /* Identifier */ ? name.text : "param" + i;
var type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : "";
- return indentationStr + " * @param " + type + paramName + newLine;
+ return "".concat(indentationStr, " * @param ").concat(type).concat(paramName).concat(newLine);
}).join("");
}
function returnsDocComment(indentationStr, newLine) {
- return indentationStr + " * @returns" + newLine;
+ return "".concat(indentationStr, " * @returns").concat(newLine);
}
function getCommentOwnerInfo(tokenAtPos, options) {
return ts.forEachAncestor(tokenAtPos, function (n) { return getCommentOwnerInfoWorker(n, options); });
@@ -138842,7 +138843,7 @@ var ts;
}
if (name) {
var text = ts.isIdentifier(name) ? name.text
- : ts.isElementAccessExpression(name) ? "[" + nodeText(name.argumentExpression) + "]"
+ : ts.isElementAccessExpression(name) ? "[".concat(nodeText(name.argumentExpression), "]")
: nodeText(name);
if (text.length > 0) {
return cleanText(text);
@@ -138852,7 +138853,7 @@ var ts;
case 303 /* SourceFile */:
var sourceFile = node;
return ts.isExternalModule(sourceFile)
- ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\""
+ ? "\"".concat(ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))), "\"")
: "";
case 270 /* ExportAssignment */:
return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
@@ -139048,10 +139049,10 @@ var ts;
if (name !== undefined) {
name = cleanText(name);
if (name.length > maxLength) {
- return name + " callback";
+ return "".concat(name, " callback");
}
var args = cleanText(ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined; }).join(", "));
- return name + "(" + args + ") callback";
+ return "".concat(name, "(").concat(args, ") callback");
}
}
return "";
@@ -139064,7 +139065,7 @@ var ts;
else if (ts.isPropertyAccessExpression(expr)) {
var left = getCalledExpressionName(expr.expression);
var right = expr.name.text;
- return left === undefined ? right : left + "." + right;
+ return left === undefined ? right : "".concat(left, ".").concat(right);
}
else {
return undefined;
@@ -141511,7 +141512,7 @@ var ts;
var _loop_9 = function (n) {
// If the node is not a subspan of its parent, this is a big problem.
// There have been crashes that might be caused by this violation.
- ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.formatSyntaxKind(n.kind) + ", parent: " + ts.Debug.formatSyntaxKind(n.parent.kind); });
+ ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: ".concat(ts.Debug.formatSyntaxKind(n.kind), ", parent: ").concat(ts.Debug.formatSyntaxKind(n.parent.kind)); });
var argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n, position, sourceFile, checker);
if (argumentInfo) {
return { value: argumentInfo };
@@ -141683,7 +141684,7 @@ var ts;
(function (InlayHints) {
var maxHintsLength = 30;
var leadingParameterNameCommentRegexFactory = function (name) {
- return new RegExp("^\\s?/\\*\\*?\\s?" + name + "\\s?\\*\\/\\s?$");
+ return new RegExp("^\\s?/\\*\\*?\\s?".concat(name, "\\s?\\*\\/\\s?$"));
};
function shouldShowParameterNameHints(preferences) {
return preferences.includeInlayParameterNameHints === "literals" || preferences.includeInlayParameterNameHints === "all";
@@ -141747,7 +141748,7 @@ var ts;
}
function addParameterHints(text, position, isFirstVariadicArgument) {
result.push({
- text: "" + (isFirstVariadicArgument ? "..." : "") + truncation(text, maxHintsLength) + ":",
+ text: "".concat(isFirstVariadicArgument ? "..." : "").concat(truncation(text, maxHintsLength), ":"),
position: position,
kind: "Parameter" /* Parameter */,
whitespaceAfter: true,
@@ -141755,7 +141756,7 @@ var ts;
}
function addTypeHints(text, position) {
result.push({
- text: ": " + truncation(text, maxHintsLength),
+ text: ": ".concat(truncation(text, maxHintsLength)),
position: position,
kind: "Type" /* Type */,
whitespaceBefore: true,
@@ -141763,7 +141764,7 @@ var ts;
}
function addEnumMemberValueHints(text, position) {
result.push({
- text: "= " + truncation(text, maxHintsLength),
+ text: "= ".concat(truncation(text, maxHintsLength)),
position: position,
kind: "Enum" /* Enum */,
whitespaceBefore: true,
@@ -142298,7 +142299,7 @@ var ts;
}
}
function getKeyFromNode(exp) {
- return exp.pos.toString() + ":" + exp.end.toString();
+ return "".concat(exp.pos.toString(), ":").concat(exp.end.toString());
}
function canBeConvertedToClass(node, checker) {
var _a, _b, _c, _d;
@@ -146447,7 +146448,7 @@ var ts;
var insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition);
var token = ts.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position);
var indent = sourceFile.text.slice(lineStartPosition, startPosition);
- var text = (insertAtLineStart ? "" : this.newLineCharacter) + "//" + commentText + this.newLineCharacter + indent;
+ var text = "".concat(insertAtLineStart ? "" : this.newLineCharacter, "//").concat(commentText).concat(this.newLineCharacter).concat(indent);
this.insertText(sourceFile, token.getStart(sourceFile), text);
};
ChangeTracker.prototype.insertJsdocCommentBefore = function (sourceFile, node, tag) {
@@ -146671,7 +146672,7 @@ var ts;
};
ChangeTracker.prototype.getInsertNodeAfterOptions = function (sourceFile, after) {
var options = this.getInsertNodeAfterOptionsWorker(after);
- return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n" + options.prefix : "\n") : options.prefix });
+ return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n".concat(options.prefix) : "\n") : options.prefix });
};
ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) {
switch (node.kind) {
@@ -146705,7 +146706,7 @@ var ts;
}
else {
// `x => {}` -> `function f(x) {}`
- this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function " + name + "(");
+ this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function ".concat(name, "("));
// Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)`
this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */));
}
@@ -146771,7 +146772,7 @@ var ts;
var nextNode = containingList[index + 1];
var startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart());
// write separator and leading trivia of the next element as suffix
- var suffix = "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, startPos);
+ var suffix = "".concat(ts.tokenToString(nextToken.kind)).concat(sourceFile.text.substring(nextToken.end, startPos));
this.insertNodesAt(sourceFile, startPos, [newNode], { suffix: suffix });
}
}
@@ -146816,7 +146817,7 @@ var ts;
this.replaceRange(sourceFile, ts.createRange(insertPos), newNode, { indentation: indentation, prefix: this.newLineCharacter });
}
else {
- this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + " " });
+ this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: "".concat(ts.tokenToString(separator), " ") });
}
}
};
@@ -146947,7 +146948,7 @@ var ts;
var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); });
var _loop_12 = function (i) {
ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () {
- return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range);
+ return "".concat(JSON.stringify(normalized[i].range), " and ").concat(JSON.stringify(normalized[i + 1].range));
});
};
// verify that change intervals do not overlap, except possibly at end points.
@@ -147038,7 +147039,7 @@ var ts;
function applyChanges(text, changes) {
for (var i = changes.length - 1; i >= 0; i--) {
var _a = changes[i], span = _a.span, newText = _a.newText;
- text = "" + text.substring(0, span.start) + newText + text.substring(ts.textSpanEnd(span));
+ text = "".concat(text.substring(0, span.start)).concat(newText).concat(text.substring(ts.textSpanEnd(span)));
}
return text;
}
@@ -149523,7 +149524,7 @@ var ts;
if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind)
|| checker.resolveName(text, node, 111551 /* Value */, /*excludeGlobals*/ true))) {
// Unconditionally add an underscore in case `text` is a keyword.
- res.set(text, makeUniqueName("_" + text, identifiers));
+ res.set(text, makeUniqueName("_".concat(text), identifiers));
}
});
return res;
@@ -149623,7 +149624,7 @@ var ts;
// `const a = require("b").c` --> `import { c as a } from "./b";
return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]);
default:
- return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form " + name.kind);
+ return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form ".concat(name.kind));
}
}
function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) {
@@ -149674,7 +149675,7 @@ var ts;
case 168 /* MethodDeclaration */:
return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(93 /* ExportKeyword */)], prop, useSitesToUnqualify);
default:
- ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind);
+ ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind ".concat(prop.kind));
}
});
return statements && [statements, false];
@@ -149806,7 +149807,7 @@ var ts;
case 79 /* Identifier */:
return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference);
default:
- return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind " + name.kind);
+ return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind ".concat(name.kind));
}
}
/**
@@ -149863,7 +149864,7 @@ var ts;
// Identifiers helpers
function makeUniqueName(name, identifiers) {
while (identifiers.original.has(name) || identifiers.additional.has(name)) {
- name = "_" + name;
+ name = "_".concat(name);
}
identifiers.additional.add(name);
return name;
@@ -149943,7 +149944,7 @@ var ts;
if (!qualifiedName)
return undefined;
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); });
- var newText = qualifiedName.left.text + "[\"" + qualifiedName.right.text + "\"]";
+ var newText = "".concat(qualifiedName.left.text, "[\"").concat(qualifiedName.right.text, "\"]");
return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, ts.Diagnostics.Rewrite_all_as_indexed_access_types)];
},
fixIds: [fixId],
@@ -150345,7 +150346,7 @@ var ts;
// Excluding from fix-all
break;
default:
- ts.Debug.assertNever(fix, "fix wasn't never - got kind " + fix.kind);
+ ts.Debug.assertNever(fix, "fix wasn't never - got kind ".concat(fix.kind));
}
function reduceAddAsTypeOnlyValues(prevValue, newValue) {
// `NotAllowed` overrides `Required` because one addition of a new import might be required to be type-only
@@ -150389,7 +150390,7 @@ var ts;
return newEntry;
}
function newImportsKey(moduleSpecifier, topLevelTypeOnly) {
- return (topLevelTypeOnly ? 1 : 0) + "|" + moduleSpecifier;
+ return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier);
}
}
function writeFixes(changeTracker) {
@@ -150887,7 +150888,7 @@ var ts;
case ts.ModuleKind.NodeNext:
return importingFile.impliedNodeFormat === ts.ModuleKind.ESNext ? 2 /* Namespace */ : 3 /* CommonJS */;
default:
- return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind " + moduleKind);
+ return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind ".concat(moduleKind));
}
}
function getFixesInfoForNonUMDImport(_a, symbolToken, useAutoImportProvider) {
@@ -151010,7 +151011,7 @@ var ts;
switch (fix.kind) {
case 0 /* UseNamespace */:
addNamespaceQualifier(changes, sourceFile, fix);
- return [ts.Diagnostics.Change_0_to_1, symbolName, fix.namespacePrefix + "." + symbolName];
+ return [ts.Diagnostics.Change_0_to_1, symbolName, "".concat(fix.namespacePrefix, ".").concat(symbolName)];
case 1 /* JsdocTypeImport */:
addImportType(changes, sourceFile, fix, quotePreference);
return [ts.Diagnostics.Change_0_to_1, symbolName, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName];
@@ -151041,7 +151042,7 @@ var ts;
: [ts.Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
}
default:
- return ts.Debug.assertNever(fix, "Unexpected fix kind " + fix.kind);
+ return ts.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind));
}
}
function getModuleSpecifierText(promotedDeclaration) {
@@ -151194,7 +151195,7 @@ var ts;
}
function getImportTypePrefix(moduleSpecifier, quotePreference) {
var quote = ts.getQuoteFromPreference(quotePreference);
- return "import(" + quote + moduleSpecifier + quote + ").";
+ return "import(".concat(quote).concat(moduleSpecifier).concat(quote, ").");
}
function needsTypeOnly(_a) {
var addAsTypeOnly = _a.addAsTypeOnly;
@@ -151290,7 +151291,7 @@ var ts;
lastCharWasValid = isValid;
}
// Need `|| "_"` to ensure result isn't empty.
- return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res;
+ return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_".concat(res);
}
codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier;
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -152546,7 +152547,7 @@ var ts;
break;
}
default:
- ts.Debug.fail("Bad fixId: " + context.fixId);
+ ts.Debug.fail("Bad fixId: ".concat(context.fixId));
}
});
},
@@ -152994,7 +152995,7 @@ var ts;
if (!isValidCharacter(character)) {
return;
}
- var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(sourceFile, preferences, character) + "}";
+ var replacement = useHtmlEntity ? htmlEntity[character] : "{".concat(ts.quote(sourceFile, preferences, character), "}");
changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement);
}
})(codefix = ts.codefix || (ts.codefix = {}));
@@ -153274,11 +153275,11 @@ var ts;
token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name;
}
if (ts.isIdentifier(token) && canPrefix(token)) {
- changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_" + token.text));
+ changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_".concat(token.text)));
if (ts.isParameter(token.parent)) {
ts.getJSDocParameterTags(token.parent).forEach(function (tag) {
if (ts.isIdentifier(tag.name)) {
- changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_" + tag.name.text));
+ changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_".concat(tag.name.text)));
}
});
}
@@ -153620,7 +153621,7 @@ var ts;
}); }
});
function doChange(changes, sourceFile, name) {
- changes.replaceNodeWithText(sourceFile, name, name.text + "()");
+ changes.replaceNodeWithText(sourceFile, name, "".concat(name.text, "()"));
}
function getCallName(sourceFile, start) {
var token = ts.getTokenAtPosition(sourceFile, start);
@@ -154744,7 +154745,7 @@ var ts;
var parameters = [];
var length = Math.max.apply(Math, calls.map(function (c) { return c.argumentTypes.length; }));
var _loop_16 = function (i) {
- var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg" + i));
+ var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg".concat(i)));
symbol.type = combineTypes(calls.map(function (call) { return call.argumentTypes[i] || checker.getUndefinedType(); }));
if (calls.some(function (call) { return call.argumentTypes[i] === undefined; })) {
symbol.flags |= 16777216 /* Optional */;
@@ -154847,7 +154848,7 @@ var ts;
codefix.createCodeFixActionWithoutFixAll(fixName, [codefix.createFileTextChanges(sourceFile.fileName, [
ts.createTextChange(sourceFile.checkJsDirective
? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end)
- : ts.createTextSpan(0, 0), "// @ts-nocheck" + newLineCharacter),
+ : ts.createTextSpan(0, 0), "// @ts-nocheck".concat(newLineCharacter)),
])], ts.Diagnostics.Disable_checking_for_this_file),
];
if (ts.textChanges.isValidLocationToAddComment(sourceFile, span.start)) {
@@ -155113,7 +155114,7 @@ var ts;
var typeParameters = isJs || typeArguments === undefined
? undefined
: ts.map(typeArguments, function (_, i) {
- return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T" + i);
+ return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T".concat(i));
});
var parameters = createDummyParameters(args.length, names, types, /*minArgumentCount*/ undefined, isJs);
var type = isJs || contextualType === undefined
@@ -155148,7 +155149,7 @@ var ts;
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotDotDotToken*/ undefined,
- /*name*/ names && names[i] || "arg" + i,
+ /*name*/ names && names[i] || "arg".concat(i),
/*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.factory.createToken(57 /* QuestionToken */) : undefined,
/*type*/ inJs ? undefined : types && types[i] || ts.factory.createKeywordTypeNode(130 /* AnyKeyword */),
/*initializer*/ undefined);
@@ -155399,7 +155400,7 @@ var ts;
}
var name = declaration.name.text;
var startWithUnderscore = ts.startsWithUnderscore(name);
- var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file), declaration.name);
+ var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_".concat(name), file), declaration.name);
var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name);
return {
isStatic: ts.hasStaticModifier(declaration),
@@ -156438,7 +156439,7 @@ var ts;
changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text)));
break;
default:
- ts.Debug.fail("Unexpected exportNode kind " + exportNode.kind);
+ ts.Debug.fail("Unexpected exportNode kind ".concat(exportNode.kind));
}
}
}
@@ -156526,7 +156527,7 @@ var ts;
break;
}
default:
- ts.Debug.assertNever(parent, "Unexpected parent kind " + parent.kind);
+ ts.Debug.assertNever(parent, "Unexpected parent kind ".concat(parent.kind));
}
}
function makeImportSpecifier(propertyName, name) {
@@ -157109,7 +157110,7 @@ var ts;
var newComment = ts.displayPartsToString(parameterDocComment);
if (newComment.length) {
ts.setSyntheticLeadingComments(result, [{
- text: "*\n" + newComment.split("\n").map(function (c) { return " * " + c; }).join("\n") + "\n ",
+ text: "*\n".concat(newComment.split("\n").map(function (c) { return " * ".concat(c); }).join("\n"), "\n "),
kind: 3 /* MultiLineCommentTrivia */,
pos: -1,
end: -1,
@@ -157254,7 +157255,7 @@ var ts;
usedFunctionNames.set(description, true);
functionActions.push({
description: description,
- name: "function_scope_" + i,
+ name: "function_scope_".concat(i),
kind: extractFunctionAction.kind
});
}
@@ -157262,7 +157263,7 @@ var ts;
else if (!innermostErrorFunctionAction) {
innermostErrorFunctionAction = {
description: description,
- name: "function_scope_" + i,
+ name: "function_scope_".concat(i),
notApplicableReason: getStringError(functionExtraction.errors),
kind: extractFunctionAction.kind
};
@@ -157278,7 +157279,7 @@ var ts;
usedConstantNames.set(description_1, true);
constantActions.push({
description: description_1,
- name: "constant_scope_" + i,
+ name: "constant_scope_".concat(i),
kind: extractConstantAction.kind
});
}
@@ -157286,7 +157287,7 @@ var ts;
else if (!innermostErrorConstantAction) {
innermostErrorConstantAction = {
description: description,
- name: "constant_scope_" + i,
+ name: "constant_scope_".concat(i),
notApplicableReason: getStringError(constantExtraction.errors),
kind: extractConstantAction.kind
};
@@ -157428,7 +157429,7 @@ var ts;
// cannot find either start or end node
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] };
}
- if (ts.isJSDoc(start)) {
+ if (start.flags & 4194304 /* JSDoc */) {
return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractJSDoc)] };
}
if (start.parent !== end.parent) {
@@ -157870,28 +157871,28 @@ var ts;
case 212 /* FunctionExpression */:
case 255 /* FunctionDeclaration */:
return scope.name
- ? "function '" + scope.name.text + "'"
+ ? "function '".concat(scope.name.text, "'")
: ts.ANONYMOUS;
case 213 /* ArrowFunction */:
return "arrow function";
case 168 /* MethodDeclaration */:
- return "method '" + scope.name.getText() + "'";
+ return "method '".concat(scope.name.getText(), "'");
case 171 /* GetAccessor */:
- return "'get " + scope.name.getText() + "'";
+ return "'get ".concat(scope.name.getText(), "'");
case 172 /* SetAccessor */:
- return "'set " + scope.name.getText() + "'";
+ return "'set ".concat(scope.name.getText(), "'");
default:
- throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind);
+ throw ts.Debug.assertNever(scope, "Unexpected scope kind ".concat(scope.kind));
}
}
function getDescriptionForClassLikeDeclaration(scope) {
return scope.kind === 256 /* ClassDeclaration */
- ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration"
- : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression";
+ ? scope.name ? "class '".concat(scope.name.text, "'") : "anonymous class declaration"
+ : scope.name ? "class expression '".concat(scope.name.text, "'") : "anonymous class expression";
}
function getDescriptionForModuleLikeDeclaration(scope) {
return scope.kind === 261 /* ModuleBlock */
- ? "namespace '" + scope.parent.name.getText() + "'"
+ ? "namespace '".concat(scope.parent.name.getText(), "'")
: scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */;
}
var SpecialScope;
@@ -159367,7 +159368,7 @@ var ts;
case 253 /* VariableDeclaration */:
return ts.tryCast(node.name, ts.isIdentifier);
default:
- return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
+ return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
}
}
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) {
@@ -159404,7 +159405,7 @@ var ts;
case 253 /* VariableDeclaration */:
return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString));
default:
- return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
+ return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
}
}
function moduleSpecifierFromImport(i) {
@@ -159491,7 +159492,7 @@ var ts;
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
break;
default:
- ts.Debug.assertNever(importDecl, "Unexpected import decl kind " + importDecl.kind);
+ ts.Debug.assertNever(importDecl, "Unexpected import decl kind ".concat(importDecl.kind));
}
}
function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused) {
@@ -159591,7 +159592,7 @@ var ts;
var name = ts.combinePaths(inDirectory, newModuleName + extension);
if (!host.fileExists(name))
return newModuleName; // TODO: GH#18217
- newModuleName = moduleName + "." + i;
+ newModuleName = "".concat(moduleName, ".").concat(i);
}
}
function getNewModuleName(movedSymbols) {
@@ -159698,7 +159699,7 @@ var ts;
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined;
}
default:
- return ts.Debug.assertNever(i, "Unexpected import kind " + i.kind);
+ return ts.Debug.assertNever(i, "Unexpected import kind ".concat(i.kind));
}
}
function filterNamedBindings(namedBindings, keep) {
@@ -159813,7 +159814,7 @@ var ts;
case 200 /* ObjectBindingPattern */:
return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); });
default:
- return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind);
+ return ts.Debug.assertNever(name, "Unexpected name kind ".concat(name.kind));
}
}
function nameOfTopLevelDeclaration(d) {
@@ -159874,7 +159875,7 @@ var ts;
case 237 /* ExpressionStatement */:
return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...`
default:
- return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind);
+ return ts.Debug.assertNever(d, "Unexpected declaration kind ".concat(d.kind));
}
}
function addCommonjsExport(decl) {
@@ -159896,7 +159897,7 @@ var ts;
case 237 /* ExpressionStatement */:
return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...`
default:
- return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind);
+ return ts.Debug.assertNever(decl, "Unexpected decl kind ".concat(decl.kind));
}
}
/** Creates `exports.x = x;` */
@@ -160534,7 +160535,7 @@ var ts;
return [functionDeclaration.name, functionDeclaration.parent.name];
return [functionDeclaration.parent.name];
default:
- return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind " + functionDeclaration.kind);
+ return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind ".concat(functionDeclaration.kind));
}
}
})(convertParamsToDestructuredObject = refactor.convertParamsToDestructuredObject || (refactor.convertParamsToDestructuredObject = {}));
@@ -161238,7 +161239,7 @@ var ts;
var textPos = ts.scanner.getTextPos();
if (textPos <= end) {
if (token === 79 /* Identifier */) {
- ts.Debug.fail("Did not expect " + ts.Debug.formatSyntaxKind(parent.kind) + " to have an Identifier in its trivia");
+ ts.Debug.fail("Did not expect ".concat(ts.Debug.formatSyntaxKind(parent.kind), " to have an Identifier in its trivia"));
}
nodes.push(createNode(token, pos, textPos, parent));
}
@@ -162168,7 +162169,7 @@ var ts;
function getValidSourceFile(fileName) {
var sourceFile = program.getSourceFile(fileName);
if (!sourceFile) {
- var error = new Error("Could not find source file: '" + fileName + "'.");
+ var error = new Error("Could not find source file: '".concat(fileName, "'."));
// We've been having trouble debugging this, so attach sidecar data for the tsserver log.
// See https://github.com/microsoft/TypeScript/issues/30180.
error.ProgramFiles = program.getSourceFiles().map(function (f) { return f.fileName; });
@@ -162844,7 +162845,7 @@ var ts;
var element = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningElement(token.parent) ? token.parent.parent
: ts.isJsxText(token) && ts.isJsxElement(token.parent) ? token.parent : undefined;
if (element && isUnclosedTag(element)) {
- return { newText: "" + element.openingElement.tagName.getText(sourceFile) + ">" };
+ return { newText: "".concat(element.openingElement.tagName.getText(sourceFile), ">") };
}
var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent
: ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined;
@@ -162950,7 +162951,7 @@ var ts;
pos = commentRange.end + 1;
}
else { // If it's not in a comment range, then we need to comment the uncommented portions.
- var newPos = text.substring(pos, textRange.end).search("(" + openMultilineRegex + ")|(" + closeMultilineRegex + ")");
+ var newPos = text.substring(pos, textRange.end).search("(".concat(openMultilineRegex, ")|(").concat(closeMultilineRegex, ")"));
isCommenting = insertComment !== undefined
? insertComment
: isCommenting || !ts.isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); // If isCommenting is already true we don't need to check whitespace again.
@@ -163345,14 +163346,14 @@ var ts;
case ts.LanguageServiceMode.PartialSemantic:
invalidOperationsInPartialSemanticMode.forEach(function (key) {
return ls[key] = function () {
- throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.PartialSemantic");
+ throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.PartialSemantic"));
};
});
break;
case ts.LanguageServiceMode.Syntactic:
invalidOperationsInSyntacticMode.forEach(function (key) {
return ls[key] = function () {
- throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.Syntactic");
+ throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.Syntactic"));
};
});
break;
@@ -164334,13 +164335,13 @@ var ts;
var result = action();
if (logPerformance) {
var end = ts.timestamp();
- logger.log(actionDescription + " completed in " + (end - start) + " msec");
+ logger.log("".concat(actionDescription, " completed in ").concat(end - start, " msec"));
if (ts.isString(result)) {
var str = result;
if (str.length > 128) {
str = str.substring(0, 128) + "...";
}
- logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'");
+ logger.log(" result.length=".concat(str.length, ", result='").concat(JSON.stringify(str), "'"));
}
}
return result;
@@ -164422,7 +164423,7 @@ var ts;
* Update the list of scripts known to the compiler
*/
LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
- this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; } // eslint-disable-line no-null/no-null
+ this.forwardJSONCall("refresh(".concat(throwOnError, ")"), function () { return null; } // eslint-disable-line no-null/no-null
);
};
LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
@@ -164438,43 +164439,43 @@ var ts;
};
LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
+ return this.forwardJSONCall("getSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
};
LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
+ return this.forwardJSONCall("getSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
};
LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")",
+ return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
// directly serialize the spans out to a string. This is much faster to decode
// on the managed side versus a full JSON array.
function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
};
LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
var _this = this;
- return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")",
+ return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
// directly serialize the spans out to a string. This is much faster to decode
// on the managed side versus a full JSON array.
function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
};
LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () {
+ return this.forwardJSONCall("getSyntacticDiagnostics('".concat(fileName, "')"), function () {
var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
return _this.realizeDiagnostics(diagnostics);
});
};
LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () {
+ return this.forwardJSONCall("getSemanticDiagnostics('".concat(fileName, "')"), function () {
var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
return _this.realizeDiagnostics(diagnostics);
});
};
LanguageServiceShimObject.prototype.getSuggestionDiagnostics = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getSuggestionDiagnostics('" + fileName + "')", function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
+ return this.forwardJSONCall("getSuggestionDiagnostics('".concat(fileName, "')"), function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
};
LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
var _this = this;
@@ -164490,7 +164491,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
+ return this.forwardJSONCall("getQuickInfoAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
};
/// NAMEORDOTTEDNAMESPAN
/**
@@ -164499,7 +164500,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
var _this = this;
- return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
+ return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(fileName, "', ").concat(startPos, ", ").concat(endPos, ")"), function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
};
/**
* STATEMENTSPAN
@@ -164507,12 +164508,12 @@ var ts;
*/
LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
+ return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
};
/// SIGNATUREHELP
LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
+ return this.forwardJSONCall("getSignatureHelpItems('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
};
/// GOTO DEFINITION
/**
@@ -164521,7 +164522,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
+ return this.forwardJSONCall("getDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
};
/**
* Computes the definition location and file for the symbol
@@ -164529,7 +164530,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getDefinitionAndBoundSpan = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getDefinitionAndBoundSpan('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
+ return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
};
/// GOTO Type
/**
@@ -164538,7 +164539,7 @@ var ts;
*/
LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
+ return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
};
/// GOTO Implementation
/**
@@ -164547,37 +164548,37 @@ var ts;
*/
LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
+ return this.forwardJSONCall("getImplementationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position, options); });
+ return this.forwardJSONCall("getRenameInfo('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getRenameInfo(fileName, position, options); });
};
LanguageServiceShimObject.prototype.getSmartSelectionRange = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getSmartSelectionRange('" + fileName + "', " + position + ")", function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
+ return this.forwardJSONCall("getSmartSelectionRange('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
};
LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) {
var _this = this;
- return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ", " + providePrefixAndSuffixTextForRename + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
+ return this.forwardJSONCall("findRenameLocations('".concat(fileName, "', ").concat(position, ", ").concat(findInStrings, ", ").concat(findInComments, ", ").concat(providePrefixAndSuffixTextForRename, ")"), function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
};
/// GET BRACE MATCHING
LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
+ return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
var _this = this;
- return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
+ return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(openingBrace, ")"), function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
};
LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) {
var _this = this;
- return this.forwardJSONCall("getSpanOfEnclosingComment('" + fileName + "', " + position + ")", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
+ return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
};
/// GET SMART INDENT
LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) {
var _this = this;
- return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () {
+ return this.forwardJSONCall("getIndentationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
});
@@ -164585,23 +164586,23 @@ var ts;
/// GET REFERENCES
LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
+ return this.forwardJSONCall("getReferencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); });
+ return this.forwardJSONCall("findReferences('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.findReferences(fileName, position); });
};
LanguageServiceShimObject.prototype.getFileReferences = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getFileReferences('" + fileName + ")", function () { return _this.languageService.getFileReferences(fileName); });
+ return this.forwardJSONCall("getFileReferences('".concat(fileName, ")"), function () { return _this.languageService.getFileReferences(fileName); });
};
LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
+ return this.forwardJSONCall("getOccurrencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
};
LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
var _this = this;
- return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () {
+ return this.forwardJSONCall("getDocumentHighlights('".concat(fileName, "', ").concat(position, ")"), function () {
var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
// workaround for VS document highlighting issue - keep only items from the initial file
var normalizedName = ts.toFileNameLowerCase(ts.normalizeSlashes(fileName));
@@ -164616,108 +164617,108 @@ var ts;
*/
LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences, formattingSettings) {
var _this = this;
- return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ", " + formattingSettings + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
+ return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ", ").concat(formattingSettings, ")"), function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
};
/** Get a string based representation of a completion list entry details */
LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, formatOptions, source, preferences, data) {
var _this = this;
- return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () {
+ return this.forwardJSONCall("getCompletionEntryDetails('".concat(fileName, "', ").concat(position, ", '").concat(entryName, "')"), function () {
var localOptions = formatOptions === undefined ? undefined : JSON.parse(formatOptions);
return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () {
+ return this.forwardJSONCall("getFormattingEditsForRange('".concat(fileName, "', ").concat(start, ", ").concat(end, ")"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () {
+ return this.forwardJSONCall("getFormattingEditsForDocument('".concat(fileName, "')"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
});
};
LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) {
var _this = this;
- return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () {
+ return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(fileName, "', ").concat(position, ", '").concat(key, "')"), function () {
var localOptions = JSON.parse(options);
return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
});
};
LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position, options) {
var _this = this;
- return this.forwardJSONCall("getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
+ return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
};
/// NAVIGATE TO
/** Return a list of symbols that are interesting to navigate to */
LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ", " + fileName + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
+ return this.forwardJSONCall("getNavigateToItems('".concat(searchValue, "', ").concat(maxResultCount, ", ").concat(fileName, ")"), function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
};
LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); });
+ return this.forwardJSONCall("getNavigationBarItems('".concat(fileName, "')"), function () { return _this.languageService.getNavigationBarItems(fileName); });
};
LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
+ return this.forwardJSONCall("getNavigationTree('".concat(fileName, "')"), function () { return _this.languageService.getNavigationTree(fileName); });
};
LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
+ return this.forwardJSONCall("getOutliningSpans('".concat(fileName, "')"), function () { return _this.languageService.getOutliningSpans(fileName); });
};
LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
var _this = this;
- return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
+ return this.forwardJSONCall("getTodoComments('".concat(fileName, "')"), function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
};
/// CALL HIERARCHY
LanguageServiceShimObject.prototype.prepareCallHierarchy = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("prepareCallHierarchy('" + fileName + "', " + position + ")", function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
+ return this.forwardJSONCall("prepareCallHierarchy('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
};
LanguageServiceShimObject.prototype.provideCallHierarchyIncomingCalls = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("provideCallHierarchyIncomingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
+ return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
};
LanguageServiceShimObject.prototype.provideCallHierarchyOutgoingCalls = function (fileName, position) {
var _this = this;
- return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
+ return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
};
LanguageServiceShimObject.prototype.provideInlayHints = function (fileName, span, preference) {
var _this = this;
- return this.forwardJSONCall("provideInlayHints('" + fileName + "', '" + JSON.stringify(span) + "', " + JSON.stringify(preference) + ")", function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
+ return this.forwardJSONCall("provideInlayHints('".concat(fileName, "', '").concat(JSON.stringify(span), "', ").concat(JSON.stringify(preference), ")"), function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
};
/// Emit
LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
var _this = this;
- return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () {
+ return this.forwardJSONCall("getEmitOutput('".concat(fileName, "')"), function () {
var _a = _this.languageService.getEmitOutput(fileName), diagnostics = _a.diagnostics, rest = __rest(_a, ["diagnostics"]);
return __assign(__assign({}, rest), { diagnostics: _this.realizeDiagnostics(diagnostics) });
});
};
LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
var _this = this;
- return forwardCall(this.logger, "getEmitOutput('" + fileName + "')",
+ return forwardCall(this.logger, "getEmitOutput('".concat(fileName, "')"),
/*returnJson*/ false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
};
LanguageServiceShimObject.prototype.toggleLineComment = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("toggleLineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleLineComment(fileName, textRange); });
+ return this.forwardJSONCall("toggleLineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleLineComment(fileName, textRange); });
};
LanguageServiceShimObject.prototype.toggleMultilineComment = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("toggleMultilineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
+ return this.forwardJSONCall("toggleMultilineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
};
LanguageServiceShimObject.prototype.commentSelection = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("commentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.commentSelection(fileName, textRange); });
+ return this.forwardJSONCall("commentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.commentSelection(fileName, textRange); });
};
LanguageServiceShimObject.prototype.uncommentSelection = function (fileName, textRange) {
var _this = this;
- return this.forwardJSONCall("uncommentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.uncommentSelection(fileName, textRange); });
+ return this.forwardJSONCall("uncommentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.uncommentSelection(fileName, textRange); });
};
return LanguageServiceShimObject;
}(ShimBase));
@@ -164767,7 +164768,7 @@ var ts;
};
CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("resolveModuleName('" + fileName + "')", function () {
+ return this.forwardJSONCall("resolveModuleName('".concat(fileName, "')"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;
@@ -164782,7 +164783,7 @@ var ts;
};
CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("resolveTypeReferenceDirective(" + fileName + ")", function () {
+ return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(fileName, ")"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
return {
@@ -164794,7 +164795,7 @@ var ts;
};
CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
var _this = this;
- return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () {
+ return this.forwardJSONCall("getPreProcessedFileInfo('".concat(fileName, "')"), function () {
// for now treat files as JavaScript
var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true);
return {
@@ -164809,7 +164810,7 @@ var ts;
};
CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
var _this = this;
- return this.forwardJSONCall("getAutomaticTypeDirectiveNames('" + compilerOptionsJson + "')", function () {
+ return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(compilerOptionsJson, "')"), function () {
var compilerOptions = JSON.parse(compilerOptionsJson);
return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
});
@@ -164831,7 +164832,7 @@ var ts;
};
CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
var _this = this;
- return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () {
+ return this.forwardJSONCall("getTSConfigFileInfo('".concat(fileName, "')"), function () {
var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot));
var normalizedFileName = ts.normalizeSlashes(fileName);
var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName);
diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js
index a25c8014f59..67dc478c9c1 100644
--- a/lib/typingsInstaller.js
+++ b/lib/typingsInstaller.js
@@ -22,7 +22,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
ar[i] = from[i];
}
}
- return to.concat(ar || from);
+ return to.concat(ar || Array.prototype.slice.call(from));
};
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
@@ -89,7 +89,7 @@ var ts;
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
- ts.version = ts.versionMajorMinor + ".1-rc";
+ ts.version = "4.6.2";
/* @internal */
var Comparison;
(function (Comparison) {
@@ -136,7 +136,7 @@ var ts;
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
if (constructor)
return constructor;
- throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
+ throw new Error("TypeScript requires an environment that provides a compatible native ".concat(name, " implementation."));
}
})(ts || (ts = {}));
/* @internal */
@@ -1486,7 +1486,7 @@ var ts;
function cast(value, test) {
if (value !== undefined && test(value))
return value;
- return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'.");
+ return ts.Debug.fail("Invalid cast. The supplied value ".concat(value, " did not pass the test '").concat(ts.Debug.getFunctionName(test), "'."));
}
ts.cast = cast;
/** Does nothing. */
@@ -1577,7 +1577,7 @@ var ts;
function memoizeOne(callback) {
var map = new ts.Map();
return function (arg) {
- var key = typeof arg + ":" + arg;
+ var key = "".concat(typeof arg, ":").concat(arg);
var value = map.get(key);
if (value === undefined && !map.has(key)) {
value = callback(arg);
@@ -2027,7 +2027,7 @@ var ts;
ts.createGetCanonicalFileName = createGetCanonicalFileName;
function patternText(_a) {
var prefix = _a.prefix, suffix = _a.suffix;
- return prefix + "*" + suffix;
+ return "".concat(prefix, "*").concat(suffix);
}
ts.patternText = patternText;
/**
@@ -2340,7 +2340,7 @@ var ts;
}
function fail(message, stackCrawlMark) {
debugger;
- var e = new Error(message ? "Debug Failure. " + message : "Debug Failure.");
+ var e = new Error(message ? "Debug Failure. ".concat(message) : "Debug Failure.");
if (Error.captureStackTrace) {
Error.captureStackTrace(e, stackCrawlMark || fail);
}
@@ -2348,12 +2348,12 @@ var ts;
}
Debug.fail = fail;
function failBadSyntaxKind(node, message, stackCrawlMark) {
- return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", stackCrawlMark || failBadSyntaxKind);
+ return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(formatSyntaxKind(node.kind), " was unexpected."), stackCrawlMark || failBadSyntaxKind);
}
Debug.failBadSyntaxKind = failBadSyntaxKind;
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
if (!expression) {
- message = message ? "False expression: " + message : "False expression.";
+ message = message ? "False expression: ".concat(message) : "False expression.";
if (verboseDebugInfo) {
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
}
@@ -2363,26 +2363,26 @@ var ts;
Debug.assert = assert;
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
if (a !== b) {
- var message = msg ? msg2 ? msg + " " + msg2 : msg : "";
- fail("Expected " + a + " === " + b + ". " + message, stackCrawlMark || assertEqual);
+ var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
+ fail("Expected ".concat(a, " === ").concat(b, ". ").concat(message), stackCrawlMark || assertEqual);
}
}
Debug.assertEqual = assertEqual;
function assertLessThan(a, b, msg, stackCrawlMark) {
if (a >= b) {
- fail("Expected " + a + " < " + b + ". " + (msg || ""), stackCrawlMark || assertLessThan);
+ fail("Expected ".concat(a, " < ").concat(b, ". ").concat(msg || ""), stackCrawlMark || assertLessThan);
}
}
Debug.assertLessThan = assertLessThan;
function assertLessThanOrEqual(a, b, stackCrawlMark) {
if (a > b) {
- fail("Expected " + a + " <= " + b, stackCrawlMark || assertLessThanOrEqual);
+ fail("Expected ".concat(a, " <= ").concat(b), stackCrawlMark || assertLessThanOrEqual);
}
}
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
if (a < b) {
- fail("Expected " + a + " >= " + b, stackCrawlMark || assertGreaterThanOrEqual);
+ fail("Expected ".concat(a, " >= ").concat(b), stackCrawlMark || assertGreaterThanOrEqual);
}
}
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
@@ -2413,42 +2413,42 @@ var ts;
function assertNever(member, message, stackCrawlMark) {
if (message === void 0) { message = "Illegal value:"; }
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
- return fail(message + " " + detail, stackCrawlMark || assertNever);
+ return fail("".concat(message, " ").concat(detail), stackCrawlMark || assertNever);
}
Debug.assertNever = assertNever;
function assertEachNode(nodes, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) {
- assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertEachNode);
+ assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '".concat(getFunctionName(test), "'."); }, stackCrawlMark || assertEachNode);
}
}
Debug.assertEachNode = assertEachNode;
function assertNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNode")) {
- assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNode);
+ 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);
}
}
Debug.assertNode = assertNode;
function assertNotNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) {
- assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " should not have passed test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNotNode);
+ 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);
}
}
Debug.assertNotNode = assertNotNode;
function assertOptionalNode(node, test, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) {
- assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertOptionalNode);
+ 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);
}
}
Debug.assertOptionalNode = assertOptionalNode;
function assertOptionalToken(node, kind, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) {
- assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, stackCrawlMark || assertOptionalToken);
+ 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);
}
}
Debug.assertOptionalToken = assertOptionalToken;
function assertMissingNode(node, message, stackCrawlMark) {
if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) {
- assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, stackCrawlMark || assertMissingNode);
+ assert(node === undefined, message || "Unexpected node.", function () { return "Node ".concat(formatSyntaxKind(node.kind), " was unexpected'."); }, stackCrawlMark || assertMissingNode);
}
}
Debug.assertMissingNode = assertMissingNode;
@@ -2469,7 +2469,7 @@ var ts;
}
Debug.getFunctionName = getFunctionName;
function formatSymbol(symbol) {
- return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }";
+ return "{ name: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }), " }");
}
Debug.formatSymbol = formatSymbol;
/**
@@ -2490,7 +2490,7 @@ var ts;
break;
}
if (enumValue !== 0 && enumValue & value) {
- result = "" + result + (result ? "|" : "") + enumName;
+ result = "".concat(result).concat(result ? "|" : "").concat(enumName);
remainingFlags &= ~enumValue;
}
}
@@ -2600,7 +2600,7 @@ var ts;
this.flags & 1 /* Unreachable */ ? "FlowUnreachable" :
"UnknownFlow";
var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);
- return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : "");
+ return "".concat(flowHeader).concat(remainingFlags ? " (".concat(formatFlowFlags(remainingFlags), ")") : "");
}
},
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },
@@ -2639,7 +2639,7 @@ var ts;
// We don't care, this is debug code that's only enabled with a debugger attached -
// we're just taking note of it for anyone checking regex performance in the future.
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
- return "NodeArray " + defaultValue;
+ return "NodeArray ".concat(defaultValue);
}
}
});
@@ -2694,7 +2694,7 @@ var ts;
var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" :
"Symbol";
var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;
- return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : "");
+ return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
@@ -2704,11 +2704,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" :
- this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) :
- this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" :
+ this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType ".concat(JSON.stringify(this.value)) :
+ this.flags & 2048 /* BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") :
this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" :
this.flags & 32 /* Enum */ ? "EnumType" :
- this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName :
+ this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType ".concat(this.intrinsicName) :
this.flags & 1048576 /* Union */ ? "UnionType" :
this.flags & 2097152 /* Intersection */ ? "IntersectionType" :
this.flags & 4194304 /* Index */ ? "IndexType" :
@@ -2727,7 +2727,7 @@ var ts;
"ObjectType" :
"Type";
var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
- return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : "");
+ return "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(formatObjectFlags(remainingObjectFlags), ")") : "");
}
},
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
@@ -2763,11 +2763,11 @@ var ts;
__tsDebuggerDisplay: {
value: function () {
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
- ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" :
- ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" :
- ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") :
- ts.isNumericLiteral(this) ? "NumericLiteral " + this.text :
- ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" :
+ ts.isIdentifier(this) ? "Identifier '".concat(ts.idText(this), "'") :
+ ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
+ ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
+ ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
+ ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(this.text, "n") :
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
ts.isParameter(this) ? "ParameterDeclaration" :
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
@@ -2799,7 +2799,7 @@ var ts;
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
ts.isImportTypeNode(this) ? "ImportTypeNode" :
formatSyntaxKind(this.kind);
- return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : "");
+ return "".concat(nodeHeader).concat(this.flags ? " (".concat(formatNodeFlags(this.flags), ")") : "");
}
},
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
@@ -2846,10 +2846,10 @@ var ts;
Debug.enableDebugInfo = enableDebugInfo;
function formatDeprecationMessage(name, error, errorAfter, since, message) {
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
- deprecationMessage += "'" + name + "' ";
- deprecationMessage += since ? "has been deprecated since v" + since : "is deprecated";
- deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v" + errorAfter + "." : ".";
- deprecationMessage += message ? " " + ts.formatStringFromArgs(message, [name], 0) : "";
+ deprecationMessage += "'".concat(name, "' ");
+ deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
+ deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
+ deprecationMessage += message ? " ".concat(ts.formatStringFromArgs(message, [name], 0)) : "";
return deprecationMessage;
}
function createErrorDeprecation(name, errorAfter, since, message) {
@@ -2980,11 +2980,11 @@ var ts;
}
};
Version.prototype.toString = function () {
- var result = this.major + "." + this.minor + "." + this.patch;
+ var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
if (ts.some(this.prerelease))
- result += "-" + this.prerelease.join(".");
+ result += "-".concat(this.prerelease.join("."));
if (ts.some(this.build))
- result += "+" + this.build.join(".");
+ result += "+".concat(this.build.join("."));
return result;
};
Version.zero = new Version(0, 0, 0);
@@ -3251,7 +3251,7 @@ var ts;
return ts.map(comparators, formatComparator).join(" ");
}
function formatComparator(comparator) {
- return "" + comparator.operator + comparator.operand;
+ return "".concat(comparator.operator).concat(comparator.operand);
}
})(ts || (ts = {}));
/*@internal*/
@@ -3549,7 +3549,7 @@ var ts;
fs = require("fs");
}
catch (e) {
- throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
+ throw new Error("tracing requires having fs\n(original error: ".concat(e.message || e, ")"));
}
}
mode = tracingMode;
@@ -3561,11 +3561,11 @@ var ts;
if (!fs.existsSync(traceDir)) {
fs.mkdirSync(traceDir, { recursive: true });
}
- var countPart = mode === "build" ? "." + process.pid + "-" + ++traceCount
- : mode === "server" ? "." + process.pid
+ var countPart = mode === "build" ? ".".concat(process.pid, "-").concat(++traceCount)
+ : mode === "server" ? ".".concat(process.pid)
: "";
- var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
- var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
+ var tracePath = ts.combinePaths(traceDir, "trace".concat(countPart, ".json"));
+ var typesPath = ts.combinePaths(traceDir, "types".concat(countPart, ".json"));
legend.push({
configFilePath: configFilePath,
tracePath: tracePath,
@@ -3655,7 +3655,7 @@ var ts;
}
// test if [time,endTime) straddles a sampling point
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
- writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
+ writeEvent("X", phase, name, args, "\"dur\":".concat(endTime - time), time);
}
}
function writeEvent(eventType, phase, name, args, extras, time) {
@@ -3664,11 +3664,11 @@ var ts;
if (mode === "server" && phase === "checkTypes" /* CheckTypes */)
return;
ts.performance.mark("beginTracing");
- fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\"");
+ fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
if (extras)
- fs.writeSync(traceFd, "," + extras);
+ fs.writeSync(traceFd, ",".concat(extras));
if (args)
- fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args));
+ fs.writeSync(traceFd, ",\"args\":".concat(JSON.stringify(args)));
fs.writeSync(traceFd, "}");
ts.performance.mark("endTracing");
ts.performance.measure("Tracing", "beginTracing", "endTracing");
@@ -4829,6 +4829,8 @@ var ts;
TypeFlags[TypeFlags["ESSymbolLike"] = 12288] = "ESSymbolLike";
TypeFlags[TypeFlags["VoidLike"] = 49152] = "VoidLike";
/* @internal */
+ TypeFlags[TypeFlags["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable";
+ /* @internal */
TypeFlags[TypeFlags["DisjointDomains"] = 469892092] = "DisjointDomains";
TypeFlags[TypeFlags["UnionOrIntersection"] = 3145728] = "UnionOrIntersection";
TypeFlags[TypeFlags["StructuredType"] = 3670016] = "StructuredType";
@@ -5781,7 +5783,7 @@ var ts;
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
function getLevel(envVar, level) {
- return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase());
+ return system.getEnvironmentVariable("".concat(envVar, "_").concat(level.toUpperCase()));
}
function getCustomLevels(baseVariable) {
var customLevels;
@@ -6250,7 +6252,7 @@ var ts;
}
function onTimerToUpdateChildWatches() {
timerToUpdateChildWatches = undefined;
- sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size));
var start = ts.timestamp();
var invokeMap = new ts.Map();
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
@@ -6263,7 +6265,7 @@ var ts;
var hasChanges = updateChildWatches(dirName, dirPath, options);
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
}
- sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
+ sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size));
callbackCache.forEach(function (callbacks, rootDirName) {
var existing = invokeMap.get(rootDirName);
if (existing) {
@@ -6279,7 +6281,7 @@ var ts;
}
});
var elapsed = ts.timestamp() - start;
- sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
+ sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches));
}
function removeChildWatches(parentWatcher) {
if (!parentWatcher)
@@ -6739,7 +6741,7 @@ var ts;
var remappedPaths = new ts.Map();
var normalizedDir = ts.normalizeSlashes(__dirname);
// Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
- var fileUrlRoot = "file://" + (ts.getRootLength(normalizedDir) === 1 ? "" : "/") + normalizedDir;
+ var fileUrlRoot = "file://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(normalizedDir);
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
var node = _a[_i];
if (node.callFrame.url) {
@@ -6748,7 +6750,7 @@ var ts;
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
}
else if (!nativePattern.test(url)) {
- node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external" + externalFileCounter + ".js")).get(url);
+ node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external".concat(externalFileCounter, ".js"))).get(url);
externalFileCounter++;
}
}
@@ -6764,7 +6766,7 @@ var ts;
if (!err) {
try {
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
- profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
+ profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(process.pid, ".cpuprofile"));
}
}
catch (_c) {
@@ -6866,7 +6868,7 @@ var ts;
* @param createWatcher
*/
function invokeCallbackAndUpdateWatcher(createWatcher) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher"));
// Call the callback for current directory
callback("rename", "");
// If watcher is not closed, update it
@@ -6891,7 +6893,7 @@ var ts;
}
}
if (hitSystemWatcherLimit) {
- sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
try {
@@ -6907,7 +6909,7 @@ var ts;
// 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
// so instead of throwing error, use fs.watchFile
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
- sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
+ sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
return watchPresentFileSystemEntryWithFsWatchFile();
}
}
@@ -8070,6 +8072,8 @@ var ts;
Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),
+ Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, ts.DiagnosticCategory.Error, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."),
+ Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, ts.DiagnosticCategory.Error, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
@@ -9922,7 +9926,7 @@ var ts;
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
}
else {
- ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
+ 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"));
}
}
var res = lineStarts[line] + character;
@@ -12812,7 +12816,7 @@ var ts;
: "linkplain";
var name = link.name ? ts.entityNameToString(link.name) : "";
var space = link.name && link.text.startsWith("://") ? "" : " ";
- return "{@" + kind + " " + name + space + link.text + "}";
+ return "{@".concat(kind, " ").concat(name).concat(space).concat(link.text, "}");
}
/**
* Gets the effective type parameters. If the node was parsed in a
@@ -14069,11 +14073,11 @@ var ts;
}
function packageIdToPackageName(_a) {
var name = _a.name, subModuleName = _a.subModuleName;
- return subModuleName ? name + "/" + subModuleName : name;
+ return subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
}
ts.packageIdToPackageName = packageIdToPackageName;
function packageIdToString(packageId) {
- return packageIdToPackageName(packageId) + "@" + packageId.version;
+ return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version);
}
ts.packageIdToString = packageIdToString;
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
@@ -14156,7 +14160,7 @@ var ts;
function nodePosToString(node) {
var file = getSourceFileOfNode(node);
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
- return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
+ return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
}
ts.nodePosToString = nodePosToString;
function getEndLinePosition(line, sourceFile) {
@@ -14295,7 +14299,7 @@ var ts;
ts.isPinnedComment = isPinnedComment;
function createCommentDirectivesMap(sourceFile, commentDirectives) {
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
- "" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,
+ "".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
commentDirective,
]); }));
var usedLines = new ts.Map();
@@ -14312,10 +14316,10 @@ var ts;
});
}
function markUsed(line) {
- if (!directivesByLine.has("" + line)) {
+ if (!directivesByLine.has("".concat(line))) {
return false;
}
- usedLines.set("" + line, true);
+ usedLines.set("".concat(line), true);
return true;
}
}
@@ -14545,7 +14549,7 @@ var ts;
}
return node.text;
}
- return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
+ return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
}
ts.getLiteralText = getLiteralText;
function canUseOriginalText(node, flags) {
@@ -17126,11 +17130,11 @@ var ts;
}
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
function getPropertyNameForUniqueESSymbol(symbol) {
- return "__@" + ts.getSymbolId(symbol) + "@" + symbol.escapedName;
+ return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
}
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
- return "__#" + ts.getSymbolId(containingClassSymbol) + "@" + description;
+ return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
}
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
function isKnownSymbol(symbol) {
@@ -19832,7 +19836,7 @@ var ts;
}
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
function getJSXRuntimeImport(base, options) {
- return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
+ return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
}
ts.getJSXRuntimeImport = getJSXRuntimeImport;
function hasZeroOrOneAsteriskCharacter(str) {
@@ -19939,7 +19943,7 @@ var ts;
}
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
- var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))";
+ var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
var filesMatcher = {
/**
* Matches any single directory segment unless it is the last segment and a .min.js file
@@ -19952,7 +19956,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
};
var directoriesMatcher = {
@@ -19961,7 +19965,7 @@ var ts;
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
* files or directories, does not match subdirectories that start with a . character
*/
- doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
+ doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
};
var excludeMatcher = {
@@ -19979,10 +19983,10 @@ var ts;
if (!patterns || !patterns.length) {
return undefined;
}
- var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|");
+ var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
var terminator = usage === "exclude" ? "($|/)" : "$";
- return "^(" + pattern + ")" + terminator;
+ return "^(".concat(pattern, ")").concat(terminator);
}
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
function getRegularExpressionsForWildcards(specs, basePath, usage) {
@@ -20004,7 +20008,7 @@ var ts;
ts.isImplicitGlob = isImplicitGlob;
function getPatternFromSpec(spec, basePath, usage) {
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
- return pattern && "^(" + pattern + ")" + (usage === "exclude" ? "($|/)" : "$");
+ return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
}
ts.getPatternFromSpec = getPatternFromSpec;
function getSubPatternFromSpec(spec, basePath, usage, _a) {
@@ -20082,7 +20086,7 @@ var ts;
currentDirectory = ts.normalizePath(currentDirectory);
var absolutePath = ts.combinePaths(currentDirectory, path);
return {
- includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
+ includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
@@ -20363,7 +20367,7 @@ var ts;
*/
function extensionFromPath(path) {
var ext = tryGetExtensionFromPath(path);
- return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension.");
+ return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
}
ts.extensionFromPath = extensionFromPath;
function isAnySupportedFileExtension(path) {
@@ -26446,7 +26450,7 @@ var ts;
case 326 /* JSDocAugmentsTag */: return "augments";
case 327 /* JSDocImplementsTag */: return "implements";
default:
- return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
+ return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
}
}
var rawTextScanner;
@@ -26774,7 +26778,7 @@ var ts;
};
var definedTextGetter_1 = function (path) {
var result = textGetter_1(path);
- return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
+ return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
};
var buildInfo_1;
var getAndCacheBuildInfo_1 = function (getText) {
@@ -31312,7 +31316,7 @@ var ts;
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
var keyword = viableKeywordSuggestions_1[_i];
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
- return keyword + " " + expressionText.slice(keyword.length);
+ return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
}
}
return undefined;
@@ -38082,7 +38086,7 @@ var ts;
if (namedArgRegExCache.has(name)) {
return namedArgRegExCache.get(name);
}
- var result = new RegExp("(\\s" + name + "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))", "im");
+ var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
namedArgRegExCache.set(name, result);
return result;
}
@@ -39560,8 +39564,8 @@ var ts;
}
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
- var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
- return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
+ var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
+ return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
}
/* @internal */
function parseCustomTypeOption(opt, value, errors) {
@@ -40355,10 +40359,10 @@ var ts;
var newValue = compilerOptionsMap.get(cmd.name);
var defaultValue = getDefaultValueForOption(cmd);
if (newValue !== defaultValue) {
- result.push("" + tab + cmd.name + ": " + newValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
}
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
- result.push("" + tab + cmd.name + ": " + defaultValue);
+ result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
}
});
return result.join(newLine) + newLine;
@@ -40409,19 +40413,19 @@ var ts;
if (entries.length !== 0) {
entries.push({ value: "" });
}
- entries.push({ value: "/* " + category + " */" });
+ entries.push({ value: "/* ".concat(category, " */") });
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
var option = options_1[_i];
var optionName = void 0;
if (compilerOptionsMap.has(option.name)) {
- optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
+ optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
}
else {
- optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ",";
+ optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
}
entries.push({
value: optionName,
- description: "/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"
+ description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
});
marginLength = Math.max(optionName.length, marginLength);
}
@@ -40430,25 +40434,25 @@ var ts;
var tab = makePadding(2);
var result = [];
result.push("{");
- result.push(tab + "\"compilerOptions\": {");
- result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + " */");
+ result.push("".concat(tab, "\"compilerOptions\": {"));
+ 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), " */"));
result.push("");
// Print out each row, aligning all the descriptions on the same column.
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
var entry = entries_2[_a];
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
- result.push(value && "" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));
+ result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
}
if (fileNames.length) {
- result.push(tab + "},");
- result.push(tab + "\"files\": [");
+ result.push("".concat(tab, "},"));
+ result.push("".concat(tab, "\"files\": ["));
for (var i = 0; i < fileNames.length; i++) {
- result.push("" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? "" : ","));
+ result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
}
- result.push(tab + "]");
+ result.push("".concat(tab, "]"));
}
else {
- result.push(tab + "}");
+ result.push("".concat(tab, "}"));
}
result.push("}");
return result.join(newLine) + newLine;
@@ -40846,7 +40850,7 @@ var ts;
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
- extendedConfigPath = extendedConfigPath + ".json";
+ extendedConfigPath = "".concat(extendedConfigPath, ".json");
if (!host.fileExists(extendedConfigPath)) {
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
return undefined;
@@ -41091,7 +41095,7 @@ var ts;
// Valid only if *.json specified
if (!jsonOnlyIncludeRegexes) {
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
- var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^" + pattern + "$"; });
+ var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
}
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
@@ -41527,7 +41531,7 @@ var ts;
var bestVersionKey = result.version, bestVersionPaths = result.paths;
if (typeof bestVersionPaths !== "object") {
if (state.traceEnabled) {
- trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['" + bestVersionKey + "']", "object", typeof bestVersionPaths);
+ trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
}
return;
}
@@ -41934,7 +41938,7 @@ var ts;
};
return cache;
function getUnderlyingCacheKey(specifier, mode) {
- var result = mode === undefined ? specifier : mode + "|" + specifier;
+ var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
memoizedReverseKeys.set(result, [specifier, mode]);
return result;
}
@@ -41965,7 +41969,7 @@ var ts;
}
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
- return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode + "|" + nonRelativeModuleName, createPerModuleNameCache);
+ return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
}
function createPerModuleNameCache() {
var directoryPathMap = new ts.Map();
@@ -42112,10 +42116,10 @@ var ts;
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
break;
default:
- return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
+ return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
}
if (result && result.resolvedModule)
- ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
+ ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
if (perFolderCache) {
perFolderCache.set(moduleName, resolutionMode, result);
@@ -42318,7 +42322,7 @@ var ts;
function resolveJSModule(moduleName, initialDir, host) {
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
if (!resolvedModule) {
- throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", "));
+ throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
}
return resolvedModule.resolvedFileName;
}
@@ -42428,7 +42432,7 @@ var ts;
if (traceEnabled) {
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
}
- ts.Debug.assert(host.fileExists(real), path + " linked to nonexistent file " + real);
+ ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
return real;
}
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
@@ -42905,7 +42909,7 @@ var ts;
return undefined;
}
var trailingParts = parts.slice(nameParts.length);
- return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
+ return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
}
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
if (!scope.packageJsonContent.exports) {
@@ -43233,7 +43237,7 @@ var ts;
}
/* @internal */
function getTypesPackageName(packageName) {
- return "@types/" + mangleScopedPackageName(packageName);
+ return "@types/".concat(mangleScopedPackageName(packageName));
}
ts.getTypesPackageName = getTypesPackageName;
/* @internal */
@@ -43634,7 +43638,7 @@ var ts;
if (name) {
if (ts.isAmbientModule(node)) {
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
- return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
+ return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
}
if (name.kind === 161 /* ComputedPropertyName */) {
var nameExpression = name.expression;
@@ -43691,7 +43695,7 @@ var ts;
case 163 /* Parameter */:
// Parameters with names are handled at the top of this function. Parameters
// without names can only come from JSDocFunctionTypes.
- ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
+ 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"); });
var functionType = node.parent;
var index = functionType.parameters.indexOf(node);
return "arg" + index;
@@ -43803,7 +43807,7 @@ var ts;
var relatedInformation_1 = [];
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
// export type T; - may have meant export type { T }?
- relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { " + ts.unescapeLeadingUnderscores(node.name.escapedText) + " }"));
+ relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
}
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
ts.forEach(symbol.declarations, function (declaration, index) {
@@ -45879,7 +45883,7 @@ var ts;
}
}
function bindSourceFileAsExternalModule() {
- bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\"");
+ bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
}
function bindExportAssignment(node) {
if (!container.symbol || !container.symbol.exports) {
@@ -46930,8 +46934,7 @@ var ts;
IntersectionState[IntersectionState["Source"] = 1] = "Source";
IntersectionState[IntersectionState["Target"] = 2] = "Target";
IntersectionState[IntersectionState["PropertyCheck"] = 4] = "PropertyCheck";
- IntersectionState[IntersectionState["UnionIntersectionCheck"] = 8] = "UnionIntersectionCheck";
- IntersectionState[IntersectionState["InPropertyCheck"] = 16] = "InPropertyCheck";
+ IntersectionState[IntersectionState["InPropertyCheck"] = 8] = "InPropertyCheck";
})(IntersectionState || (IntersectionState = {}));
var RecursionFlags;
(function (RecursionFlags) {
@@ -47979,7 +47982,7 @@ var ts;
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
- var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + "|" + secondFile_1.path, function () {
+ var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
});
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
@@ -50632,7 +50635,7 @@ var ts;
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
- var key = (useOnlyExternalAliasing ? 0 : 1) + "|" + (firstRelevantLocation && getNodeId(firstRelevantLocation)) + "|" + meaning;
+ var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
if (cache.has(key)) {
return cache.get(key);
}
@@ -51481,7 +51484,7 @@ var ts;
context.symbolDepth = new ts.Map();
}
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
- var key = getTypeId(type) + "|" + context.flags;
+ var key = "".concat(getTypeId(type), "|").concat(context.flags);
if (links) {
links.serializedTypes || (links.serializedTypes = new ts.Map());
}
@@ -51750,7 +51753,7 @@ var ts;
}
}
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
- typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... " + (properties.length - i) + " more ...", /*questionToken*/ undefined, /*type*/ undefined));
+ typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
break;
}
@@ -51865,7 +51868,7 @@ var ts;
else if (types.length > 2) {
return [
typeToTypeNodeHelper(types[0], context),
- ts.factory.createTypeReferenceNode("... " + (types.length - 2) + " more ...", /*typeArguments*/ undefined),
+ ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
typeToTypeNodeHelper(types[types.length - 1], context)
];
}
@@ -51879,7 +51882,7 @@ var ts;
var type = types_2[_i];
i++;
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
- result_5.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined));
+ result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
if (typeNode_1) {
result_5.push(typeNode_1);
@@ -52402,7 +52405,7 @@ var ts;
var text = rawtext;
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
i++;
- text = rawtext + "_" + i;
+ text = "".concat(rawtext, "_").concat(i);
}
if (text !== rawtext) {
result = ts.factory.createIdentifier(text, result.typeArguments);
@@ -52722,7 +52725,7 @@ var ts;
function getNameForJSDocFunctionParameter(p, index) {
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
: getEffectiveDotDotDotForParameter(p) ? "args"
- : "arg" + index;
+ : "arg".concat(index);
}
function rewriteModuleSpecifier(parent, lit) {
if (bundled) {
@@ -53807,7 +53810,7 @@ var ts;
return results_1;
}
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
- return ts.Debug.fail("Unhandled class member kind! " + (p.__debugFlags || p.flags));
+ return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
};
}
function serializePropertySymbolForInterface(p, baseType) {
@@ -53882,7 +53885,7 @@ var ts;
if (ref) {
return ref;
}
- var tempName = getUnusedName(rootName + "_base");
+ var tempName = getUnusedName("".concat(rootName, "_base"));
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
], 2 /* Const */));
@@ -53929,7 +53932,7 @@ var ts;
var original = input;
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
i++;
- input = original + "_" + i;
+ input = "".concat(original, "_").concat(i);
}
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
if (id) {
@@ -54037,15 +54040,15 @@ var ts;
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
var name = "" + nameType.value;
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
- return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\"";
+ return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
}
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
- return "[" + name + "]";
+ return "[".concat(name, "]");
}
return name;
}
if (nameType.flags & 8192 /* UniqueESSymbol */) {
- return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
+ return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
}
}
}
@@ -56876,7 +56879,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -58827,7 +58830,7 @@ var ts;
return result;
}
function getAliasId(aliasSymbol, aliasTypeArguments) {
- return aliasSymbol ? "@" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? ":" + getTypeListId(aliasTypeArguments) : "") : "";
+ return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
}
// This function is used to propagate certain flags when creating new object type references and union types.
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
@@ -59013,7 +59016,7 @@ var ts;
return undefined;
}
function getSymbolPath(symbol) {
- return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
+ return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
}
function getUnresolvedSymbolForEntityName(name) {
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
@@ -59024,7 +59027,7 @@ var ts;
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
undefined;
- var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
+ var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
var result = unresolvedSymbols.get(path);
if (!result) {
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
@@ -59097,7 +59100,7 @@ var ts;
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
return baseType;
}
- var id = getTypeId(baseType) + ">" + getTypeId(substitute);
+ var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
var cached = substitutionTypes.get(id);
if (cached) {
return cached;
@@ -60021,9 +60024,9 @@ var ts;
return types[0];
}
var typeKey = !origin ? getTypeListId(types) :
- origin.flags & 1048576 /* Union */ ? "|" + getTypeListId(origin.types) :
- origin.flags & 2097152 /* Intersection */ ? "&" + getTypeListId(origin.types) :
- "#" + origin.type.id + "|" + getTypeListId(types); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
+ origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
+ origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
+ "#".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
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
var type = unionTypes.get(id);
if (!type) {
@@ -60545,7 +60548,7 @@ var ts;
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
return stringType;
}
- var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join("");
+ var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
var type = templateLiteralTypes.get(id);
if (!type) {
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
@@ -60605,7 +60608,7 @@ var ts;
return str;
}
function getStringMappingTypeForGenericType(symbol, type) {
- var id = getSymbolId(symbol) + "," + getTypeId(type);
+ var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
var result = stringMappingTypes.get(id);
if (!result) {
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
@@ -61622,7 +61625,7 @@ var ts;
function createUniqueESSymbolType(symbol) {
var type = createType(8192 /* UniqueESSymbol */);
type.symbol = symbol;
- type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
+ type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
return type;
}
function getESSymbolLikeTypeForNode(node) {
@@ -63217,11 +63220,11 @@ var ts;
var overflow = false;
var overrideNextErrorInfo = 0; // How many `reportRelationError` calls should be skipped in the elaboration pyramid
var lastSkippedInfo;
- var incompatibleStack = [];
+ var incompatibleStack;
var inPropertyCheck = false;
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
var result = isRelatedTo(source, target, 3 /* Both */, /*reportErrors*/ !!errorNode, headMessage);
- if (incompatibleStack.length) {
+ if (incompatibleStack) {
reportIncompatibleStack();
}
if (overflow) {
@@ -63278,19 +63281,19 @@ var ts;
return {
errorInfo: errorInfo,
lastSkippedInfo: lastSkippedInfo,
- incompatibleStack: incompatibleStack.slice(),
+ incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
overrideNextErrorInfo: overrideNextErrorInfo,
- relatedInfo: !relatedInfo ? undefined : relatedInfo.slice()
+ relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
};
}
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
overrideNextErrorInfo++; // Suppress the next relation error
lastSkippedInfo = undefined; // Reset skipped info cache
- incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
+ (incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
}
function reportIncompatibleStack() {
- var stack = incompatibleStack;
- incompatibleStack = [];
+ var stack = incompatibleStack || [];
+ incompatibleStack = undefined;
var info = lastSkippedInfo;
lastSkippedInfo = undefined;
if (stack.length === 1) {
@@ -63311,24 +63314,24 @@ var ts;
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
// Parenthesize a `new` if there is one
if (path.indexOf("new ") === 0) {
- path = "(" + path + ")";
+ path = "(".concat(path, ")");
}
var str = "" + args[0];
// If leading, just print back the arg (irrespective of if it's a valid identifier)
if (path.length === 0) {
- path = "" + str;
+ path = "".concat(str);
}
// Otherwise write a dotted name if possible
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
- path = path + "." + str;
+ path = "".concat(path, ".").concat(str);
}
// Failing that, check if the name is already a computed name
else if (str[0] === "[" && str[str.length - 1] === "]") {
- path = "" + path + str;
+ path = "".concat(path).concat(str);
}
// And finally write out a computed name as a last resort
else {
- path = path + "[" + str + "]";
+ path = "".concat(path, "[").concat(str, "]");
}
break;
}
@@ -63357,7 +63360,7 @@ var ts;
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
? ""
: "...";
- path = "" + prefix + path + "(" + params + ")";
+ path = "".concat(prefix).concat(path, "(").concat(params, ")");
}
break;
}
@@ -63370,7 +63373,7 @@ var ts;
break;
}
default:
- return ts.Debug.fail("Unhandled Diagnostic: " + msg.code);
+ return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
}
}
if (path) {
@@ -63396,7 +63399,7 @@ var ts;
}
function reportError(message, arg0, arg1, arg2, arg3) {
ts.Debug.assert(!!errorNode);
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
if (message.elidedInCompatabilityPyramid)
return;
@@ -63412,7 +63415,7 @@ var ts;
}
}
function reportRelationError(message, source, target) {
- if (incompatibleStack.length)
+ if (incompatibleStack)
reportIncompatibleStack();
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
var generalizedSource = source;
@@ -63524,7 +63527,9 @@ var ts;
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
return -1 /* True */;
}
- reportErrorResults(originalSource, originalTarget, 0 /* False */, !!(ts.getObjectFlags(originalSource) & 2048 /* JsxAttributes */));
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
+ }
return 0 /* False */;
}
// Normalize the source and target types: Turn fresh literal types into regular literal types,
@@ -63536,7 +63541,12 @@ var ts;
if (source === target)
return -1 /* True */;
if (relation === identityRelation) {
- return isIdenticalTo(source, target, recursionFlags);
+ if (source.flags !== target.flags)
+ return 0 /* False */;
+ if (source.flags & 67358815 /* Singleton */)
+ return -1 /* True */;
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
}
// We fastpath comparing a type parameter to exactly its constraint, as this is _super_ common,
// and otherwise, for type parameters in large unions, causes us to need to compare the union to itself,
@@ -63546,163 +63556,130 @@ var ts;
if (source.flags & 262144 /* TypeParameter */ && getConstraintOfType(source) === target) {
return -1 /* True */;
}
- // Try to see if we're relating something like `Foo` -> `Bar | null | undefined`.
- // If so, reporting the `null` and `undefined` in the type is hardly useful.
- // First, see if we're even relating an object type to a union.
- // Then see if the target is stripped down to a single non-union type.
- // Note
- // * We actually want to remove null and undefined naively here (rather than using getNonNullableType),
- // since we don't want to end up with a worse error like "`Foo` is not assignable to `NonNullable`"
- // when dealing with generics.
- // * We also don't deal with primitive source types, since we already halt elaboration below.
- if (target.flags & 1048576 /* Union */ && source.flags & 524288 /* Object */ &&
- target.types.length <= 3 && maybeTypeOfKind(target, 98304 /* Nullable */)) {
- var nullStrippedTarget = extractTypesOfKind(target, ~98304 /* Nullable */);
- if (!(nullStrippedTarget.flags & (1048576 /* Union */ | 131072 /* Never */))) {
- target = getNormalizedType(nullStrippedTarget, /*writing*/ true);
+ // See if we're relating a definitely non-nullable type to a union that includes null and/or undefined
+ // plus a single non-nullable type. If so, remove null and/or undefined from the target type.
+ if (source.flags & 470302716 /* DefinitelyNonNullable */ && target.flags & 1048576 /* Union */) {
+ var types = target.types;
+ var candidate = types.length === 2 && types[0].flags & 98304 /* Nullable */ ? types[1] :
+ types.length === 3 && types[0].flags & 98304 /* Nullable */ && types[1].flags & 98304 /* Nullable */ ? types[2] :
+ undefined;
+ if (candidate && !(candidate.flags & 98304 /* Nullable */)) {
+ target = getNormalizedType(candidate, /*writing*/ true);
+ if (source === target)
+ return -1 /* True */;
}
- if (source === nullStrippedTarget)
- return -1 /* True */;
}
if (relation === comparableRelation && !(target.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) ||
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
return -1 /* True */;
- var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
- var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
- if (isPerformingExcessPropertyChecks) {
- if (hasExcessProperties(source, target, reportErrors)) {
+ if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {
+ var isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384 /* FreshLiteral */);
+ if (isPerformingExcessPropertyChecks) {
+ if (hasExcessProperties(source, target, reportErrors)) {
+ if (reportErrors) {
+ reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ }
+ return 0 /* False */;
+ }
+ }
+ var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
+ source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
+ target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
+ (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
+ var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048 /* JsxAttributes */);
+ if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
if (reportErrors) {
- reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
+ var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
+ var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
+ var calls = getSignaturesOfType(source, 0 /* Call */);
+ var constructs = getSignaturesOfType(source, 1 /* Construct */);
+ if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
+ constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
+ reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
+ }
+ else {
+ reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
+ }
}
return 0 /* False */;
}
- }
- var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2 /* Target */) &&
- source.flags & (131068 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source !== globalObjectType &&
- target.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target) &&
- (getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
- if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
- if (reportErrors) {
- var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
- var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
- var calls = getSignaturesOfType(source, 0 /* Call */);
- var constructs = getSignaturesOfType(source, 1 /* Construct */);
- if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1 /* Source */, /*reportErrors*/ false) ||
- constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1 /* Source */, /*reportErrors*/ false)) {
- reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
- }
- else {
- reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
- }
+ traceUnionsOrIntersectionsTooLarge(source, target);
+ var skipCaching = source.flags & 1048576 /* Union */ && source.types.length < 4 && !(target.flags & 1048576 /* Union */) ||
+ target.flags & 1048576 /* Union */ && target.types.length < 4 && !(source.flags & 469499904 /* StructuredOrInstantiable */);
+ var result_7 = skipCaching ?
+ unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
+ recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
+ // For certain combinations involving intersections and optional, excess, or mismatched properties we need
+ // an extra property check where the intersection is viewed as a single object. The following are motivating
+ // examples that all should be errors, but aren't without this extra property check:
+ //
+ // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
+ //
+ // declare let wrong: { a: { y: string } };
+ // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
+ //
+ // function foo(x: { a?: string }, y: T & { a: boolean }) {
+ // x = y; // Mismatched property in source intersection
+ // }
+ //
+ // We suppress recursive intersection property checks because they can generate lots of work when relating
+ // recursive intersections that are structurally similar but not exactly identical. See #37854.
+ if (result_7 && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
+ isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
+ inPropertyCheck = true;
+ result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
+ inPropertyCheck = false;
}
- return 0 /* False */;
- }
- traceUnionsOrIntersectionsTooLarge(source, target);
- var result = 0 /* False */;
- var saveErrorInfo = captureErrorCalculationState();
- if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
- // We skip caching when source or target is a union with no more than three constituents.
- result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
- }
- else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
- result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
- }
- if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
- if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
- resetErrorInfo(saveErrorInfo);
+ if (result_7) {
+ return result_7;
}
}
- if (!result && source.flags & (2097152 /* Intersection */ | 262144 /* TypeParameter */)) {
- // The combined constraint of an intersection type is the intersection of the constraints of
- // the constituents. When an intersection type contains instantiable types with union type
- // constraints, there are situations where we need to examine the combined constraint. One is
- // when the target is a union type. Another is when the intersection contains types belonging
- // to one of the disjoint domains. For example, given type variables T and U, each with the
- // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
- // we need to check this constraint against a union on the target side. Also, given a type
- // variable V constrained to 'string | number', 'V & number' has a combined constraint of
- // 'string & number | number & number' which reduces to just 'number'.
- // This also handles type parameters, as a type parameter with a union constraint compared against a union
- // needs to have its constraint hoisted into an intersection with said type parameter, this way
- // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
- // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
- var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
- if (constraint && (source.flags & 2097152 /* Intersection */ || target.flags & 1048576 /* Union */)) {
- if (everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
- // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
- if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
- resetErrorInfo(saveErrorInfo);
- }
- }
+ if (reportErrors) {
+ reportErrorResults(originalSource, originalTarget, source, target, headMessage);
+ }
+ return 0 /* False */;
+ }
+ function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
+ var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
+ var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
+ source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
+ target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
+ var maybeSuppress = overrideNextErrorInfo > 0;
+ if (maybeSuppress) {
+ overrideNextErrorInfo--;
+ }
+ if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
+ var currentError = errorInfo;
+ tryElaborateArrayLikeErrors(source, target, /*reportErrors*/ true);
+ if (errorInfo !== currentError) {
+ maybeSuppress = !!errorInfo;
}
}
- // For certain combinations involving intersections and optional, excess, or mismatched properties we need
- // an extra property check where the intersection is viewed as a single object. The following are motivating
- // examples that all should be errors, but aren't without this extra property check:
- //
- // let obj: { a: { x: string } } & { c: number } = { a: { x: 'hello', y: 2 }, c: 5 }; // Nested excess property
- //
- // declare let wrong: { a: { y: string } };
- // let weak: { a?: { x?: number } } & { c?: string } = wrong; // Nested weak object type
- //
- // function foo(x: { a?: string }, y: T & { a: boolean }) {
- // x = y; // Mismatched property in source intersection
- // }
- //
- // We suppress recursive intersection property checks because they can generate lots of work when relating
- // recursive intersections that are structurally similar but not exactly identical. See #37854.
- if (result && !inPropertyCheck && (target.flags & 2097152 /* Intersection */ && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
- isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 /* Intersection */ && getApparentType(source).flags & 3670016 /* StructuredType */ && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288 /* NonInferrableType */); }))) {
- inPropertyCheck = true;
- result &= recursiveTypeRelatedTo(source, target, reportErrors, 4 /* PropertyCheck */, recursionFlags);
- inPropertyCheck = false;
+ if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
+ tryElaborateErrorsForPrimitivesAndObjects(source, target);
}
- reportErrorResults(source, target, result, isComparingJsxAttributes);
- return result;
- function reportErrorResults(source, target, result, isComparingJsxAttributes) {
- if (!result && reportErrors) {
- var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
- var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
- source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
- target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
- var maybeSuppress = overrideNextErrorInfo > 0;
- if (maybeSuppress) {
- overrideNextErrorInfo--;
- }
- if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) {
- var currentError = errorInfo;
- tryElaborateArrayLikeErrors(source, target, reportErrors);
- if (errorInfo !== currentError) {
- maybeSuppress = !!errorInfo;
- }
- }
- if (source.flags & 524288 /* Object */ && target.flags & 131068 /* Primitive */) {
- tryElaborateErrorsForPrimitivesAndObjects(source, target);
- }
- else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
- reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
- }
- else if (isComparingJsxAttributes && target.flags & 2097152 /* Intersection */) {
- var targetTypes = target.types;
- var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
- var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
- if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
- (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
- // do not report top error
- return result;
- }
- }
- else {
- errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
- }
- if (!headMessage && maybeSuppress) {
- lastSkippedInfo = [source, target];
- // Used by, eg, missing property checking to replace the top-level message with a more informative one
- return result;
- }
- reportRelationError(headMessage, source, target);
+ else if (source.symbol && source.flags & 524288 /* Object */ && globalObjectType === source) {
+ reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
+ }
+ else if (ts.getObjectFlags(source) & 2048 /* JsxAttributes */ && target.flags & 2097152 /* Intersection */) {
+ var targetTypes = target.types;
+ var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
+ var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
+ if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
+ (ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
+ // do not report top error
+ return;
}
}
+ else {
+ errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
+ }
+ if (!headMessage && maybeSuppress) {
+ lastSkippedInfo = [source, target];
+ // Used by, eg, missing property checking to replace the top-level message with a more informative one
+ return;
+ }
+ reportRelationError(headMessage, source, target);
}
function traceUnionsOrIntersectionsTooLarge(source, target) {
if (!ts.tracing) {
@@ -63729,21 +63706,6 @@ var ts;
}
}
}
- function isIdenticalTo(source, target, recursionFlags) {
- if (source.flags !== target.flags)
- return 0 /* False */;
- if (source.flags & 67358815 /* Singleton */)
- return -1 /* True */;
- traceUnionsOrIntersectionsTooLarge(source, target);
- if (source.flags & 3145728 /* UnionOrIntersection */) {
- var result_7 = eachTypeRelatedToSomeType(source, target);
- if (result_7) {
- result_7 &= eachTypeRelatedToSomeType(target, source);
- }
- return result_7;
- }
- return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false, 0 /* None */, recursionFlags);
- }
function getTypeOfPropertyInTypes(types, name) {
var appendPropType = function (propTypes, type) {
var _a;
@@ -63842,6 +63804,41 @@ var ts;
function shouldCheckAsExcessProperty(prop, container) {
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
}
+ function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
+ // Note that these checks are specifically ordered to produce correct results. In particular,
+ // we need to deconstruct unions before intersections (because unions are always at the top),
+ // and we need to handle "each" relations before "some" relations for the same kind of type.
+ if (source.flags & 1048576 /* Union */) {
+ return relation === comparableRelation ?
+ someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState) :
+ eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState);
+ }
+ if (target.flags & 1048576 /* Union */) {
+ return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
+ }
+ if (target.flags & 2097152 /* Intersection */) {
+ return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
+ }
+ // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
+ // constraints of all non-primitive types in the source into a new intersection. We do this because the
+ // intersection may further constrain the constraints of the non-primitive types. For example, given a type
+ // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
+ // appear to be comparable to '2'.
+ if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
+ var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
+ if (constraints !== source.types) {
+ source = getIntersectionType(constraints);
+ if (!(source.flags & 2097152 /* Intersection */)) {
+ return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
+ }
+ }
+ }
+ // Check to see if any constituents of the intersection are immediately related to the target.
+ // Don't report errors though. Elaborating on whether a source constituent is related to the target is
+ // not actually useful and leads to some confusing error messages. Instead, we rely on the caller
+ // checking whether the full intersection viewed as an object is related to the target.
+ return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
+ }
function eachTypeRelatedToSomeType(source, target) {
var result = -1 /* True */;
var sourceTypes = source.types;
@@ -63877,8 +63874,11 @@ var ts;
}
}
if (reportErrors) {
+ // Elaborate only if we can find a best matching type in the target union
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
- isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], 2 /* Target */, /*reportErrors*/ true);
+ if (bestMatchingType) {
+ isRelatedTo(source, bestMatchingType, 2 /* Target */, /*reportErrors*/ true);
+ }
}
return 0 /* False */;
}
@@ -64014,7 +64014,7 @@ var ts;
if (overflow) {
return 0 /* False */;
}
- var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0);
+ var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 /* InPropertyCheck */ : 0);
var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false);
var entry = relation.get(id);
if (entry !== undefined) {
@@ -64082,6 +64082,7 @@ var ts;
return originalHandler(onlyUnreliable);
};
}
+ var result;
if (expandingFlags === 3 /* Both */) {
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes" /* CheckTypes */, "recursiveTypeRelatedTo_DepthLimit", {
sourceId: source.id,
@@ -64091,8 +64092,13 @@ var ts;
depth: sourceDepth,
targetDepth: targetDepth
});
+ result = 3 /* Maybe */;
+ }
+ else {
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
+ result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
}
- var result = expandingFlags !== 3 /* Both */ ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3 /* Maybe */;
if (outofbandVarianceMarkerHandler) {
outofbandVarianceMarkerHandler = originalHandler;
}
@@ -64124,98 +64130,97 @@ var ts;
return result;
}
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* CheckTypes */, "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
- var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
- return result;
- }
- function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
if (intersectionState & 4 /* PropertyCheck */) {
return propertiesRelatedTo(source, target, reportErrors, /*excludedProperties*/ undefined, 0 /* None */);
}
- if (intersectionState & 8 /* UnionIntersectionCheck */) {
- // Note that these checks are specifically ordered to produce correct results. In particular,
- // we need to deconstruct unions before intersections (because unions are always at the top),
- // and we need to handle "each" relations before "some" relations for the same kind of type.
- if (source.flags & 1048576 /* Union */) {
- return relation === comparableRelation ?
- someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */) :
- eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068 /* Primitive */), intersectionState & ~8 /* UnionIntersectionCheck */);
- }
- if (target.flags & 1048576 /* Union */) {
- return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
- }
- if (target.flags & 2097152 /* Intersection */) {
- return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
- }
- // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
- // constraints of all non-primitive types in the source into a new intersection. We do this because the
- // intersection may further constrain the constraints of the non-primitive types. For example, given a type
- // parameter 'T extends 1 | 2', the intersection 'T & 1' should be reduced to '1' such that it doesn't
- // appear to be comparable to '2'.
- if (relation === comparableRelation && target.flags & 131068 /* Primitive */) {
- var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
- if (constraints !== source.types) {
- source = getIntersectionType(constraints);
- if (!(source.flags & 2097152 /* Intersection */)) {
- return isRelatedTo(source, target, 1 /* Source */, /*reportErrors*/ false);
- }
+ var result;
+ var originalErrorInfo;
+ var varianceCheckFailed = false;
+ var saveErrorInfo = captureErrorCalculationState();
+ var sourceFlags = source.flags;
+ var targetFlags = target.flags;
+ if (relation === identityRelation) {
+ // We've already checked that source.flags and target.flags are identical
+ if (sourceFlags & 3145728 /* UnionOrIntersection */) {
+ var result_8 = eachTypeRelatedToSomeType(source, target);
+ if (result_8) {
+ result_8 &= eachTypeRelatedToSomeType(target, source);
}
+ return result_8;
}
- // Check to see if any constituents of the intersection are immediately related to the target.
- //
- // Don't report errors though. Checking whether a constituent is related to the source is not actually
- // useful and leads to some confusing error messages. Instead it is better to let the below checks
- // take care of this, or to not elaborate at all. For instance,
- //
- // - For an object type (such as 'C = A & B'), users are usually more interested in structural errors.
- //
- // - For a union type (such as '(A | B) = (C & D)'), it's better to hold onto the whole intersection
- // than to report that 'D' is not assignable to 'A' or 'B'.
- //
- // - For a primitive type or type parameter (such as 'number = A & B') there is no point in
- // breaking the intersection apart.
- return someTypeRelatedToType(source, target, /*reportErrors*/ false, 1 /* Source */);
- }
- var flags = source.flags & target.flags;
- if (relation === identityRelation && !(flags & 524288 /* Object */)) {
- if (flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
return isRelatedTo(source.type, target.type, 3 /* Both */, /*reportErrors*/ false);
}
- var result_8 = 0 /* False */;
- if (flags & 8388608 /* IndexedAccess */) {
- if (result_8 = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
+ if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.indexType, target.indexType, 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
- if (flags & 16777216 /* Conditional */) {
+ if (sourceFlags & 16777216 /* Conditional */) {
if (source.root.isDistributive === target.root.isDistributive) {
- if (result_8 = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
- return result_8;
+ if (result = isRelatedTo(source.checkType, target.checkType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(source.extendsType, target.extendsType, 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3 /* Both */, /*reportErrors*/ false)) {
+ return result;
}
}
}
}
}
}
- if (flags & 33554432 /* Substitution */) {
+ if (sourceFlags & 33554432 /* Substitution */) {
return isRelatedTo(source.substitute, target.substitute, 3 /* Both */, /*reportErrors*/ false);
}
- return 0 /* False */;
+ if (!(sourceFlags & 524288 /* Object */)) {
+ return 0 /* False */;
+ }
+ }
+ else if (sourceFlags & 3145728 /* UnionOrIntersection */ || targetFlags & 3145728 /* UnionOrIntersection */) {
+ if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
+ return result;
+ }
+ if (source.flags & 2097152 /* Intersection */ || source.flags & 262144 /* TypeParameter */ && target.flags & 1048576 /* Union */) {
+ // The combined constraint of an intersection type is the intersection of the constraints of
+ // the constituents. When an intersection type contains instantiable types with union type
+ // constraints, there are situations where we need to examine the combined constraint. One is
+ // when the target is a union type. Another is when the intersection contains types belonging
+ // to one of the disjoint domains. For example, given type variables T and U, each with the
+ // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
+ // we need to check this constraint against a union on the target side. Also, given a type
+ // variable V constrained to 'string | number', 'V & number' has a combined constraint of
+ // 'string & number | number & number' which reduces to just 'number'.
+ // This also handles type parameters, as a type parameter with a union constraint compared against a union
+ // needs to have its constraint hoisted into an intersection with said type parameter, this way
+ // the type param can be compared with itself in the target (with the influence of its constraint to match other parts)
+ // For example, if `T extends 1 | 2` and `U extends 2 | 3` and we compare `T & U` to `T & U & (1 | 2 | 3)`
+ var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 /* Intersection */ ? source.types : [source], !!(target.flags & 1048576 /* Union */));
+ if (constraint && everyType(constraint, function (c) { return c !== source; })) { // Skip comparison if expansion contains the source itself
+ // TODO: Stack errors so we get a pyramid for the "normal" comparison above, _and_ a second for this
+ if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
+ resetErrorInfo(saveErrorInfo);
+ return result;
+ }
+ }
+ }
+ // The ordered decomposition above doesn't handle all cases. Specifically, we also need to handle:
+ // Source is instantiable (e.g. source has union or intersection constraint).
+ // Source is an object, target is a union (e.g. { a, b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target is an object (e.g. { a } & { b } <=> { a, b }).
+ // Source is an intersection, target is a union (e.g. { a } & { b: boolean } <=> { a, b: true } | { a, b: false }).
+ // Source is an intersection, target instantiable (e.g. string & { tag } <=> T["a"] constrained to string & { tag }).
+ if (!(sourceFlags & 465829888 /* Instantiable */ ||
+ sourceFlags & 524288 /* Object */ && targetFlags & 1048576 /* Union */ ||
+ sourceFlags & 2097152 /* Intersection */ && targetFlags & (524288 /* Object */ | 1048576 /* Union */ | 465829888 /* Instantiable */))) {
+ return 0 /* False */;
+ }
}
- var result;
- var originalErrorInfo;
- var varianceCheckFailed = false;
- var saveErrorInfo = captureErrorCalculationState();
// We limit alias variance probing to only object and conditional types since their alias behavior
// is more predictable than other, interned types, which may or may not have an alias depending on
// the order in which things were checked.
- if (source.flags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
+ if (sourceFlags & (524288 /* Object */ | 16777216 /* Conditional */) && source.aliasSymbol &&
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
var variances = getAliasVariances(source.aliasSymbol);
@@ -64233,7 +64238,7 @@ var ts;
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2 /* Target */))) {
return result;
}
- if (target.flags & 262144 /* TypeParameter */) {
+ if (targetFlags & 262144 /* TypeParameter */) {
// A source type { [P in Q]: X } is related to a target type T if keyof T is related to Q and X is related to T[Q].
if (ts.getObjectFlags(source) & 32 /* Mapped */ && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3 /* Both */)) {
if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) {
@@ -64245,10 +64250,10 @@ var ts;
}
}
}
- else if (target.flags & 4194304 /* Index */) {
+ else if (targetFlags & 4194304 /* Index */) {
var targetType_1 = target.type;
// A keyof S is related to a keyof T if T is related to S.
- if (source.flags & 4194304 /* Index */) {
+ if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(targetType_1, source.type, 3 /* Both */, /*reportErrors*/ false)) {
return result;
}
@@ -64299,8 +64304,8 @@ var ts;
}
}
}
- else if (target.flags & 8388608 /* IndexedAccess */) {
- if (source.flags & 8388608 /* IndexedAccess */) {
+ else if (targetFlags & 8388608 /* IndexedAccess */) {
+ if (sourceFlags & 8388608 /* IndexedAccess */) {
// Relate components directly before falling back to constraint relationships
// A type S[K] is related to a type T[J] if S is related to T and K is related to J.
if (result = isRelatedTo(source.objectType, target.objectType, 3 /* Both */, reportErrors)) {
@@ -64406,7 +64411,7 @@ var ts;
}
}
}
- else if (target.flags & 16777216 /* Conditional */) {
+ else if (targetFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
@@ -64431,8 +64436,8 @@ var ts;
}
}
}
- else if (target.flags & 134217728 /* TemplateLiteral */) {
- if (source.flags & 134217728 /* TemplateLiteral */) {
+ else if (targetFlags & 134217728 /* TemplateLiteral */) {
+ if (sourceFlags & 134217728 /* TemplateLiteral */) {
if (relation === comparableRelation) {
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 /* False */ : -1 /* True */;
}
@@ -64444,11 +64449,11 @@ var ts;
return -1 /* True */;
}
}
- if (source.flags & 8650752 /* TypeVariable */) {
- // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
- if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
+ if (sourceFlags & 8650752 /* TypeVariable */) {
+ // IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
+ if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
var constraint = getConstraintOfType(source);
- if (!constraint || (source.flags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
+ if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
// A type variable with no constraint is not related to the non-primitive object type.
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
resetErrorInfo(saveErrorInfo);
@@ -64461,7 +64466,7 @@ var ts;
return result;
}
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
- else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(target.flags & source.flags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
+ else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
resetErrorInfo(saveErrorInfo);
return result;
}
@@ -64478,14 +64483,14 @@ var ts;
}
}
}
- else if (source.flags & 4194304 /* Index */) {
+ else if (sourceFlags & 4194304 /* Index */) {
if (result = isRelatedTo(keyofConstraintType, target, 1 /* Source */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
}
}
- else if (source.flags & 134217728 /* TemplateLiteral */ && !(target.flags & 524288 /* Object */)) {
- if (!(target.flags & 134217728 /* TemplateLiteral */)) {
+ else if (sourceFlags & 134217728 /* TemplateLiteral */ && !(targetFlags & 524288 /* Object */)) {
+ if (!(targetFlags & 134217728 /* TemplateLiteral */)) {
var constraint = getBaseConstraintOfType(source);
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1 /* Source */, reportErrors))) {
resetErrorInfo(saveErrorInfo);
@@ -64493,8 +64498,8 @@ var ts;
}
}
}
- else if (source.flags & 268435456 /* StringMapping */) {
- if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
+ else if (sourceFlags & 268435456 /* StringMapping */) {
+ if (targetFlags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
resetErrorInfo(saveErrorInfo);
return result;
@@ -64508,14 +64513,14 @@ var ts;
}
}
}
- else if (source.flags & 16777216 /* Conditional */) {
+ else if (sourceFlags & 16777216 /* Conditional */) {
// If we reach 10 levels of nesting for the same conditional type, assume it is an infinitely expanding recursive
// conditional type and bail out with a Ternary.Maybe result.
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
resetErrorInfo(saveErrorInfo);
return 3 /* Maybe */;
}
- if (target.flags & 16777216 /* Conditional */) {
+ if (targetFlags & 16777216 /* Conditional */) {
// Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if
// one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2,
// and Y1 is related to Y2.
@@ -64575,9 +64580,10 @@ var ts;
}
return 0 /* False */;
}
- var sourceIsPrimitive = !!(source.flags & 131068 /* Primitive */);
+ var sourceIsPrimitive = !!(sourceFlags & 131068 /* Primitive */);
if (relation !== identityRelation) {
source = getApparentType(source);
+ sourceFlags = source.flags;
}
else if (isGenericMappedType(source)) {
return 0 /* False */;
@@ -64619,7 +64625,7 @@ var ts;
// In a check of the form X = A & B, we will have previously checked if A relates to X or B relates
// to X. Failing both of those we want to check if the aggregation of A and B's members structurally
// relates to X. Thus, we include intersection types on the source side here.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 524288 /* Object */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
// Report structural errors only if we haven't reported any errors yet
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
result = propertiesRelatedTo(source, target, reportStructuralErrors, /*excludedProperties*/ undefined, intersectionState);
@@ -64643,7 +64649,7 @@ var ts;
// there exists a constituent of T for every combination of the discriminants of S
// with respect to T. We do not report errors here, as we will use the existing
// error result from checking each constituent of the union.
- if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
+ if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 1048576 /* Union */) {
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
if (objectOnlyTarget.flags & 1048576 /* Union */) {
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
@@ -65158,7 +65164,6 @@ var ts;
}
}
var result = -1 /* True */;
- var saveErrorInfo = captureErrorCalculationState();
var incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
var sourceObjectFlags = ts.getObjectFlags(source);
var targetObjectFlags = ts.getObjectFlags(target);
@@ -65199,6 +65204,7 @@ var ts;
else {
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
var t = targetSignatures_1[_i];
+ var saveErrorInfo = captureErrorCalculationState();
// Only elaborate errors from the first failure
var shouldElaborateErrors = reportErrors;
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
@@ -65572,7 +65578,7 @@ var ts;
var constraintMarker = "";
var sourceId = getTypeReferenceId(source, 0);
var targetId = getTypeReferenceId(target, 0);
- return "" + constraintMarker + sourceId + "," + targetId + postFix;
+ return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
// getTypeReferenceId(A) returns "111=0-12=1"
// where A.id=111 and number.id=12
function getTypeReferenceId(type, depth) {
@@ -65616,7 +65622,7 @@ var ts;
var postFix = intersectionState ? ":" + intersectionState : "";
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
- source.id + "," + target.id + postFix;
+ "".concat(source.id, ",").concat(target.id).concat(postFix);
}
// Invoke the callback for each underlying property symbol of the given symbol and return the first
// value that isn't undefined.
@@ -67743,11 +67749,11 @@ var ts;
case 79 /* Identifier */:
if (!ts.isThisInTypeQuery(node)) {
var symbol = getResolvedSymbol(node);
- return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
+ return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
}
// falls through
case 108 /* ThisKeyword */:
- return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
+ return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
case 229 /* NonNullExpression */:
case 211 /* ParenthesizedExpression */:
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
@@ -68369,9 +68375,6 @@ var ts;
getUnionType(ts.map(type.types, mapper), 1 /* Literal */, aliasSymbol, aliasTypeArguments) :
mapType(type, mapper);
}
- function getConstituentCount(type) {
- return type.flags & 1048576 /* Union */ ? type.types.length : 1;
- }
function extractTypesOfKind(type, kind) {
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
}
@@ -69945,7 +69948,7 @@ var ts;
var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
+ return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
}
function isExportOrExportExpression(location) {
return !!ts.findAncestor(location, function (n) {
@@ -71636,7 +71639,7 @@ var ts;
!leftName ? rightName :
!rightName ? leftName :
undefined;
- var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
+ var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
}
@@ -76037,21 +76040,22 @@ var ts;
if (links.type === unknownType) {
links.type = getTypeFromBindingPattern(declaration.name);
}
- assignBindingElementTypes(declaration.name);
+ assignBindingElementTypes(declaration.name, links.type);
}
}
}
// When contextual typing assigns a type to a parameter that contains a binding pattern, we also need to push
// the destructured type into the contained binding elements.
- function assignBindingElementTypes(pattern) {
+ function assignBindingElementTypes(pattern, parentType) {
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
var element = _a[_i];
if (!ts.isOmittedExpression(element)) {
+ var type = getBindingElementTypeFromParentType(element, parentType);
if (element.name.kind === 79 /* Identifier */) {
- getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
+ getSymbolLinks(getSymbolOfNode(element)).type = type;
}
else {
- assignBindingElementTypes(element.name);
+ assignBindingElementTypes(element.name, type);
}
}
}
@@ -79792,28 +79796,24 @@ var ts;
if (returnType.flags & 1 /* Any */) {
return;
}
+ var headMessage;
var expectedReturnType;
- var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
- var errorInfo;
switch (node.parent.kind) {
case 256 /* ClassDeclaration */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var classSymbol = getSymbolOfNode(node.parent);
var classConstructorType = getTypeOfSymbol(classSymbol);
expectedReturnType = getUnionType([classConstructorType, voidType]);
break;
- case 163 /* Parameter */:
- expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
- break;
case 166 /* PropertyDeclaration */:
+ case 163 /* Parameter */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
expectedReturnType = voidType;
- errorInfo = ts.chainDiagnosticMessages(
- /*details*/ undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
break;
case 168 /* MethodDeclaration */:
case 171 /* GetAccessor */:
case 172 /* SetAccessor */:
+ headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
var methodType = getTypeOfNode(node.parent);
var descriptorType = createTypedPropertyDescriptorType(methodType);
expectedReturnType = getUnionType([descriptorType, voidType]);
@@ -79821,7 +79821,7 @@ var ts;
default:
return ts.Debug.fail();
}
- checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; });
+ checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
}
/**
* If a TypeNode can be resolved to a value symbol imported from an external module, it is
@@ -81503,7 +81503,7 @@ var ts;
function getPropertyNameForKnownSymbolName(symbolName) {
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
- return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
+ return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
}
/**
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
@@ -82094,9 +82094,9 @@ var ts;
var containsArguments = containsArgumentsReference(node);
if (containsArguments) {
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
- if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
+ if (isJs && lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
- errorOrSuggestion(isJs, lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
+ error(lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
}
}
else {
@@ -82106,7 +82106,9 @@ var ts;
return;
}
if (ts.isQualifiedName(name)) {
- errorOrSuggestion(isJs, name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ if (isJs) {
+ error(name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
+ }
}
else {
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
@@ -87285,29 +87287,28 @@ var ts;
}
function findMostOverlappyType(source, unionTarget) {
var bestMatch;
- var matchingCount = 0;
- for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
- var target = _a[_i];
- var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
- if (overlap.flags & 4194304 /* Index */) {
- // perfect overlap of keys
- bestMatch = target;
- matchingCount = Infinity;
- }
- else if (overlap.flags & 1048576 /* Union */) {
- // We only want to account for literal types otherwise.
- // If we have a union of index types, it seems likely that we
- // needed to elaborate between two generic mapped types anyway.
- var len = ts.length(ts.filter(overlap.types, isUnitType));
- if (len >= matchingCount) {
- bestMatch = target;
- matchingCount = len;
+ if (!(source.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var matchingCount = 0;
+ for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
+ var target = _a[_i];
+ if (!(target.flags & (131068 /* Primitive */ | 406847488 /* InstantiablePrimitive */))) {
+ var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
+ if (overlap.flags & 4194304 /* Index */) {
+ // perfect overlap of keys
+ return target;
+ }
+ else if (isUnitType(overlap) || overlap.flags & 1048576 /* Union */) {
+ // We only want to account for literal types otherwise.
+ // If we have a union of index types, it seems likely that we
+ // needed to elaborate between two generic mapped types anyway.
+ var len = overlap.flags & 1048576 /* Union */ ? ts.countWhere(overlap.types, isUnitType) : 1;
+ if (len >= matchingCount) {
+ bestMatch = target;
+ matchingCount = len;
+ }
+ }
}
}
- else if (isUnitType(overlap) && 1 >= matchingCount) {
- bestMatch = target;
- matchingCount = 1;
- }
}
return bestMatch;
}
@@ -88555,7 +88556,7 @@ var ts;
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
value === 62 ? 43 /* plus */ :
value === 63 ? 47 /* slash */ :
- ts.Debug.fail(value + ": not a base64 value");
+ ts.Debug.fail("".concat(value, ": not a base64 value"));
}
function base64FormatDecode(ch) {
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
@@ -88630,7 +88631,7 @@ var ts;
var mappings = ts.arrayFrom(decoder, processMapping);
if (decoder.error !== undefined) {
if (host.log) {
- host.log("Encountered error while decoding sourcemap: " + decoder.error);
+ host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
}
decodedMappings = ts.emptyArray;
}
@@ -92305,7 +92306,7 @@ var ts;
var propertyName = ts.isPropertyAccessExpression(originalNode)
? ts.declarationNameToString(originalNode.name)
: ts.getTextOfNode(originalNode.argumentExpression);
- ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
+ ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
}
return substitute;
}
@@ -93781,8 +93782,8 @@ var ts;
}
function createHoistedVariableForClass(name, node) {
var className = getPrivateIdentifierEnvironment().className;
- var prefix = className ? "_" + className : "";
- var identifier = factory.createUniqueName(prefix + "_" + name, 16 /* Optimistic */);
+ var prefix = className ? "_".concat(className) : "";
+ var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
addBlockScopedVariable(identifier);
}
@@ -95787,7 +95788,7 @@ var ts;
specifierSourceImports = new ts.Map();
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
}
- var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
+ var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
generatedName.generatedImportReference = specifier;
specifierSourceImports.set(name, specifier);
@@ -96935,11 +96936,11 @@ var ts;
}
else {
if (node.kind === 245 /* BreakStatement */) {
- labelMarker = "break-" + label.escapedText;
+ labelMarker = "break-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
}
else {
- labelMarker = "continue-" + label.escapedText;
+ labelMarker = "continue-".concat(label.escapedText);
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
}
}
@@ -105796,7 +105797,7 @@ var ts;
return getTypeAliasDeclarationVisibilityError;
}
else {
- return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
+ return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
}
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
@@ -106007,7 +106008,7 @@ var ts;
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
default:
- return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
+ return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
}
}
function getTypeParameterConstraintVisibilityError() {
@@ -106765,7 +106766,7 @@ var ts;
while (ts.length(lateMarkedStatements)) {
var i = lateMarkedStatements.shift();
if (!ts.isLateVisibilityPaintedStatement(i)) {
- return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
+ 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));
}
var priorNeedsDeclare = needsDeclare;
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
@@ -106954,7 +106955,7 @@ var ts;
return cleanup(input);
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));
}
- default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
+ default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
}
}
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
@@ -107245,7 +107246,7 @@ var ts;
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
// We must add a temporary declaration for the extends clause expression
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
- var newId_1 = factory.createUniqueName(oldId + "_base", 16 /* Optimistic */);
+ var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
getSymbolAccessibilityDiagnostic = function () { return ({
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
errorNode: extendsClause_1,
@@ -107286,7 +107287,7 @@ var ts;
}
}
// Anything left unhandled is an error, so this should be unreachable
- return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
+ return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
function cleanup(node) {
if (isEnclosingDeclaration(input)) {
enclosingDeclaration = previousEnclosingDeclaration;
@@ -108178,13 +108179,13 @@ var ts;
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
return;
if (js && configFile.options.sourceMap) {
- addOutput(js + ".map");
+ addOutput("".concat(js, ".map"));
}
if (ts.getEmitDeclarations(configFile.options)) {
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
addOutput(dts);
if (configFile.options.declarationMap) {
- addOutput(dts + ".map");
+ addOutput("".concat(dts, ".map"));
}
}
}
@@ -108253,7 +108254,7 @@ var ts;
function getFirstProjectOutput(configFile, ignoreCase) {
if (ts.outFile(configFile.options)) {
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
- return ts.Debug.checkDefined(jsFilePath, "project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
@@ -108272,7 +108273,7 @@ var ts;
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
if (buildInfoPath)
return buildInfoPath;
- return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
+ return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
}
ts.getFirstProjectOutput = getFirstProjectOutput;
/*@internal*/
@@ -108498,7 +108499,7 @@ var ts;
if (sourceMappingURL) {
if (!writer.isAtStartOfLine())
writer.rawWrite(newLine);
- writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Tools can sometimes see this line as a source mapping url comment
+ writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
}
// Write the source map
if (sourceMapFilePath) {
@@ -108547,7 +108548,7 @@ var ts;
// Encode the sourceMap into the sourceMap url
var sourceMapText = sourceMapGenerator.toString();
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
- return "data:application/json;base64," + base64SourceMapText;
+ return "data:application/json;base64,".concat(base64SourceMapText);
}
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
if (mapOptions.mapRoot) {
@@ -108727,7 +108728,7 @@ var ts;
return;
break;
default:
- ts.Debug.fail("Unexpected path: " + name);
+ ts.Debug.fail("Unexpected path: ".concat(name));
}
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
},
@@ -109587,7 +109588,7 @@ var ts;
return writeTokenNode(node, writeKeyword);
if (ts.isTokenKind(node.kind))
return writeTokenNode(node, writePunctuation);
- ts.Debug.fail("Unhandled SyntaxKind: " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
}
function emitMappedTypeParameter(node) {
emit(node.name);
@@ -109757,16 +109758,16 @@ var ts;
}
}
function emitPlaceholder(hint, node, snippet) {
- nonEscapingWrite("${" + snippet.order + ":"); // `${2:`
+ nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
nonEscapingWrite("}"); // `}`
// `${2:...}`
}
function emitTabStop(hint, node, snippet) {
// A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
- ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
+ ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
- nonEscapingWrite("$" + snippet.order);
+ nonEscapingWrite("$".concat(snippet.order));
}
//
// Identifiers
@@ -111528,17 +111529,17 @@ var ts;
writeLine();
}
if (currentSourceFile && currentSourceFile.moduleName) {
- writeComment("/// ");
+ writeComment("/// "));
writeLine();
}
if (currentSourceFile && currentSourceFile.amdDependencies) {
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
var dep = _b[_a];
if (dep.name) {
- writeComment("/// ");
+ writeComment("/// "));
}
else {
- writeComment("/// ");
+ writeComment("/// "));
}
writeLine();
}
@@ -111546,7 +111547,7 @@ var ts;
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
var directive = files_2[_c];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
writeLine();
@@ -111554,7 +111555,7 @@ var ts;
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
var directive = types_24[_d];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
writeLine();
@@ -111562,7 +111563,7 @@ var ts;
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
var directive = libs_1[_e];
var pos = writer.getTextPos();
- writeComment("/// ");
+ writeComment("/// "));
if (bundleFileInfo)
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
writeLine();
@@ -112342,9 +112343,9 @@ var ts;
var textSourceNode = node.textSourceNode;
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
- return jsxAttributeEscape ? "\"" + ts.escapeJsxAttributeString(text) + "\"" :
- neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"" + ts.escapeString(text) + "\"" :
- "\"" + ts.escapeNonAsciiString(text) + "\"";
+ return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
+ neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
+ "\"".concat(ts.escapeNonAsciiString(text), "\"");
}
else {
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
@@ -112821,8 +112822,8 @@ var ts;
}
function formatSynthesizedComment(comment) {
return comment.kind === 3 /* MultiLineCommentTrivia */
- ? "/*" + comment.text + "*/"
- : "//" + comment.text;
+ ? "/*".concat(comment.text, "*/")
+ : "//".concat(comment.text);
}
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
enterComment();
@@ -113543,7 +113544,7 @@ var ts;
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;
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
if (!newPath) {
- writeLog("Project: " + configFileName + " Detected ignored path: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
return true;
}
fileOrDirectoryPath = newPath;
@@ -113552,11 +113553,11 @@ var ts;
// If the the added or created file or directory is not supported file name, ignore the file
// But when watched directory is added/removed, we need to reload the file list
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
- writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
return true;
}
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
- writeLog("Project: " + configFileName + " Detected excluded file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
return true;
}
if (!program)
@@ -113580,7 +113581,7 @@ var ts;
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
- writeLog("Project: " + configFileName + " Detected output file: " + fileOrDirectory);
+ writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
return true;
}
return false;
@@ -113648,36 +113649,36 @@ var ts;
host.useCaseSensitiveFileNames();
}
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
- log("ExcludeWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
return {
- close: function () { return log("ExcludeWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }
+ close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
};
}
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- log("FileWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
return {
close: function () {
- log("FileWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
+ log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
watcher.close();
}
};
}
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
- var watchInfo = "DirectoryWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
return {
close: function () {
- var watchInfo = "DirectoryWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
log(watchInfo);
var start = ts.timestamp();
watcher.close();
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + watchInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
}
};
}
@@ -113687,16 +113688,16 @@ var ts;
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
- var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher") + ":: Triggered with " + args[0] + " " + (args[1] !== undefined ? args[1] : "") + ":: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
+ 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));
log(triggerredInfo);
var start = ts.timestamp();
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
var elapsed = ts.timestamp() - start;
- log("Elapsed:: " + elapsed + "ms " + triggerredInfo);
+ log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
}, flags, options, detailInfo1, detailInfo2); };
}
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
- return "WatchInfo: " + file + " " + flags + " " + JSON.stringify(options) + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2);
+ return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
}
}
ts.getWatchFactory = getWatchFactory;
@@ -114003,12 +114004,12 @@ var ts;
}
ts.formatDiagnostics = formatDiagnostics;
function formatDiagnostic(diagnostic, host) {
- var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();
+ var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
if (diagnostic.file) {
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
var fileName = diagnostic.file.fileName;
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
- return relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): " + errorMessage;
+ return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
}
return errorMessage;
}
@@ -114096,9 +114097,9 @@ var ts;
var output = "";
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
output += ":";
- output += color("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
output += ":";
- output += color("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
+ output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
return output;
}
ts.formatLocation = formatLocation;
@@ -114112,7 +114113,7 @@ var ts;
output += " - ";
}
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
- output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
+ output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
if (diagnostic.file) {
output += host.getNewLine();
@@ -114221,7 +114222,7 @@ var ts;
var result = void 0;
var mode = getModeForResolutionAtIndex(containingFile, i);
i++;
- var cacheKey = mode !== undefined ? mode + "|" + name : name;
+ var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
if (cache.has(cacheKey)) {
result = cache.get(cacheKey);
}
@@ -116410,7 +116411,7 @@ var ts;
path += (i === 2 ? "/" : "-") + components[i];
i++;
}
- var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
+ var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
return localOverrideModuleResult.resolvedModule.resolvedFileName;
@@ -117231,12 +117232,12 @@ var ts;
}
function directoryExistsIfProjectReferenceDeclDir(dir) {
var dirPath = host.toPath(dir);
- var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
+ var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
// Any parent directory of declaration dir
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
// Any directory inside declaration dir
- ts.startsWith(dirPath, declDirPath + "/"); });
+ ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
}
function handleDirectoryCouldBeSymlink(directory) {
var _a;
@@ -117289,7 +117290,7 @@ var ts;
if (isFile && result) {
// Store the real path for the file'
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
- symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), ""));
+ symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
}
return result;
}) || false;
@@ -117747,7 +117748,7 @@ var ts;
/*forceDtsEmit*/ true);
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
if (firstDts_1) {
- 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: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
+ 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; }))); });
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
if (exportedModulesMapCache && latestSignature !== prevSignature) {
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
@@ -118255,7 +118256,7 @@ var ts;
return;
}
else {
- 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: " + affectedFile.fileName);
+ 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));
}
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
@@ -119400,7 +119401,7 @@ var ts;
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
- ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: " + failedLookupLocation + " failedLookupLocationPath: " + failedLookupLocationPath);
+ ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
if (failedLookupPathSplit.length > rootSplitLength + 1) {
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
return {
@@ -120482,7 +120483,7 @@ var ts;
}
function getJSExtensionForFile(fileName, options) {
var _a;
- return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension " + ts.extensionFromPath(fileName) + " is unsupported:: FileName:: " + fileName);
+ return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
}
function tryGetJSExtensionForFile(fileName, options) {
var ext = ts.tryGetExtensionFromPath(fileName);
@@ -120585,8 +120586,8 @@ var ts;
return pretty ?
function (diagnostic, newLine, options) {
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
- var output = "[" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);
+ var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
system.write(output);
} :
function (diagnostic, newLine, options) {
@@ -120594,8 +120595,8 @@ var ts;
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
output += newLine;
}
- output += getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);
+ output += "".concat(getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
system.write(output);
};
}
@@ -120618,7 +120619,7 @@ var ts;
.map(function (errorDiagnostic) {
if (errorDiagnostic.file === undefined)
return;
- return "" + errorDiagnostic.file.fileName;
+ return "".concat(errorDiagnostic.file.fileName);
});
return filesInError.map(function (fileName) {
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
@@ -120651,7 +120652,7 @@ var ts;
if (errorCount === 0)
return "";
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
- var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return "".concat(fileInError.fileName, ":").concat(fileInError.line); })
.filter(function (value, index, self) { return self.indexOf(value) === index; });
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
var d = errorCount === 1 ?
@@ -120664,7 +120665,7 @@ var ts;
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
+ return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix);
}
ts.getErrorSummaryText = getErrorSummaryText;
function createTabularErrorsDisplay(filesInError, host) {
@@ -120687,7 +120688,7 @@ var ts;
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
: "";
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
- tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
+ tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n");
});
return tabularData;
}
@@ -120714,9 +120715,9 @@ var ts;
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
var file = _c[_i];
- write("" + toFileName(file, relativeFileName));
- (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" " + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });
- (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" " + d.messageText); });
+ write("".concat(toFileName(file, relativeFileName)));
+ (_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
+ (_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
}
}
ts.explainFiles = explainFiles;
@@ -120756,7 +120757,7 @@ var ts;
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
return false;
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
- return !!pattern && ts.getRegexFromPattern("(" + pattern + ")$", useCaseSensitiveFileNames).test(fileName);
+ return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
});
}
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
@@ -120765,7 +120766,7 @@ var ts;
var options = program.getCompilerOptions();
if (ts.isReferencedFile(reason)) {
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
- var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"" + referenceLocation.text + "\"";
+ var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
var message = void 0;
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
switch (reason.kind) {
@@ -120889,7 +120890,7 @@ var ts;
var currentDir_1 = program.getCurrentDirectory();
ts.forEach(emittedFiles, function (file) {
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
- write("TSFILE: " + filepath);
+ write("TSFILE: ".concat(filepath));
});
listFiles(program, write);
}
@@ -121218,7 +121219,7 @@ var ts;
}
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
- writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames);
+ writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
var configFileWatcher;
if (configFileName) {
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
@@ -121374,10 +121375,10 @@ var ts;
function createNewProgram(hasInvalidatedResolution) {
// Compile the program
writeLog("CreatingProgramWith::");
- writeLog(" roots: " + JSON.stringify(rootFileNames));
- writeLog(" options: " + JSON.stringify(compilerOptions));
+ writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
+ writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
if (projectReferences)
- writeLog(" projectReferences: " + JSON.stringify(projectReferences));
+ writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
hasChangedCompilerOptions = false;
hasChangedConfigFileParsingErrors = false;
@@ -121538,7 +121539,7 @@ var ts;
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
}
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
- writeLog("Scheduling invalidateFailedLookup" + (pending ? ", Cancelled earlier one" : ""));
+ writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
}
function invalidateResolutionsOfFailedLookup() {
@@ -121598,7 +121599,7 @@ var ts;
synchronizeProgram();
}
function reloadConfigFile() {
- writeLog("Reloading config file: " + configFileName);
+ writeLog("Reloading config file: ".concat(configFileName));
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
if (cachedDirectoryStructureHost) {
cachedDirectoryStructureHost.clearCache();
@@ -121639,7 +121640,7 @@ var ts;
return config.parsedCommandLine;
}
}
- writeLog("Loading config file: " + configFileName);
+ writeLog("Loading config file: ".concat(configFileName));
var parsedCommandLine = host.getParsedCommandLine ?
host.getParsedCommandLine(configFileName) :
getParsedCommandLineFromConfigFileHost(configFileName);
@@ -121943,8 +121944,8 @@ var ts;
*/
function createBuilderStatusReporter(system, pretty) {
return function (diagnostic) {
- var output = pretty ? "[" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] " : ts.getLocaleTimeString(system) + " - ";
- output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);
+ var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
+ output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
system.write(output);
};
}
@@ -122719,7 +122720,7 @@ var ts;
function listEmittedFile(_a, proj, file) {
var write = _a.write;
if (write && proj.options.listEmittedFiles) {
- write("TSFILE: " + file);
+ write("TSFILE: ".concat(file));
}
}
function getOldProgram(_a, proj, parsed) {
@@ -122748,7 +122749,7 @@ var ts;
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
reportAndStoreErrors(state, resolvedPath, diagnostics);
- state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
+ state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
if (canEmitBuildInfo)
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
afterProgramDone(state, program, config);
@@ -122776,7 +122777,7 @@ var ts;
if (!host.fileExists(inputFile)) {
return {
type: ts.UpToDateStatusType.Unbuildable,
- reason: inputFile + " does not exist"
+ reason: "".concat(inputFile, " does not exist")
};
}
if (!force) {
@@ -123135,7 +123136,7 @@ var ts;
}
}
if (filesToDelete) {
- reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
+ 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(""));
}
return ts.ExitStatus.Success;
}
@@ -123473,7 +123474,7 @@ var ts;
function nowString() {
// E.g. "12:34:56.789"
var d = new Date();
- return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0");
+ 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"));
}
server.nowString = nowString;
})(server = ts.server || (ts.server = {}));
@@ -123484,7 +123485,7 @@ var ts;
var JsTyping;
(function (JsTyping) {
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
- var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest"));
+ var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
return availableVersion.compareTo(cachedTyping.version) <= 0;
}
JsTyping.isTypingUpToDate = isTypingUpToDate;
@@ -123537,7 +123538,7 @@ var ts;
"worker_threads",
"zlib"
];
- JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:" + name; });
+ JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
function nonRelativeModuleNameForTypingCache(moduleName) {
@@ -123610,7 +123611,7 @@ var ts;
var excludeTypingName = exclude_1[_i];
var didDelete = inferredTypings.delete(excludeTypingName);
if (didDelete && log)
- log("Typing for " + excludeTypingName + " is in exclude list, will be ignored.");
+ log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
}
var newTypingNames = [];
var cachedTypingPaths = [];
@@ -123624,7 +123625,7 @@ var ts;
});
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
if (log)
- log("Result: " + JSON.stringify(result));
+ log("Result: ".concat(JSON.stringify(result)));
return result;
function addInferredTyping(typingName) {
if (!inferredTypings.has(typingName)) {
@@ -123633,7 +123634,7 @@ var ts;
}
function addInferredTypings(typingNames, message) {
if (log)
- log(message + ": " + JSON.stringify(typingNames));
+ log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
ts.forEach(typingNames, addInferredTyping);
}
/**
@@ -123655,7 +123656,7 @@ var ts;
filesToWatch.push(manifestPath);
manifest = ts.readConfigFile(manifestPath, function (path) { return host.readFile(path); }).config;
manifestTypingNames = ts.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts.getOwnKeys);
- addInferredTypings(manifestTypingNames, "Typing names in '" + manifestPath + "' dependencies");
+ addInferredTypings(manifestTypingNames, "Typing names in '".concat(manifestPath, "' dependencies"));
}
// Now we scan the directories for typing information in
// already-installed dependencies (if present). Note that this
@@ -123699,7 +123700,7 @@ var ts;
!isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; // `node_modules/foo`
});
if (log)
- log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(dependencyManifestNames));
+ log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(dependencyManifestNames)));
// Once we have the names of things to look up, we iterate over
// and either collect their included typings, or add them to the
// list of typings we need to look up separately.
@@ -123718,12 +123719,12 @@ var ts;
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
if (host.fileExists(absolutePath)) {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types."));
inferredTypings.set(manifest_1.name, absolutePath);
}
else {
if (log)
- log(" Package '" + manifest_1.name + "' provides its own types but they are missing.");
+ log(" Package '".concat(manifest_1.name, "' provides its own types but they are missing."));
}
}
else {
@@ -123819,15 +123820,15 @@ var ts;
var kind = isScopeName ? "Scope" : "Package";
switch (result) {
case 1 /* EmptyName */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot be empty";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
case 2 /* NameTooLong */:
- return "'" + typing + "':: " + kind + " name '" + name + "' should be less than " + maxPackageNameLength + " characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
case 3 /* NameStartsWithDot */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '.'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
case 4 /* NameStartsWithUnderscore */:
- return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '_'";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
case 5 /* NameContainsNonURISafeCharacters */:
- return "'" + typing + "':: " + kind + " name '" + name + "' contains non URI safe characters";
+ return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
case 0 /* Ok */:
return ts.Debug.fail(); // Shouldn't have called this.
default:
@@ -123853,7 +123854,7 @@ var ts;
}
catch (e) {
if (log.isEnabled()) {
- log.writeLine("Failed to resolve " + packageName + " in folder '" + cachePath + "': " + e.message);
+ log.writeLine("Failed to resolve ".concat(packageName, " in folder '").concat(cachePath, "': ").concat(e.message));
}
return undefined;
}
@@ -123874,7 +123875,7 @@ var ts;
var sliceStart = packageNames.length - remaining;
var command, toSlice = remaining;
while (true) {
- command = npmPath + " install --ignore-scripts " + (toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" ") + " --save-dev --user-agent=\"typesInstaller/" + tsVersion + "\"";
+ command = "".concat(npmPath, " install --ignore-scripts ").concat((toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" "), " --save-dev --user-agent=\"typesInstaller/").concat(tsVersion, "\"");
if (command.length < 8000) {
break;
}
@@ -123901,12 +123902,12 @@ var ts;
ProjectWatcherType["DirectoryWatcher"] = "DirectoryWatcher";
})(ProjectWatcherType || (ProjectWatcherType = {}));
function getDetailWatchInfo(projectName, watchers) {
- return "Project: " + projectName + " watcher already invoked: " + watchers.isInvoked;
+ return "Project: ".concat(projectName, " watcher already invoked: ").concat(watchers.isInvoked);
}
var TypingsInstaller = /** @class */ (function () {
function TypingsInstaller(installTypingHost, globalCachePath, safeListPath, typesMapLocation, throttleLimit, log) {
- var _this = this;
if (log === void 0) { log = nullLog; }
+ var _this = this;
this.installTypingHost = installTypingHost;
this.globalCachePath = globalCachePath;
this.safeListPath = safeListPath;
@@ -123925,7 +123926,7 @@ var ts;
this.globalCachePackageJsonPath = ts.combinePaths(globalCachePath, "package.json");
var isLoggingEnabled = this.log.isEnabled();
if (isLoggingEnabled) {
- this.log.writeLine("Global cache location '" + globalCachePath + "', safe file path '" + safeListPath + "', types map path " + typesMapLocation);
+ this.log.writeLine("Global cache location '".concat(globalCachePath, "', safe file path '").concat(safeListPath, "', types map path ").concat(typesMapLocation));
}
this.watchFactory = ts.getWatchFactory(this.installTypingHost, isLoggingEnabled ? ts.WatchLogLevel.Verbose : ts.WatchLogLevel.None, function (s) { return _this.log.writeLine(s); }, getDetailWatchInfo);
this.processCacheLocation(this.globalCachePath);
@@ -123935,30 +123936,30 @@ var ts;
};
TypingsInstaller.prototype.closeWatchers = function (projectName) {
if (this.log.isEnabled()) {
- this.log.writeLine("Closing file watchers for project '" + projectName + "'");
+ this.log.writeLine("Closing file watchers for project '".concat(projectName, "'"));
}
var watchers = this.projectWatchers.get(projectName);
if (!watchers) {
if (this.log.isEnabled()) {
- this.log.writeLine("No watchers are registered for project '" + projectName + "'");
+ this.log.writeLine("No watchers are registered for project '".concat(projectName, "'"));
}
return;
}
ts.clearMap(watchers, ts.closeFileWatcher);
this.projectWatchers.delete(projectName);
if (this.log.isEnabled()) {
- this.log.writeLine("Closing file watchers for project '" + projectName + "' - done.");
+ this.log.writeLine("Closing file watchers for project '".concat(projectName, "' - done."));
}
};
TypingsInstaller.prototype.install = function (req) {
var _this = this;
if (this.log.isEnabled()) {
- this.log.writeLine("Got install request " + JSON.stringify(req));
+ this.log.writeLine("Got install request ".concat(JSON.stringify(req)));
}
// load existing typing information from the cache
if (req.cachePath) {
if (this.log.isEnabled()) {
- this.log.writeLine("Request specifies cache path '" + req.cachePath + "', loading cached information...");
+ this.log.writeLine("Request specifies cache path '".concat(req.cachePath, "', loading cached information..."));
}
this.processCacheLocation(req.cachePath);
}
@@ -123967,7 +123968,7 @@ var ts;
}
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);
if (this.log.isEnabled()) {
- this.log.writeLine("Finished typings discovery: " + JSON.stringify(discoverTypingsResult));
+ this.log.writeLine("Finished typings discovery: ".concat(JSON.stringify(discoverTypingsResult)));
}
// start watching files
this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch, req.projectRootPath, req.watchOptions);
@@ -123987,17 +123988,17 @@ var ts;
if (this.typesMapLocation) {
var safeListFromMap = ts.JsTyping.loadTypesMap(this.installTypingHost, this.typesMapLocation);
if (safeListFromMap) {
- this.log.writeLine("Loaded safelist from types map file '" + this.typesMapLocation + "'");
+ this.log.writeLine("Loaded safelist from types map file '".concat(this.typesMapLocation, "'"));
this.safeList = safeListFromMap;
return;
}
- this.log.writeLine("Failed to load safelist from types map file '" + this.typesMapLocation + "'");
+ this.log.writeLine("Failed to load safelist from types map file '".concat(this.typesMapLocation, "'"));
}
this.safeList = ts.JsTyping.loadSafeList(this.installTypingHost, this.safeListPath);
};
TypingsInstaller.prototype.processCacheLocation = function (cacheLocation) {
if (this.log.isEnabled()) {
- this.log.writeLine("Processing cache location '" + cacheLocation + "'");
+ this.log.writeLine("Processing cache location '".concat(cacheLocation, "'"));
}
if (this.knownCachesSet.has(cacheLocation)) {
if (this.log.isEnabled()) {
@@ -124008,14 +124009,14 @@ var ts;
var packageJson = ts.combinePaths(cacheLocation, "package.json");
var packageLockJson = ts.combinePaths(cacheLocation, "package-lock.json");
if (this.log.isEnabled()) {
- this.log.writeLine("Trying to find '" + packageJson + "'...");
+ this.log.writeLine("Trying to find '".concat(packageJson, "'..."));
}
if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) {
var npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); // TODO: GH#18217
var npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); // TODO: GH#18217
if (this.log.isEnabled()) {
- this.log.writeLine("Loaded content of '" + packageJson + "': " + JSON.stringify(npmConfig));
- this.log.writeLine("Loaded content of '" + packageLockJson + "'");
+ this.log.writeLine("Loaded content of '".concat(packageJson, "': ").concat(JSON.stringify(npmConfig)));
+ this.log.writeLine("Loaded content of '".concat(packageLockJson, "'"));
}
if (npmConfig.devDependencies && npmLock.dependencies) {
for (var key in npmConfig.devDependencies) {
@@ -124039,11 +124040,11 @@ var ts;
continue;
}
if (this.log.isEnabled()) {
- this.log.writeLine("New typing for package " + packageName + " from '" + typingFile + "' conflicts with existing typing file '" + existingTypingFile + "'");
+ this.log.writeLine("New typing for package ".concat(packageName, " from '").concat(typingFile, "' conflicts with existing typing file '").concat(existingTypingFile, "'"));
}
}
if (this.log.isEnabled()) {
- this.log.writeLine("Adding entry into typings cache: '" + packageName + "' => '" + typingFile + "'");
+ this.log.writeLine("Adding entry into typings cache: '".concat(packageName, "' => '").concat(typingFile, "'"));
}
var info = ts.getProperty(npmLock.dependencies, key);
var version_1 = info && info.version;
@@ -124056,7 +124057,7 @@ var ts;
}
}
if (this.log.isEnabled()) {
- this.log.writeLine("Finished processing cache location '" + cacheLocation + "'");
+ this.log.writeLine("Finished processing cache location '".concat(cacheLocation, "'"));
}
this.knownCachesSet.add(cacheLocation);
};
@@ -124066,7 +124067,7 @@ var ts;
var typingKey = ts.mangleScopedPackageName(typing);
if (_this.missingTypingsSet.has(typingKey)) {
if (_this.log.isEnabled())
- _this.log.writeLine("'" + typing + "':: '" + typingKey + "' is in missingTypingsSet - skipping...");
+ _this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' is in missingTypingsSet - skipping..."));
return undefined;
}
var validationResult = ts.JsTyping.validatePackageName(typing);
@@ -124079,12 +124080,12 @@ var ts;
}
if (!_this.typesRegistry.has(typingKey)) {
if (_this.log.isEnabled())
- _this.log.writeLine("'" + typing + "':: Entry for package '" + typingKey + "' does not exist in local types registry - skipping...");
+ _this.log.writeLine("'".concat(typing, "':: Entry for package '").concat(typingKey, "' does not exist in local types registry - skipping..."));
return undefined;
}
if (_this.packageNameToTypingLocation.get(typingKey) && ts.JsTyping.isTypingUpToDate(_this.packageNameToTypingLocation.get(typingKey), _this.typesRegistry.get(typingKey))) {
if (_this.log.isEnabled())
- _this.log.writeLine("'" + typing + "':: '" + typingKey + "' already has an up-to-date typing - skipping...");
+ _this.log.writeLine("'".concat(typing, "':: '").concat(typingKey, "' already has an up-to-date typing - skipping..."));
return undefined;
}
return typingKey;
@@ -124093,11 +124094,11 @@ var ts;
TypingsInstaller.prototype.ensurePackageDirectoryExists = function (directory) {
var npmConfigPath = ts.combinePaths(directory, "package.json");
if (this.log.isEnabled()) {
- this.log.writeLine("Npm config file: " + npmConfigPath);
+ this.log.writeLine("Npm config file: ".concat(npmConfigPath));
}
if (!this.installTypingHost.fileExists(npmConfigPath)) {
if (this.log.isEnabled()) {
- this.log.writeLine("Npm config file: '" + npmConfigPath + "' is missing, creating new one...");
+ this.log.writeLine("Npm config file: '".concat(npmConfigPath, "' is missing, creating new one..."));
}
this.ensureDirectoryExists(directory, this.installTypingHost);
this.installTypingHost.writeFile(npmConfigPath, '{ "private": true }');
@@ -124106,7 +124107,7 @@ var ts;
TypingsInstaller.prototype.installTypings = function (req, cachePath, currentlyCachedTypings, typingsToInstall) {
var _this = this;
if (this.log.isEnabled()) {
- this.log.writeLine("Installing typings " + JSON.stringify(typingsToInstall));
+ this.log.writeLine("Installing typings ".concat(JSON.stringify(typingsToInstall)));
}
var filteredTypings = this.filterTypings(typingsToInstall);
if (filteredTypings.length === 0) {
@@ -124133,7 +124134,7 @@ var ts;
try {
if (!ok) {
if (_this.log.isEnabled()) {
- _this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: " + JSON.stringify(filteredTypings));
+ _this.log.writeLine("install request failed, marking packages as missing to prevent repeated requests: ".concat(JSON.stringify(filteredTypings)));
}
for (var _i = 0, filteredTypings_1 = filteredTypings; _i < filteredTypings_1.length; _i++) {
var typing = filteredTypings_1[_i];
@@ -124143,7 +124144,7 @@ var ts;
}
// TODO: watch project directory
if (_this.log.isEnabled()) {
- _this.log.writeLine("Installed typings " + JSON.stringify(scopedTypings));
+ _this.log.writeLine("Installed typings ".concat(JSON.stringify(scopedTypings)));
}
var installedTypingFiles = [];
for (var _a = 0, filteredTypings_2 = filteredTypings; _a < filteredTypings_2.length; _a++) {
@@ -124155,13 +124156,13 @@ var ts;
}
// packageName is guaranteed to exist in typesRegistry by filterTypings
var distTags = _this.typesRegistry.get(packageName);
- var newVersion = new ts.Version(distTags["ts" + ts.versionMajorMinor] || distTags[_this.latestDistTag]);
+ var newVersion = new ts.Version(distTags["ts".concat(ts.versionMajorMinor)] || distTags[_this.latestDistTag]);
var newTyping = { typingLocation: typingFile, version: newVersion };
_this.packageNameToTypingLocation.set(packageName, newTyping);
installedTypingFiles.push(typingFile);
}
if (_this.log.isEnabled()) {
- _this.log.writeLine("Installed typing files " + JSON.stringify(installedTypingFiles));
+ _this.log.writeLine("Installed typing files ".concat(JSON.stringify(installedTypingFiles)));
}
_this.sendResponse(_this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles)));
}
@@ -124215,7 +124216,7 @@ var ts;
return;
}
if (isLoggingEnabled) {
- _this.log.writeLine(projectWatcherType + ":: Added:: WatchInfo: " + path);
+ _this.log.writeLine("".concat(projectWatcherType, ":: Added:: WatchInfo: ").concat(path));
}
var watcher = projectWatcherType === "FileWatcher" /* FileWatcher */ ?
_this.watchFactory.watchFile(path, function () {
@@ -124236,7 +124237,7 @@ var ts;
}, 1 /* Recursive */, options, projectName, watchers);
watchers.set(canonicalPath, isLoggingEnabled ? {
close: function () {
- _this.log.writeLine(projectWatcherType + ":: Closed:: WatchInfo: " + path);
+ _this.log.writeLine("".concat(projectWatcherType, ":: Closed:: WatchInfo: ").concat(path));
watcher.close();
}
} : watcher);
@@ -124311,7 +124312,7 @@ var ts;
typingsInstaller.TypingsInstaller = TypingsInstaller;
/* @internal */
function typingsName(packageName) {
- return "@types/" + packageName + "@ts" + ts.versionMajorMinor;
+ return "@types/".concat(packageName, "@ts").concat(ts.versionMajorMinor);
}
typingsInstaller.typingsName = typingsName;
})(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
@@ -124336,7 +124337,7 @@ var ts;
if (typeof _this.logFile !== "string")
return;
try {
- fs.appendFileSync(_this.logFile, "[" + server.nowString() + "] " + text + ts.sys.newLine);
+ fs.appendFileSync(_this.logFile, "[".concat(server.nowString(), "] ").concat(text).concat(ts.sys.newLine));
}
catch (e) {
_this.logFile = undefined;
@@ -124352,7 +124353,7 @@ var ts;
return npmPath;
}
if (host.fileExists(npmPath)) {
- return "\"" + npmPath + "\"";
+ return "\"".concat(npmPath, "\"");
}
}
return "npm";
@@ -124360,7 +124361,7 @@ var ts;
function loadTypesRegistryFile(typesRegistryFilePath, host, log) {
if (!host.fileExists(typesRegistryFilePath)) {
if (log.isEnabled()) {
- log.writeLine("Types registry file '" + typesRegistryFilePath + "' does not exist");
+ log.writeLine("Types registry file '".concat(typesRegistryFilePath, "' does not exist"));
}
return new ts.Map();
}
@@ -124370,14 +124371,14 @@ var ts;
}
catch (e) {
if (log.isEnabled()) {
- log.writeLine("Error when loading types registry file '" + typesRegistryFilePath + "': " + e.message + ", " + e.stack);
+ log.writeLine("Error when loading types registry file '".concat(typesRegistryFilePath, "': ").concat(e.message, ", ").concat(e.stack));
}
return new ts.Map();
}
}
var typesRegistryPackageName = "types-registry";
function getTypesRegistryFileLocation(globalTypingsCacheLocation) {
- return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/" + typesRegistryPackageName + "/index.json");
+ return ts.combinePaths(ts.normalizeSlashes(globalTypingsCacheLocation), "node_modules/".concat(typesRegistryPackageName, "/index.json"));
}
var NodeTypingsInstaller = (function (_super) {
__extends(NodeTypingsInstaller, _super);
@@ -124385,27 +124386,27 @@ var ts;
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;
_this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation, _this.installTypingHost);
if (ts.stringContains(_this.npmPath, " ") && _this.npmPath[0] !== "\"") {
- _this.npmPath = "\"" + _this.npmPath + "\"";
+ _this.npmPath = "\"".concat(_this.npmPath, "\"");
}
if (_this.log.isEnabled()) {
- _this.log.writeLine("Process id: " + process.pid);
- _this.log.writeLine("NPM location: " + _this.npmPath + " (explicit '" + server.Arguments.NpmLocation + "' " + (npmLocation === undefined ? "not " : "") + " provided)");
- _this.log.writeLine("validateDefaultNpmLocation: " + validateDefaultNpmLocation);
+ _this.log.writeLine("Process id: ".concat(process.pid));
+ _this.log.writeLine("NPM location: ".concat(_this.npmPath, " (explicit '").concat(server.Arguments.NpmLocation, "' ").concat(npmLocation === undefined ? "not " : "", " provided)"));
+ _this.log.writeLine("validateDefaultNpmLocation: ".concat(validateDefaultNpmLocation));
}
(_this.nodeExecSync = require("child_process").execSync);
_this.ensurePackageDirectoryExists(globalTypingsCacheLocation);
try {
if (_this.log.isEnabled()) {
- _this.log.writeLine("Updating " + typesRegistryPackageName + " npm package...");
+ _this.log.writeLine("Updating ".concat(typesRegistryPackageName, " npm package..."));
}
- _this.execSyncAndLog(_this.npmPath + " install --ignore-scripts " + typesRegistryPackageName + "@" + _this.latestDistTag, { cwd: globalTypingsCacheLocation });
+ _this.execSyncAndLog("".concat(_this.npmPath, " install --ignore-scripts ").concat(typesRegistryPackageName, "@").concat(_this.latestDistTag), { cwd: globalTypingsCacheLocation });
if (_this.log.isEnabled()) {
- _this.log.writeLine("Updated " + typesRegistryPackageName + " npm package");
+ _this.log.writeLine("Updated ".concat(typesRegistryPackageName, " npm package"));
}
}
catch (e) {
if (_this.log.isEnabled()) {
- _this.log.writeLine("Error updating " + typesRegistryPackageName + " package: " + e.message);
+ _this.log.writeLine("Error updating ".concat(typesRegistryPackageName, " package: ").concat(e.message));
}
_this.delayedInitializationError = {
kind: "event::initializationFailed",
@@ -124444,7 +124445,7 @@ var ts;
var cwd = getDirectoryOfPackageJson(fileName, _this.installTypingHost) || projectRootPath;
if (cwd) {
_this.installWorker(-1, [packageName_1], cwd, function (success) {
- var message = success ? "Package " + packageName_1 + " installed." : "There was an error installing " + packageName_1 + ".";
+ var message = success ? "Package ".concat(packageName_1, " installed.") : "There was an error installing ".concat(packageName_1, ".");
var response = { kind: server.ActionPackageInstalled, projectName: projectName_1, success: success, message: message };
_this.sendResponse(response);
});
@@ -124462,7 +124463,7 @@ var ts;
};
NodeTypingsInstaller.prototype.sendResponse = function (response) {
if (this.log.isEnabled()) {
- this.log.writeLine("Sending response:\n " + JSON.stringify(response));
+ this.log.writeLine("Sending response:\n ".concat(JSON.stringify(response)));
}
process.send(response);
if (this.log.isEnabled()) {
@@ -124472,29 +124473,29 @@ var ts;
NodeTypingsInstaller.prototype.installWorker = function (requestId, packageNames, cwd, onRequestCompleted) {
var _this = this;
if (this.log.isEnabled()) {
- this.log.writeLine("#" + requestId + " with arguments'" + JSON.stringify(packageNames) + "'.");
+ this.log.writeLine("#".concat(requestId, " with arguments'").concat(JSON.stringify(packageNames), "'."));
}
var start = Date.now();
var hasError = typingsInstaller.installNpmPackages(this.npmPath, ts.version, packageNames, function (command) { return _this.execSyncAndLog(command, { cwd: cwd }); });
if (this.log.isEnabled()) {
- this.log.writeLine("npm install #" + requestId + " took: " + (Date.now() - start) + " ms");
+ this.log.writeLine("npm install #".concat(requestId, " took: ").concat(Date.now() - start, " ms"));
}
onRequestCompleted(!hasError);
};
NodeTypingsInstaller.prototype.execSyncAndLog = function (command, options) {
if (this.log.isEnabled()) {
- this.log.writeLine("Exec: " + command);
+ this.log.writeLine("Exec: ".concat(command));
}
try {
var stdout = this.nodeExecSync(command, __assign(__assign({}, options), { encoding: "utf-8" }));
if (this.log.isEnabled()) {
- this.log.writeLine(" Succeeded. stdout:" + indent(ts.sys.newLine, stdout));
+ this.log.writeLine(" Succeeded. stdout:".concat(indent(ts.sys.newLine, stdout)));
}
return false;
}
catch (error) {
var stdout = error.stdout, stderr = error.stderr;
- this.log.writeLine(" Failed. stdout:" + indent(ts.sys.newLine, stdout) + ts.sys.newLine + " stderr:" + indent(ts.sys.newLine, stderr));
+ this.log.writeLine(" Failed. stdout:".concat(indent(ts.sys.newLine, stdout)).concat(ts.sys.newLine, " stderr:").concat(indent(ts.sys.newLine, stderr)));
return true;
}
};
@@ -124517,7 +124518,7 @@ var ts;
var log = new FileLog(logFilePath);
if (log.isEnabled()) {
process.on("uncaughtException", function (e) {
- log.writeLine("Unhandled exception: " + e + " at " + e.stack);
+ log.writeLine("Unhandled exception: ".concat(e, " at ").concat(e.stack));
});
}
process.on("disconnect", function () {
@@ -124530,7 +124531,7 @@ var ts;
installer.listen();
function indent(newline, str) {
return str && str.length
- ? newline + " " + str.replace(/\r?\n/, newline + " ")
+ ? "".concat(newline, " ") + str.replace(/\r?\n/, "".concat(newline, " "))
: "";
}
})(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {}));
diff --git a/package.json b/package.json
index 90b4053f5dd..709da71b59b 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
- "version": "4.6.1-rc",
+ "version": "4.6.2",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [
diff --git a/src/compiler/corePublic.ts b/src/compiler/corePublic.ts
index f82d3d51171..2e0d8a0eeff 100644
--- a/src/compiler/corePublic.ts
+++ b/src/compiler/corePublic.ts
@@ -5,7 +5,7 @@ namespace ts {
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
- export const version = `${versionMajorMinor}.1-rc`;
+ export const version = "4.6.2" as string;
/**
* Type of objects whose values are all of the same type.