diff --git a/lib/cancellationToken.js b/lib/cancellationToken.js index 76a6a60e72976..0d4569c601b91 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/lib.es5.d.ts b/lib/lib.es5.d.ts index 1f8508ab4c7f9..2260163d64ca4 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -1515,7 +1515,7 @@ interface Promise { type Awaited = T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped - F extends ((value: infer V) => any) ? // if the argument to `then` is callable, extracts the argument + F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument Awaited : // recursively unwrap the value never : // the argument to `then` was not callable T; // non-object or non-thenable diff --git a/lib/tsc.js b/lib/tsc.js index e8b733568bb60..b90a4e1040638 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { var ts; (function (ts) { ts.versionMajorMinor = "4.5"; - ts.version = "4.5.2"; + ts.version = "4.5.3"; var NativeCollections; (function (NativeCollections) { function tryGetNativeMap() { @@ -88,7 +88,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; @@ -1294,7 +1294,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(_) { } @@ -1344,7 +1344,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); @@ -1679,7 +1679,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) { @@ -1948,7 +1948,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); } @@ -1956,12 +1956,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()); } @@ -1971,26 +1971,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; @@ -2022,42 +2022,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; @@ -2078,7 +2078,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) { @@ -2096,7 +2096,7 @@ var ts; break; } if (enumValue !== 0 && enumValue & value) { - result = "" + result + (result ? "|" : "") + enumName; + result = "".concat(result).concat(result ? "|" : "").concat(enumName); remainingFlags &= ~enumValue; } } @@ -2205,7 +2205,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); } }, @@ -2235,7 +2235,7 @@ var ts; __tsDebuggerDisplay: { value: function (defaultValue) { defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); - return "NodeArray " + defaultValue; + return "NodeArray ".concat(defaultValue); } } }); @@ -2281,7 +2281,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); } } @@ -2290,11 +2290,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" : @@ -2313,7 +2313,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); } }, @@ -2347,11 +2347,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" : @@ -2383,7 +2383,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); } }, @@ -2427,10 +2427,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) { @@ -2527,11 +2527,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); @@ -2753,7 +2753,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; @@ -2982,7 +2982,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; @@ -2993,11 +2993,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, @@ -3065,7 +3065,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) { @@ -3073,11 +3073,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"); @@ -3882,7 +3882,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; @@ -4302,7 +4302,7 @@ var ts; } function onTimerToUpdateChildWatches() { timerToUpdateChildWatches = undefined; - ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size)); var start = ts.timestamp(); var invokeMap = new ts.Map(); while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { @@ -4313,7 +4313,7 @@ var ts; var hasChanges = updateChildWatches(dirName, dirPath, options); invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames); } - ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size)); callbackCache.forEach(function (callbacks, rootDirName) { var existing = invokeMap.get(rootDirName); if (existing) { @@ -4329,7 +4329,7 @@ var ts; } }); var elapsed = ts.timestamp() - start; - ts.sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches); + ts.sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches)); } function removeChildWatches(parentWatcher) { if (!parentWatcher) @@ -4721,7 +4721,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) { @@ -4730,7 +4730,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++; } } @@ -4746,7 +4746,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) { @@ -4831,7 +4831,7 @@ var ts; } }; function invokeCallbackAndUpdateWatcher(createWatcher) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing", "FileSystemEntryWatcher")); callback("rename", ""); if (watcher) { watcher.close(); @@ -4848,7 +4848,7 @@ var ts; } } if (hitSystemWatcherLimit) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } try { @@ -4860,7 +4860,7 @@ var ts; } catch (e) { hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC"); - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } } @@ -7066,7 +7066,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; @@ -9570,7 +9570,7 @@ var ts; function getTextOfJSDocComment(comment) { return typeof comment === "string" ? comment : comment === null || comment === void 0 ? void 0 : comment.map(function (c) { - return c.kind === 319 ? c.text : "{@link " + (c.name ? ts.entityNameToString(c.name) + " " : "") + c.text + "}"; + return c.kind === 319 ? c.text : "{@link ".concat(c.name ? ts.entityNameToString(c.name) + " " : "").concat(c.text, "}"); }).join(""); } ts.getTextOfJSDocComment = getTextOfJSDocComment; @@ -10670,8 +10670,8 @@ var ts; } function packageIdToString(_a) { var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; - var fullName = subModuleName ? name + "/" + subModuleName : name; - return fullName + "@" + version; + var fullName = subModuleName ? "".concat(name, "/").concat(subModuleName) : name; + return "".concat(fullName, "@").concat(version); } ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { @@ -10741,7 +10741,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) { @@ -10842,7 +10842,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(); @@ -10859,10 +10859,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; } } @@ -11046,7 +11046,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) { @@ -13340,11 +13340,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) { @@ -15634,7 +15634,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) { @@ -15742,15 +15742,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 = { @@ -15768,9 +15768,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) { @@ -15788,7 +15788,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) { @@ -15854,7 +15854,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"), @@ -16099,7 +16099,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) { @@ -21109,7 +21109,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; @@ -21428,7 +21428,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) { @@ -25090,7 +25090,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; @@ -30594,7 +30594,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; } @@ -31988,8 +31988,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); @@ -32706,10 +32706,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; @@ -32747,19 +32747,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); } @@ -32767,24 +32767,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; @@ -33134,7 +33134,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; @@ -33330,7 +33330,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); }); @@ -33702,7 +33702,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; } @@ -33801,7 +33801,10 @@ var ts; } } var failedLookupLocations = []; - var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] }; + var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default : + ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault : + NodeResolutionFeatures.None; + var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] }; var resolved = primaryLookup(); var primary = true; if (!resolved) { @@ -34046,7 +34049,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; } @@ -34076,7 +34079,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(); @@ -34204,10 +34207,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); @@ -34337,7 +34340,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; } @@ -34354,13 +34357,15 @@ var ts; NodeResolutionFeatures[NodeResolutionFeatures["Exports"] = 8] = "Exports"; NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures"; + NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default"; + NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault"; NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode"; })(NodeResolutionFeatures || (NodeResolutionFeatures = {})); function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { var containingDirectory = ts.getDirectoryPath(containingFile); @@ -34438,7 +34443,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) { @@ -34785,7 +34790,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) { @@ -35097,7 +35102,7 @@ var ts; return mangled; } function getTypesPackageName(packageName) { - return "@types/" + mangleScopedPackageName(packageName); + return "@types/".concat(mangleScopedPackageName(packageName)); } ts.getTypesPackageName = getTypesPackageName; function mangleScopedPackageName(packageName) { @@ -35423,7 +35428,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; @@ -35472,7 +35477,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; @@ -35538,7 +35543,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) { @@ -37357,7 +37362,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) { @@ -39071,7 +39076,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 () { @@ -39437,11 +39442,12 @@ var ts; } } } - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) { + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) { if (excludeGlobals === void 0) { excludeGlobals = false; } - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol); + if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) { var _a, _b, _c; var originalLocation = location; var result; @@ -39676,7 +39682,7 @@ var ts; } } if (!result) { - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (!errorLocation || !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && !checkAndReportErrorForExtendingInterface(errorLocation) && @@ -39686,7 +39692,7 @@ var ts; !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { var suggestion = void 0; - if (suggestionCount < maximumSuggestionCount) { + if (getSpellingSuggestions && suggestionCount < maximumSuggestionCount) { suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning); var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration); if (isGlobalScopeAugmentationDeclaration) { @@ -39721,7 +39727,7 @@ var ts; } return undefined; } - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 && useDefineForClassFields)) { var propertyName = propertyWithInvalidInitializer.name; error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), diagnosticName(nameArg)); @@ -41344,7 +41350,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); } @@ -42111,7 +42117,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()); } @@ -42366,7 +42372,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; } @@ -42474,7 +42480,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) ]; } @@ -42487,7 +42493,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); @@ -42952,7 +42958,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); @@ -43240,7 +43246,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) { @@ -44049,7 +44055,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) { @@ -44119,7 +44125,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)); @@ -44164,7 +44170,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) { @@ -44270,15 +44276,15 @@ var ts; if (nameType.flags & 384) { var name = "" + nameType.value; if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) { - return "\"" + ts.escapeString(name, 34) + "\""; + return "\"".concat(ts.escapeString(name, 34), "\""); } if (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), "]"); } } } @@ -46677,7 +46683,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; } @@ -48362,7 +48368,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; @@ -48525,7 +48531,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 : @@ -48536,7 +48542,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)); @@ -48602,7 +48608,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; @@ -48789,7 +48795,7 @@ var ts; return symbol; } function getGlobalSymbol(name, meaning, diagnostic) { - return resolveName(undefined, name, meaning, diagnostic, name, false); + return resolveName(undefined, name, meaning, diagnostic, name, false, false, false); } function getGlobalType(name, arity, reportErrors) { var symbol = getGlobalTypeSymbol(name, reportErrors); @@ -49446,9 +49452,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) { @@ -49898,7 +49904,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)); @@ -49958,7 +49964,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)); @@ -50869,7 +50875,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) { @@ -52261,7 +52267,7 @@ var ts; return true; } if (source.flags & 524288 && target.flags & 524288) { - var related = relation.get(getRelationKey(source, target, 0, relation)); + var related = relation.get(getRelationKey(source, target, 0, relation, false)); if (related !== undefined) { return !!(related & 1); } @@ -52390,20 +52396,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; } @@ -52430,7 +52436,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; } @@ -52443,7 +52449,7 @@ var ts; break; } default: - return ts.Debug.fail("Unhandled Diagnostic: " + msg.code); + return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code)); } } if (path) { @@ -52975,7 +52981,8 @@ var ts; if (overflow) { return 0; } - var id = getRelationKey(source, target, intersectionState | (inPropertyCheck ? 16 : 0), relation); + var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 : 0); + var id = getRelationKey(source, target, keyIntersectionState, relation, false); var entry = relation.get(id); if (entry !== undefined) { if (reportErrors && entry & 2 && !(entry & 4)) { @@ -52999,12 +53006,9 @@ var ts; targetStack = []; } else { - var broadestEquivalentId = id.split(",").map(function (i) { return i.replace(/-\d+/g, function (_match, offset) { - var index = ts.length(id.slice(0, offset).match(/[-=]/g) || undefined); - return "=" + index; - }); }).join(","); + var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, true) : undefined; for (var i = 0; i < maybeCount; i++) { - if (id === maybeKeys[i] || broadestEquivalentId === maybeKeys[i]) { + if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) { return 3; } } @@ -54278,40 +54282,48 @@ var ts; function isTypeReferenceWithGenericArguments(type) { return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return !!(t.flags & 262144) || isTypeReferenceWithGenericArguments(t); }); } - function getTypeReferenceId(type, typeParameters, depth) { - if (depth === void 0) { depth = 0; } - var result = "" + type.target.id; - for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { - var t = _a[_i]; - if (isUnconstrainedTypeParameter(t)) { - var index = typeParameters.indexOf(t); - if (index < 0) { - index = typeParameters.length; - typeParameters.push(t); + function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) { + var typeParameters = []; + var constraintMarker = ""; + var sourceId = getTypeReferenceId(source, 0); + var targetId = getTypeReferenceId(target, 0); + return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix); + function getTypeReferenceId(type, depth) { + if (depth === void 0) { depth = 0; } + var result = "" + type.target.id; + for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 262144) { + if (ignoreConstraints || isUnconstrainedTypeParameter(t)) { + var index = typeParameters.indexOf(t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + continue; + } + constraintMarker = "*"; + } + else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { + result += "<" + getTypeReferenceId(t, depth + 1) + ">"; + continue; } - result += "=" + index; - } - else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { - result += "<" + getTypeReferenceId(t, typeParameters, depth + 1) + ">"; - } - else { result += "-" + t.id; } + return result; } - return result; } - function getRelationKey(source, target, intersectionState, relation) { + function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) { if (relation === identityRelation && source.id > target.id) { var temp = source; source = target; target = temp; } var postFix = intersectionState ? ":" + intersectionState : ""; - if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { - var typeParameters = []; - return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters) + postFix; - } - return source.id + "," + target.id + postFix; + return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? + getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : + "".concat(source.id, ",").concat(target.id).concat(postFix); } function forEachProperty(prop, callback) { if (ts.getCheckFlags(prop) & 6) { @@ -54350,16 +54362,21 @@ var ts; !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; } function isDeeplyNestedType(type, stack, depth, maxDepth) { - if (maxDepth === void 0) { maxDepth = 5; } + if (maxDepth === void 0) { maxDepth = 3; } if (depth >= maxDepth) { var identity_1 = getRecursionIdentity(type); var count = 0; + var lastTypeId = 0; for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= maxDepth) { - return true; + var t = stack[i]; + if (getRecursionIdentity(t) === identity_1) { + if (t.id >= lastTypeId) { + count++; + if (count >= maxDepth) { + return true; + } } + lastTypeId = t.id; } } } @@ -56122,10 +56139,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); @@ -59366,7 +59383,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; } @@ -60884,7 +60901,7 @@ var ts; } function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, undefined, outerName, false, false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, undefined, outerName, false, false, true, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); if (symbol) @@ -67809,7 +67826,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; @@ -74057,7 +74074,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 : @@ -74130,7 +74147,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; } @@ -76565,7 +76582,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; } @@ -77749,8 +77766,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); } @@ -79319,7 +79336,7 @@ var ts; specifierSourceImports = ts.createMap(); 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); @@ -80254,11 +80271,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); } } @@ -85878,7 +85895,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) { @@ -86075,7 +86092,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() { @@ -86762,7 +86779,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); @@ -86927,7 +86944,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)) { @@ -87171,7 +87188,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, @@ -87208,7 +87225,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; @@ -87977,13 +87994,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")); } } } @@ -88043,7 +88060,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++) { @@ -88062,7 +88079,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) { @@ -88272,7 +88289,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(); @@ -88312,7 +88329,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) { @@ -88476,7 +88493,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 }); }, @@ -89284,7 +89301,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); @@ -89424,12 +89441,12 @@ var ts; } } function emitPlaceholder(hint, node, snippet) { - nonEscapingWrite("${" + snippet.order + ":"); + nonEscapingWrite("${".concat(snippet.order, ":")); pipelineEmitWithHintWorker(hint, node, false); nonEscapingWrite("}"); } function emitTabStop(snippet) { - nonEscapingWrite("$" + snippet.order); + nonEscapingWrite("$".concat(snippet.order)); } function emitIdentifier(node) { var writeText = node.symbol ? writeSymbol : write; @@ -91057,17 +91074,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(); } @@ -91075,7 +91092,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(); @@ -91083,7 +91100,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(); @@ -91091,7 +91108,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(); @@ -91785,9 +91802,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); @@ -92186,8 +92203,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(); @@ -92801,18 +92818,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) @@ -92831,7 +92848,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; @@ -92899,36 +92916,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)); } }; } @@ -92938,16 +92955,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; @@ -93237,12 +93254,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; } @@ -93320,9 +93337,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; @@ -93336,7 +93353,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(); @@ -93436,7 +93453,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); } @@ -95209,7 +95226,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; @@ -95978,10 +95995,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; @@ -96029,7 +96046,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; @@ -96413,7 +96430,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); @@ -96809,7 +96826,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); }); @@ -97781,7 +97798,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), @@ -98737,7 +98754,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); @@ -98827,8 +98844,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) { @@ -98836,8 +98853,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); }; } @@ -98864,7 +98881,7 @@ var ts; if (errorCount === 0) return ""; var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount); - return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine; + return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine); } ts.getErrorSummaryText = getErrorSummaryText; function isBuilderProgram(program) { @@ -98890,9 +98907,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; @@ -98930,7 +98947,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; @@ -98939,7 +98956,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) { @@ -99050,7 +99067,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); } @@ -99356,7 +99373,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); @@ -99496,10 +99513,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; @@ -99641,7 +99658,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() { @@ -99697,7 +99714,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(); @@ -99735,7 +99752,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); @@ -99988,8 +100005,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); }; } @@ -100732,7 +100749,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) { @@ -100761,7 +100778,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); @@ -100787,7 +100804,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) { @@ -101112,7 +101129,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; } @@ -101457,7 +101474,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"); @@ -101466,19 +101483,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, @@ -101488,7 +101505,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; @@ -101523,13 +101540,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); } @@ -101564,7 +101581,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; @@ -101657,7 +101674,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) { @@ -101667,7 +101684,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); @@ -101693,7 +101710,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); @@ -101703,7 +101720,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]; @@ -102084,7 +102101,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) { @@ -102155,7 +102172,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 f0694f53a07e1..76c93ce018da3 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -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 = "4.5.2"; + ts.version = "4.5.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -141,7 +141,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 */ @@ -1504,7 +1504,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. */ @@ -1595,7 +1595,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); @@ -2045,7 +2045,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; /** @@ -2358,7 +2358,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); } @@ -2366,12 +2366,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()); } @@ -2381,26 +2381,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; @@ -2441,42 +2441,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; @@ -2497,7 +2497,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; /** @@ -2518,7 +2518,7 @@ var ts; break; } if (enumValue !== 0 && enumValue & value) { - result = "" + result + (result ? "|" : "") + enumName; + result = "".concat(result).concat(result ? "|" : "").concat(enumName); remainingFlags &= ~enumValue; } } @@ -2628,7 +2628,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); } }, @@ -2667,7 +2667,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); } } }); @@ -2722,7 +2722,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); } } @@ -2732,11 +2732,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" : @@ -2755,7 +2755,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); } }, @@ -2791,11 +2791,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" : @@ -2827,7 +2827,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); } }, @@ -2874,10 +2874,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) { @@ -3008,11 +3008,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); @@ -3279,7 +3279,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*/ @@ -3577,7 +3577,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; @@ -3589,11 +3589,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, @@ -3683,7 +3683,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) { @@ -3692,11 +3692,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"); @@ -6503,7 +6503,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; @@ -6968,7 +6968,7 @@ var ts; } function onTimerToUpdateChildWatches() { timerToUpdateChildWatches = undefined; - ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size)); var start = ts.timestamp(); var invokeMap = new ts.Map(); while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { @@ -6981,7 +6981,7 @@ var ts; var hasChanges = updateChildWatches(dirName, dirPath, options); invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames); } - ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size)); callbackCache.forEach(function (callbacks, rootDirName) { var existing = invokeMap.get(rootDirName); if (existing) { @@ -6997,7 +6997,7 @@ var ts; } }); var elapsed = ts.timestamp() - start; - ts.sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches); + ts.sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches)); } function removeChildWatches(parentWatcher) { if (!parentWatcher) @@ -7457,7 +7457,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) { @@ -7466,7 +7466,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++; } } @@ -7482,7 +7482,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) { @@ -7584,7 +7584,7 @@ var ts; * @param createWatcher */ function invokeCallbackAndUpdateWatcher(createWatcher) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher"); + ts.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 @@ -7609,7 +7609,7 @@ var ts; } } if (hitSystemWatcherLimit) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } try { @@ -7625,7 +7625,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"); - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } } @@ -9927,7 +9927,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; @@ -12807,7 +12807,7 @@ var ts; return typeof comment === "string" ? comment : comment === null || comment === void 0 ? void 0 : comment.map(function (c) { // TODO: Other kinds here - return c.kind === 319 /* JSDocText */ ? c.text : "{@link " + (c.name ? ts.entityNameToString(c.name) + " " : "") + c.text + "}"; + return c.kind === 319 /* JSDocText */ ? c.text : "{@link ".concat(c.name ? ts.entityNameToString(c.name) + " " : "").concat(c.text, "}"); }).join(""); } ts.getTextOfJSDocComment = getTextOfJSDocComment; @@ -14077,8 +14077,8 @@ var ts; } function packageIdToString(_a) { var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; - var fullName = subModuleName ? name + "/" + subModuleName : name; - return fullName + "@" + version; + var fullName = subModuleName ? "".concat(name, "/").concat(subModuleName) : name; + return "".concat(fullName, "@").concat(version); } ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { @@ -14157,7 +14157,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) { @@ -14296,7 +14296,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(); @@ -14313,10 +14313,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; } } @@ -14531,7 +14531,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) { @@ -17062,11 +17062,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) { @@ -19759,7 +19759,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) { @@ -19876,7 +19876,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 @@ -19889,7 +19889,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 = { @@ -19898,7 +19898,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 = { @@ -19916,10 +19916,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) { @@ -19941,7 +19941,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) { @@ -20019,7 +20019,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"), @@ -20300,7 +20300,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) { @@ -26289,7 +26289,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; @@ -26617,7 +26617,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) { @@ -31155,7 +31155,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; @@ -37919,7 +37919,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; } @@ -39381,8 +39381,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) { @@ -40176,10 +40176,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; @@ -40230,19 +40230,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); } @@ -40251,25 +40251,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; @@ -40667,7 +40667,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; @@ -40912,7 +40912,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); }); @@ -41348,7 +41348,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; } @@ -41459,7 +41459,10 @@ var ts; } } var failedLookupLocations = []; - var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] }; + var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default : + ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault : + NodeResolutionFeatures.None; + var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] }; var resolved = primaryLookup(); var primary = true; if (!resolved) { @@ -41726,7 +41729,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; } @@ -41757,7 +41760,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(); @@ -41904,10 +41907,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); @@ -42110,7 +42113,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; } @@ -42134,13 +42137,15 @@ var ts; // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690 NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures"; + NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default"; + NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault"; NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode"; })(NodeResolutionFeatures || (NodeResolutionFeatures = {})); function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { var containingDirectory = ts.getDirectoryPath(containingFile); @@ -42223,7 +42228,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) { @@ -42609,7 +42614,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) { @@ -42937,7 +42942,7 @@ var ts; } /* @internal */ function getTypesPackageName(packageName) { - return "@types/" + mangleScopedPackageName(packageName); + return "@types/".concat(mangleScopedPackageName(packageName)); } ts.getTypesPackageName = getTypesPackageName; /* @internal */ @@ -43338,7 +43343,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; @@ -43395,7 +43400,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; @@ -43507,7 +43512,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) { @@ -45580,7 +45585,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) { @@ -47669,7 +47674,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 () { @@ -48103,11 +48108,12 @@ var ts; * * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters. */ - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) { + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) { if (excludeGlobals === void 0) { excludeGlobals = false; } - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol); + if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) { var _a, _b, _c; var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; @@ -48424,7 +48430,7 @@ var ts; } } if (!result) { - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (!errorLocation || !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217 !checkAndReportErrorForExtendingInterface(errorLocation) && @@ -48434,7 +48440,7 @@ var ts; !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { var suggestion = void 0; - if (suggestionCount < maximumSuggestionCount) { + if (getSpellingSuggestions && suggestionCount < maximumSuggestionCount) { suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning); var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration); if (isGlobalScopeAugmentationDeclaration) { @@ -48470,7 +48476,7 @@ var ts; return undefined; } // Perform extra checks only if error reporting was requested - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields)) { // We have a match, but the reference occurred within a property initializer and the identifier also binds // to a local variable in the constructor where the code will be emitted. Note that this is actually allowed @@ -50308,7 +50314,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); } @@ -51156,7 +51162,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()); } @@ -51425,7 +51431,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; } @@ -51540,7 +51546,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) ]; } @@ -51554,7 +51560,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); @@ -52062,7 +52068,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); @@ -52388,7 +52394,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) { @@ -53473,7 +53479,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) { @@ -53548,7 +53554,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 */)); @@ -53595,7 +53601,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) { @@ -53703,15 +53709,15 @@ var ts; if (nameType.flags & 384 /* StringOrNumberLiteral */) { var name = "" + nameType.value; if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) { - return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\""; + return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\""); } if (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), "]"); } } } @@ -56485,7 +56491,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; } @@ -58404,7 +58410,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 @@ -58590,7 +58596,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 : @@ -58601,7 +58607,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 */)); @@ -58674,7 +58680,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; @@ -58875,7 +58881,7 @@ var ts; } function getGlobalSymbol(name, meaning, diagnostic) { // Don't track references for global symbols anyway, so value if `isReference` is arbitrary - return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false); + return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false); } function getGlobalType(name, arity, reportErrors) { var symbol = getGlobalTypeSymbol(name, reportErrors); @@ -59598,9 +59604,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) { @@ -60122,7 +60128,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)); @@ -60182,7 +60188,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)); @@ -61202,7 +61208,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) { @@ -62745,7 +62751,7 @@ var ts; return true; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { - var related = relation.get(getRelationKey(source, target, 0 /* None */, relation)); + var related = relation.get(getRelationKey(source, target, 0 /* None */, relation, /*ignoreConstraints*/ false)); if (related !== undefined) { return !!(related & 1 /* Succeeded */); } @@ -62891,24 +62897,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; } @@ -62937,7 +62943,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; } @@ -62950,7 +62956,7 @@ var ts; break; } default: - return ts.Debug.fail("Unhandled Diagnostic: " + msg.code); + return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code)); } } if (path) { @@ -63594,7 +63600,8 @@ var ts; if (overflow) { return 0 /* False */; } - var id = getRelationKey(source, target, intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0), relation); + var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0); + var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false); var entry = relation.get(id); if (entry !== undefined) { if (reportErrors && entry & 2 /* Failed */ && !(entry & 4 /* Reported */)) { @@ -63621,16 +63628,13 @@ var ts; targetStack = []; } else { - // generate a key where all type parameter id positions are replaced with unconstrained type parameter ids - // this isn't perfect - nested type references passed as type arguments will muck up the indexes and thus - // prevent finding matches- but it should hit up the common cases - var broadestEquivalentId = id.split(",").map(function (i) { return i.replace(/-\d+/g, function (_match, offset) { - var index = ts.length(id.slice(0, offset).match(/[-=]/g) || undefined); - return "=" + index; - }); }).join(","); + // A key that starts with "*" is an indication that we have type references that reference constrained + // type parameters. For such keys we also check against the key we would have gotten if all type parameters + // were unconstrained. + var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, /*ignoreConstraints*/ true) : undefined; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions - if (id === maybeKeys[i] || broadestEquivalentId === maybeKeys[i]) { + if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) { return 3 /* Maybe */; } } @@ -65137,48 +65141,56 @@ var ts; function isTypeReferenceWithGenericArguments(type) { return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return !!(t.flags & 262144 /* TypeParameter */) || isTypeReferenceWithGenericArguments(t); }); } - /** - * getTypeReferenceId(A) returns "111=0-12=1" - * where A.id=111 and number.id=12 - */ - function getTypeReferenceId(type, typeParameters, depth) { - if (depth === void 0) { depth = 0; } - var result = "" + type.target.id; - for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { - var t = _a[_i]; - if (isUnconstrainedTypeParameter(t)) { - var index = typeParameters.indexOf(t); - if (index < 0) { - index = typeParameters.length; - typeParameters.push(t); + function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) { + var typeParameters = []; + var constraintMarker = ""; + var sourceId = getTypeReferenceId(source, 0); + var targetId = getTypeReferenceId(target, 0); + 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) { + if (depth === void 0) { depth = 0; } + var result = "" + type.target.id; + for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 262144 /* TypeParameter */) { + if (ignoreConstraints || isUnconstrainedTypeParameter(t)) { + var index = typeParameters.indexOf(t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + continue; + } + // We mark type references that reference constrained type parameters such that we know to obtain + // and look for a "broadest equivalent key" in the cache. + constraintMarker = "*"; + } + else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { + result += "<" + getTypeReferenceId(t, depth + 1) + ">"; + continue; } - result += "=" + index; - } - else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { - result += "<" + getTypeReferenceId(t, typeParameters, depth + 1) + ">"; - } - else { result += "-" + t.id; } + return result; } - return result; } /** * To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters. * For other cases, the types ids are used. */ - function getRelationKey(source, target, intersectionState, relation) { + function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) { if (relation === identityRelation && source.id > target.id) { var temp = source; source = target; target = temp; } var postFix = intersectionState ? ":" + intersectionState : ""; - if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { - var typeParameters = []; - return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters) + postFix; - } - return source.id + "," + target.id + postFix; + return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? + getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : + "".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. @@ -65226,28 +65238,35 @@ var ts; !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; } // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons - // for 5 or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, + // for maxDepth or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely - // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5 + // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least maxDepth // levels, but unequal at some level beyond that. - // In addition, this will also detect when an indexed access has been chained off of 5 or more times (which is essentially - // the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding false positives - // for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). - // It also detects when a recursive type reference has expanded 5 or more times, eg, if the true branch of + // In addition, this will also detect when an indexed access has been chained off of maxDepth more times (which is + // essentially the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding + // false positives for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). + // It also detects when a recursive type reference has expanded maxDepth or more times, e.g. if the true branch of // `type A = null extends T ? [A>] : [T]` - // has expanded into `[A>>>>>]` - // in such cases we need to terminate the expansion, and we do so here. + // has expanded into `[A>>>>>]`. In such cases we need + // to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth, maxDepth) { - if (maxDepth === void 0) { maxDepth = 5; } + if (maxDepth === void 0) { maxDepth = 3; } if (depth >= maxDepth) { var identity_1 = getRecursionIdentity(type); var count = 0; + var lastTypeId = 0; for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= maxDepth) { - return true; + var t = stack[i]; + if (getRecursionIdentity(t) === identity_1) { + // We only count occurrences with a higher type id than the previous occurrence, since higher + // type ids are an indicator of newer instantiations caused by recursion. + if (t.id >= lastTypeId) { + count++; + if (count >= maxDepth) { + return true; + } } + lastTypeId = t.id; } } } @@ -67290,11 +67309,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); @@ -71056,7 +71075,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; } @@ -72837,7 +72856,7 @@ var ts; } function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ true, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function @@ -80969,7 +80988,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 @@ -87941,7 +87960,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 */ : @@ -88016,7 +88035,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; } @@ -91682,7 +91701,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; } @@ -93074,8 +93093,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); } @@ -94973,7 +94992,7 @@ var ts; specifierSourceImports = ts.createMap(); 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); @@ -96112,11 +96131,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); } } @@ -104925,7 +104944,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 */) { @@ -105136,7 +105155,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() { @@ -105894,7 +105913,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); @@ -106083,7 +106102,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)) { @@ -106374,7 +106393,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, @@ -106415,7 +106434,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; @@ -107307,13 +107326,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")); } } } @@ -107382,7 +107401,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++) { @@ -107401,7 +107420,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*/ @@ -107627,7 +107646,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) { @@ -107676,7 +107695,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) { @@ -107856,7 +107875,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 }); }, @@ -108716,7 +108735,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); @@ -108886,13 +108905,13 @@ 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(snippet) { - nonEscapingWrite("$" + snippet.order); + nonEscapingWrite("$".concat(snippet.order)); } // // Identifiers @@ -110614,17 +110633,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(); } @@ -110632,7 +110651,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(); @@ -110640,7 +110659,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(); @@ -110648,7 +110667,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(); @@ -111423,9 +111442,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); @@ -111902,8 +111921,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(); @@ -112624,7 +112643,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; @@ -112633,11 +112652,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) @@ -112661,7 +112680,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; @@ -112729,36 +112748,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)); } }; } @@ -112768,16 +112787,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; @@ -113084,12 +113103,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; } @@ -113177,9 +113196,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; @@ -113193,7 +113212,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(); @@ -113302,7 +113321,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); } @@ -115386,7 +115405,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; @@ -116207,12 +116226,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; @@ -116265,7 +116284,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; @@ -116723,7 +116742,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); @@ -117231,7 +117250,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); }); @@ -118376,7 +118395,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 { @@ -119490,7 +119509,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); @@ -119593,8 +119612,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) { @@ -119602,8 +119621,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); }; } @@ -119631,7 +119650,7 @@ var ts; if (errorCount === 0) return ""; var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount); - return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine; + return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine); } ts.getErrorSummaryText = getErrorSummaryText; function isBuilderProgram(program) { @@ -119657,9 +119676,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; @@ -119699,7 +119718,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; @@ -119708,7 +119727,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) { @@ -119832,7 +119851,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); } @@ -120160,7 +120179,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); @@ -120309,10 +120328,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; @@ -120473,7 +120492,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() { @@ -120533,7 +120552,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(); @@ -120574,7 +120593,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); @@ -120878,8 +120897,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); }; } @@ -121654,7 +121673,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) { @@ -121683,7 +121702,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); @@ -121711,7 +121730,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) { @@ -122070,7 +122089,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; } @@ -124898,7 +124917,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)); @@ -125146,7 +125165,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; } @@ -125256,7 +125275,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) { @@ -125628,7 +125647,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]; } @@ -125735,13 +125754,13 @@ var ts; ts.getNameForExportedSymbol = getNameForExportedSymbol; 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 @@ -125949,7 +125968,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, @@ -125962,7 +125981,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("|")); @@ -126042,7 +126061,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; @@ -126096,7 +126115,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; @@ -126629,7 +126648,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); @@ -127497,7 +127516,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); @@ -128226,10 +128245,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) { @@ -128532,15 +128551,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); @@ -128554,7 +128573,7 @@ var ts; if (isJsxInitializer) { if (insertText === undefined) insertText = name; - insertText = "{" + insertText + "}"; + insertText = "{".concat(insertText, "}"); if (typeof isJsxInitializer !== "boolean") { replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile); } @@ -128567,8 +128586,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)) { @@ -128599,7 +128618,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 { @@ -128608,7 +128627,7 @@ var ts; } } if (useBraces_1) { - insertText = ts.escapeSnippetText(name) + "={$1}"; + insertText = "".concat(ts.escapeSnippetText(name), "={$1}"); isSnippet = true; } } @@ -128872,14 +128891,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) { @@ -131778,7 +131797,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) { @@ -132790,7 +132809,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: @@ -133370,7 +133389,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) @@ -134654,8 +134673,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"); @@ -135916,7 +135935,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 @@ -136048,11 +136067,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); }); @@ -136892,7 +136911,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); @@ -136902,7 +136921,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 */; @@ -137098,10 +137117,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 ""; @@ -137114,7 +137133,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; @@ -139546,7 +139565,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 }; @@ -139718,7 +139737,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"; @@ -139782,7 +139801,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, @@ -139790,7 +139809,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, @@ -139798,7 +139817,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, @@ -140333,7 +140352,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; @@ -144451,7 +144470,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) { @@ -144651,7 +144670,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) { @@ -144685,7 +144704,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 */)); } @@ -144742,7 +144761,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 }); } } @@ -144787,7 +144806,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), " ") }); } } }; @@ -144889,7 +144908,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. @@ -144986,7 +145005,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; } @@ -147458,7 +147477,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; @@ -147558,7 +147577,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) { @@ -147609,7 +147628,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]; @@ -147743,7 +147762,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)); } } /** @@ -147800,7 +147819,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; @@ -147880,7 +147899,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], @@ -148277,7 +148296,7 @@ var ts; 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 @@ -148321,7 +148340,7 @@ var ts; return newEntry; } function newImportsKey(moduleSpecifier, topLevelTypeOnly) { - return (topLevelTypeOnly ? 1 : 0) + "|" + moduleSpecifier; + return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier); } } function writeFixes(changeTracker) { @@ -148774,7 +148793,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) { @@ -148881,7 +148900,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]; @@ -148905,7 +148924,7 @@ var ts; return [importKind === 1 /* Default */ ? ts.Diagnostics.Import_default_0_from_module_1 : ts.Diagnostics.Import_0_from_module_1, symbolName, moduleSpecifier]; } default: - return ts.Debug.assertNever(fix, "Unexpected fix kind " + fix.kind); + return ts.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind)); } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, compilerOptions) { @@ -149001,7 +149020,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; @@ -149094,7 +149113,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 = {})); @@ -150294,7 +150313,7 @@ var ts; break; } default: - ts.Debug.fail("Bad fixId: " + context.fixId); + ts.Debug.fail("Bad fixId: ".concat(context.fixId)); } }); }, @@ -150742,7 +150761,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 = {})); @@ -150933,11 +150952,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))); } }); } @@ -151273,7 +151292,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); @@ -152422,7 +152441,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 */; @@ -152525,7 +152544,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)) { @@ -152791,7 +152810,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 @@ -152826,7 +152845,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); @@ -153077,7 +153096,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), @@ -154101,7 +154120,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)); } } } @@ -154189,7 +154208,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) { @@ -154753,7 +154772,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, @@ -154898,7 +154917,7 @@ var ts; usedFunctionNames.set(description, true); functionActions.push({ description: description, - name: "function_scope_" + i, + name: "function_scope_".concat(i), kind: extractFunctionAction.kind }); } @@ -154906,7 +154925,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 }; @@ -154922,7 +154941,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 }); } @@ -154930,7 +154949,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 }; @@ -155514,28 +155533,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; @@ -157002,7 +157021,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) { @@ -157039,7 +157058,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) { @@ -157126,7 +157145,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) { @@ -157226,7 +157245,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) { @@ -157333,7 +157352,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) { @@ -157448,7 +157467,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) { @@ -157509,7 +157528,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) { @@ -157531,7 +157550,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;` */ @@ -158169,7 +158188,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 = {})); @@ -158873,7 +158892,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)); } @@ -159755,7 +159774,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; }); @@ -160430,7 +160449,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: "" }; + return { newText: "") }; } var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent : ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined; @@ -160536,7 +160555,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. @@ -160931,14 +160950,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; @@ -161920,13 +161939,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; @@ -162008,7 +162027,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 () { @@ -162024,43 +162043,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; @@ -162076,7 +162095,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 /** @@ -162085,7 +162104,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 @@ -162093,12 +162112,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 /** @@ -162107,7 +162126,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 @@ -162115,7 +162134,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 /** @@ -162124,7 +162143,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 /** @@ -162133,37 +162152,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); }); @@ -162171,23 +162190,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)); @@ -162202,108 +162221,108 @@ var ts; */ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences) { var _this = this; - return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); }); + return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ")"), function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); }); }; /** 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)); @@ -162353,7 +162372,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; @@ -162368,7 +162387,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 { @@ -162380,7 +162399,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 { @@ -162395,7 +162414,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); }); @@ -162417,7 +162436,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); @@ -162617,7 +162636,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 = {})); @@ -162628,7 +162647,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; @@ -162681,7 +162700,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) { @@ -162760,7 +162779,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 = []; @@ -162774,7 +162793,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)) { @@ -162783,7 +162802,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); } /** @@ -162796,7 +162815,7 @@ var ts; filesToWatch.push(jsonPath); var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config; var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys); - addInferredTypings(jsonTypingNames, "Typing names in '" + jsonPath + "' dependencies"); + addInferredTypings(jsonTypingNames, "Typing names in '".concat(jsonPath, "' dependencies")); } /** * Infer typing names from given file names. For example, the file name "jquery-min.2.3.4.js" @@ -162835,7 +162854,7 @@ var ts; // depth of 2, so we access `node_modules/foo` but not `node_modules/foo/bar` var fileNames = host.readDirectory(packagesFolderPath, [".json" /* Json */], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); if (log) - log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(fileNames)); + log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(fileNames))); var packageNames = []; for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; @@ -162862,7 +162881,7 @@ var ts; if (ownTypes) { var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName)); if (log) - log(" Package '" + packageJson.name + "' provides its own types."); + log(" Package '".concat(packageJson.name, "' provides its own types.")); inferredTypings.set(packageJson.name, absolutePath); } else { @@ -162934,15 +162953,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: @@ -162995,7 +163014,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 = {})); @@ -163036,12 +163055,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() { @@ -163076,7 +163095,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) { @@ -163090,7 +163109,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(); @@ -163119,7 +163138,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(); }; @@ -163471,8 +163490,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; @@ -163615,7 +163634,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 }; } @@ -163991,14 +164010,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 = {})); @@ -164310,11 +164329,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; @@ -164462,12 +164481,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); } @@ -164645,7 +164664,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); } @@ -164748,7 +164767,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; }); }; @@ -164991,7 +165010,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(); @@ -165093,7 +165112,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); } @@ -165153,7 +165172,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)) @@ -165205,20 +165224,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) { @@ -165380,7 +165399,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; @@ -165393,9 +165412,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); }; @@ -165418,13 +165437,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 = { @@ -165441,7 +165460,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]; } } @@ -165450,7 +165469,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*/ @@ -165965,7 +165984,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 @@ -166391,7 +166410,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; @@ -166596,7 +166615,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); @@ -166614,7 +166633,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(); } @@ -166936,7 +166955,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); @@ -167059,13 +167078,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()); @@ -167466,15 +167485,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); @@ -167493,8 +167512,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(); }; @@ -167533,7 +167552,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; } @@ -167602,7 +167621,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 @@ -167713,12 +167732,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() }; @@ -167748,7 +167767,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(); @@ -167904,7 +167923,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(); @@ -168043,7 +168062,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 @@ -168227,9 +168246,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; @@ -168408,13 +168427,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)); @@ -168446,7 +168465,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.")); } } }; @@ -168658,7 +168677,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) { @@ -168670,7 +168689,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) @@ -168724,7 +168743,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 { @@ -168754,7 +168773,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) { @@ -168816,7 +168835,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); @@ -168859,7 +168878,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); @@ -169160,7 +169179,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++) { @@ -169185,7 +169204,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 "\\*"; } @@ -169233,7 +169252,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; @@ -169363,8 +169382,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 @@ -169602,7 +169621,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 }; @@ -169761,10 +169780,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; /** @@ -169829,7 +169848,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()) { @@ -170614,14 +170633,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; @@ -170696,7 +170715,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 @@ -170726,17 +170745,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++; @@ -170751,12 +170770,12 @@ 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; } 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) { @@ -170894,7 +170913,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(); @@ -171308,7 +171327,7 @@ var ts; var refs = references.map(function (entry) { return referenceEntryToReferencesResponseItem(_this.projectService, entry); }); return { refs: refs, - symbolName: "\"" + args.file + "\"" + symbolName: "\"".concat(args.file, "\"") }; }; /** @@ -171852,7 +171871,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; } @@ -172129,7 +172148,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); }; @@ -172158,8 +172177,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 }; } }; @@ -172170,7 +172189,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; @@ -172186,10 +172205,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 @@ -173125,7 +173144,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; @@ -173242,12 +173261,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); }; @@ -174310,23 +174329,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) { @@ -174334,7 +174353,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' @@ -174477,7 +174496,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; } } @@ -174546,7 +174565,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); @@ -174570,7 +174589,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; } } @@ -174596,13 +174615,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); }; @@ -174612,7 +174631,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); @@ -174620,7 +174639,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: @@ -174698,7 +174717,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); @@ -174711,7 +174730,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); @@ -174759,7 +174778,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; @@ -174837,7 +174856,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) { @@ -174847,7 +174866,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" @@ -175005,10 +175024,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 a51a6d46f6588..78e20898bdfb9 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -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 = "4.5.2"; + ts.version = "4.5.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -335,7 +335,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 */ @@ -1698,7 +1698,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. */ @@ -1789,7 +1789,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); @@ -2239,7 +2239,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; /** @@ -2552,7 +2552,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); } @@ -2560,12 +2560,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()); } @@ -2575,26 +2575,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; @@ -2635,42 +2635,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; @@ -2691,7 +2691,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; /** @@ -2712,7 +2712,7 @@ var ts; break; } if (enumValue !== 0 && enumValue & value) { - result = "" + result + (result ? "|" : "") + enumName; + result = "".concat(result).concat(result ? "|" : "").concat(enumName); remainingFlags &= ~enumValue; } } @@ -2822,7 +2822,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); } }, @@ -2861,7 +2861,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); } } }); @@ -2916,7 +2916,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); } } @@ -2926,11 +2926,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" : @@ -2949,7 +2949,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); } }, @@ -2985,11 +2985,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" : @@ -3021,7 +3021,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); } }, @@ -3068,10 +3068,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) { @@ -3202,11 +3202,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); @@ -3473,7 +3473,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*/ @@ -3771,7 +3771,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; @@ -3783,11 +3783,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, @@ -3877,7 +3877,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) { @@ -3886,11 +3886,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"); @@ -6697,7 +6697,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; @@ -7162,7 +7162,7 @@ var ts; } function onTimerToUpdateChildWatches() { timerToUpdateChildWatches = undefined; - ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size)); var start = ts.timestamp(); var invokeMap = new ts.Map(); while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { @@ -7175,7 +7175,7 @@ var ts; var hasChanges = updateChildWatches(dirName, dirPath, options); invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames); } - ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size)); callbackCache.forEach(function (callbacks, rootDirName) { var existing = invokeMap.get(rootDirName); if (existing) { @@ -7191,7 +7191,7 @@ var ts; } }); var elapsed = ts.timestamp() - start; - ts.sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches); + ts.sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches)); } function removeChildWatches(parentWatcher) { if (!parentWatcher) @@ -7651,7 +7651,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) { @@ -7660,7 +7660,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++; } } @@ -7676,7 +7676,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) { @@ -7778,7 +7778,7 @@ var ts; * @param createWatcher */ function invokeCallbackAndUpdateWatcher(createWatcher) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher"); + ts.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 @@ -7803,7 +7803,7 @@ var ts; } } if (hitSystemWatcherLimit) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } try { @@ -7819,7 +7819,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"); - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } } @@ -10121,7 +10121,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; @@ -13001,7 +13001,7 @@ var ts; return typeof comment === "string" ? comment : comment === null || comment === void 0 ? void 0 : comment.map(function (c) { // TODO: Other kinds here - return c.kind === 319 /* JSDocText */ ? c.text : "{@link " + (c.name ? ts.entityNameToString(c.name) + " " : "") + c.text + "}"; + return c.kind === 319 /* JSDocText */ ? c.text : "{@link ".concat(c.name ? ts.entityNameToString(c.name) + " " : "").concat(c.text, "}"); }).join(""); } ts.getTextOfJSDocComment = getTextOfJSDocComment; @@ -14271,8 +14271,8 @@ var ts; } function packageIdToString(_a) { var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; - var fullName = subModuleName ? name + "/" + subModuleName : name; - return fullName + "@" + version; + var fullName = subModuleName ? "".concat(name, "/").concat(subModuleName) : name; + return "".concat(fullName, "@").concat(version); } ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { @@ -14351,7 +14351,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) { @@ -14490,7 +14490,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(); @@ -14507,10 +14507,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; } } @@ -14725,7 +14725,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) { @@ -17256,11 +17256,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) { @@ -19953,7 +19953,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) { @@ -20070,7 +20070,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 @@ -20083,7 +20083,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 = { @@ -20092,7 +20092,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 = { @@ -20110,10 +20110,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) { @@ -20135,7 +20135,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) { @@ -20213,7 +20213,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"), @@ -20494,7 +20494,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) { @@ -26483,7 +26483,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; @@ -26811,7 +26811,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) { @@ -31349,7 +31349,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; @@ -38113,7 +38113,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; } @@ -39575,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) { @@ -40370,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; @@ -40424,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); } @@ -40445,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; @@ -40861,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; @@ -41106,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); }); @@ -41542,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; } @@ -41653,7 +41653,10 @@ var ts; } } var failedLookupLocations = []; - var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] }; + var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default : + ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault : + NodeResolutionFeatures.None; + var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] }; var resolved = primaryLookup(); var primary = true; if (!resolved) { @@ -41920,7 +41923,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; } @@ -41951,7 +41954,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(); @@ -42098,10 +42101,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); @@ -42304,7 +42307,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; } @@ -42328,13 +42331,15 @@ var ts; // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690 NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures"; + NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default"; + NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault"; NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode"; })(NodeResolutionFeatures || (NodeResolutionFeatures = {})); function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { var containingDirectory = ts.getDirectoryPath(containingFile); @@ -42417,7 +42422,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) { @@ -42803,7 +42808,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) { @@ -43131,7 +43136,7 @@ var ts; } /* @internal */ function getTypesPackageName(packageName) { - return "@types/" + mangleScopedPackageName(packageName); + return "@types/".concat(mangleScopedPackageName(packageName)); } ts.getTypesPackageName = getTypesPackageName; /* @internal */ @@ -43532,7 +43537,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; @@ -43589,7 +43594,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; @@ -43701,7 +43706,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) { @@ -45774,7 +45779,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) { @@ -47863,7 +47868,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 () { @@ -48297,11 +48302,12 @@ var ts; * * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters. */ - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) { + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) { if (excludeGlobals === void 0) { excludeGlobals = false; } - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol); + if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) { var _a, _b, _c; var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; @@ -48618,7 +48624,7 @@ var ts; } } if (!result) { - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (!errorLocation || !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217 !checkAndReportErrorForExtendingInterface(errorLocation) && @@ -48628,7 +48634,7 @@ var ts; !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { var suggestion = void 0; - if (suggestionCount < maximumSuggestionCount) { + if (getSpellingSuggestions && suggestionCount < maximumSuggestionCount) { suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning); var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration); if (isGlobalScopeAugmentationDeclaration) { @@ -48664,7 +48670,7 @@ var ts; return undefined; } // Perform extra checks only if error reporting was requested - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields)) { // We have a match, but the reference occurred within a property initializer and the identifier also binds // to a local variable in the constructor where the code will be emitted. Note that this is actually allowed @@ -50502,7 +50508,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); } @@ -51350,7 +51356,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()); } @@ -51619,7 +51625,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; } @@ -51734,7 +51740,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) ]; } @@ -51748,7 +51754,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); @@ -52256,7 +52262,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); @@ -52582,7 +52588,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) { @@ -53667,7 +53673,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) { @@ -53742,7 +53748,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 */)); @@ -53789,7 +53795,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) { @@ -53897,15 +53903,15 @@ var ts; if (nameType.flags & 384 /* StringOrNumberLiteral */) { var name = "" + nameType.value; if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) { - return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\""; + return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\""); } if (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), "]"); } } } @@ -56679,7 +56685,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; } @@ -58598,7 +58604,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 @@ -58784,7 +58790,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 : @@ -58795,7 +58801,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 */)); @@ -58868,7 +58874,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; @@ -59069,7 +59075,7 @@ var ts; } function getGlobalSymbol(name, meaning, diagnostic) { // Don't track references for global symbols anyway, so value if `isReference` is arbitrary - return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false); + return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false); } function getGlobalType(name, arity, reportErrors) { var symbol = getGlobalTypeSymbol(name, reportErrors); @@ -59792,9 +59798,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) { @@ -60316,7 +60322,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)); @@ -60376,7 +60382,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)); @@ -61396,7 +61402,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) { @@ -62939,7 +62945,7 @@ var ts; return true; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { - var related = relation.get(getRelationKey(source, target, 0 /* None */, relation)); + var related = relation.get(getRelationKey(source, target, 0 /* None */, relation, /*ignoreConstraints*/ false)); if (related !== undefined) { return !!(related & 1 /* Succeeded */); } @@ -63085,24 +63091,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; } @@ -63131,7 +63137,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; } @@ -63144,7 +63150,7 @@ var ts; break; } default: - return ts.Debug.fail("Unhandled Diagnostic: " + msg.code); + return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code)); } } if (path) { @@ -63788,7 +63794,8 @@ var ts; if (overflow) { return 0 /* False */; } - var id = getRelationKey(source, target, intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0), relation); + var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0); + var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false); var entry = relation.get(id); if (entry !== undefined) { if (reportErrors && entry & 2 /* Failed */ && !(entry & 4 /* Reported */)) { @@ -63815,16 +63822,13 @@ var ts; targetStack = []; } else { - // generate a key where all type parameter id positions are replaced with unconstrained type parameter ids - // this isn't perfect - nested type references passed as type arguments will muck up the indexes and thus - // prevent finding matches- but it should hit up the common cases - var broadestEquivalentId = id.split(",").map(function (i) { return i.replace(/-\d+/g, function (_match, offset) { - var index = ts.length(id.slice(0, offset).match(/[-=]/g) || undefined); - return "=" + index; - }); }).join(","); + // A key that starts with "*" is an indication that we have type references that reference constrained + // type parameters. For such keys we also check against the key we would have gotten if all type parameters + // were unconstrained. + var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, /*ignoreConstraints*/ true) : undefined; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions - if (id === maybeKeys[i] || broadestEquivalentId === maybeKeys[i]) { + if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) { return 3 /* Maybe */; } } @@ -65331,48 +65335,56 @@ var ts; function isTypeReferenceWithGenericArguments(type) { return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return !!(t.flags & 262144 /* TypeParameter */) || isTypeReferenceWithGenericArguments(t); }); } - /** - * getTypeReferenceId(A) returns "111=0-12=1" - * where A.id=111 and number.id=12 - */ - function getTypeReferenceId(type, typeParameters, depth) { - if (depth === void 0) { depth = 0; } - var result = "" + type.target.id; - for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { - var t = _a[_i]; - if (isUnconstrainedTypeParameter(t)) { - var index = typeParameters.indexOf(t); - if (index < 0) { - index = typeParameters.length; - typeParameters.push(t); + function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) { + var typeParameters = []; + var constraintMarker = ""; + var sourceId = getTypeReferenceId(source, 0); + var targetId = getTypeReferenceId(target, 0); + 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) { + if (depth === void 0) { depth = 0; } + var result = "" + type.target.id; + for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 262144 /* TypeParameter */) { + if (ignoreConstraints || isUnconstrainedTypeParameter(t)) { + var index = typeParameters.indexOf(t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + continue; + } + // We mark type references that reference constrained type parameters such that we know to obtain + // and look for a "broadest equivalent key" in the cache. + constraintMarker = "*"; + } + else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { + result += "<" + getTypeReferenceId(t, depth + 1) + ">"; + continue; } - result += "=" + index; - } - else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { - result += "<" + getTypeReferenceId(t, typeParameters, depth + 1) + ">"; - } - else { result += "-" + t.id; } + return result; } - return result; } /** * To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters. * For other cases, the types ids are used. */ - function getRelationKey(source, target, intersectionState, relation) { + function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) { if (relation === identityRelation && source.id > target.id) { var temp = source; source = target; target = temp; } var postFix = intersectionState ? ":" + intersectionState : ""; - if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { - var typeParameters = []; - return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters) + postFix; - } - return source.id + "," + target.id + postFix; + return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? + getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : + "".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. @@ -65420,28 +65432,35 @@ var ts; !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; } // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons - // for 5 or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, + // for maxDepth or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely - // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5 + // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least maxDepth // levels, but unequal at some level beyond that. - // In addition, this will also detect when an indexed access has been chained off of 5 or more times (which is essentially - // the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding false positives - // for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). - // It also detects when a recursive type reference has expanded 5 or more times, eg, if the true branch of + // In addition, this will also detect when an indexed access has been chained off of maxDepth more times (which is + // essentially the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding + // false positives for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). + // It also detects when a recursive type reference has expanded maxDepth or more times, e.g. if the true branch of // `type A = null extends T ? [A>] : [T]` - // has expanded into `[A>>>>>]` - // in such cases we need to terminate the expansion, and we do so here. + // has expanded into `[A>>>>>]`. In such cases we need + // to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth, maxDepth) { - if (maxDepth === void 0) { maxDepth = 5; } + if (maxDepth === void 0) { maxDepth = 3; } if (depth >= maxDepth) { var identity_1 = getRecursionIdentity(type); var count = 0; + var lastTypeId = 0; for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= maxDepth) { - return true; + var t = stack[i]; + if (getRecursionIdentity(t) === identity_1) { + // We only count occurrences with a higher type id than the previous occurrence, since higher + // type ids are an indicator of newer instantiations caused by recursion. + if (t.id >= lastTypeId) { + count++; + if (count >= maxDepth) { + return true; + } } + lastTypeId = t.id; } } } @@ -67484,11 +67503,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); @@ -71250,7 +71269,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; } @@ -73031,7 +73050,7 @@ var ts; } function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ true, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function @@ -81163,7 +81182,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 @@ -88135,7 +88154,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 */ : @@ -88210,7 +88229,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; } @@ -91876,7 +91895,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; } @@ -93268,8 +93287,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); } @@ -95167,7 +95186,7 @@ var ts; specifierSourceImports = ts.createMap(); 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); @@ -96306,11 +96325,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); } } @@ -105119,7 +105138,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 */) { @@ -105330,7 +105349,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() { @@ -106088,7 +106107,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); @@ -106277,7 +106296,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)) { @@ -106568,7 +106587,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, @@ -106609,7 +106628,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; @@ -107501,13 +107520,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")); } } } @@ -107576,7 +107595,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++) { @@ -107595,7 +107614,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*/ @@ -107821,7 +107840,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) { @@ -107870,7 +107889,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) { @@ -108050,7 +108069,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 }); }, @@ -108910,7 +108929,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); @@ -109080,13 +109099,13 @@ 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(snippet) { - nonEscapingWrite("$" + snippet.order); + nonEscapingWrite("$".concat(snippet.order)); } // // Identifiers @@ -110808,17 +110827,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(); } @@ -110826,7 +110845,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(); @@ -110834,7 +110853,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(); @@ -110842,7 +110861,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(); @@ -111617,9 +111636,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); @@ -112096,8 +112115,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(); @@ -112818,7 +112837,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; @@ -112827,11 +112846,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) @@ -112855,7 +112874,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; @@ -112923,36 +112942,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)); } }; } @@ -112962,16 +112981,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; @@ -113278,12 +113297,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; } @@ -113371,9 +113390,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; @@ -113387,7 +113406,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(); @@ -113496,7 +113515,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); } @@ -115580,7 +115599,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; @@ -116401,12 +116420,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; @@ -116459,7 +116478,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; @@ -116917,7 +116936,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); @@ -117425,7 +117444,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); }); @@ -118570,7 +118589,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 { @@ -119684,7 +119703,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); @@ -119787,8 +119806,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) { @@ -119796,8 +119815,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); }; } @@ -119825,7 +119844,7 @@ var ts; if (errorCount === 0) return ""; var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount); - return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine; + return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine); } ts.getErrorSummaryText = getErrorSummaryText; function isBuilderProgram(program) { @@ -119851,9 +119870,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; @@ -119893,7 +119912,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; @@ -119902,7 +119921,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) { @@ -120026,7 +120045,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); } @@ -120354,7 +120373,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); @@ -120503,10 +120522,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; @@ -120667,7 +120686,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() { @@ -120727,7 +120746,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(); @@ -120768,7 +120787,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); @@ -121072,8 +121091,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); }; } @@ -121848,7 +121867,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) { @@ -121877,7 +121896,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); @@ -121905,7 +121924,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) { @@ -122264,7 +122283,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; } @@ -122597,7 +122616,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 = {})); @@ -122608,7 +122627,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; @@ -122661,7 +122680,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) { @@ -122740,7 +122759,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 = []; @@ -122754,7 +122773,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)) { @@ -122763,7 +122782,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); } /** @@ -122776,7 +122795,7 @@ var ts; filesToWatch.push(jsonPath); var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config; var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys); - addInferredTypings(jsonTypingNames, "Typing names in '" + jsonPath + "' dependencies"); + addInferredTypings(jsonTypingNames, "Typing names in '".concat(jsonPath, "' dependencies")); } /** * Infer typing names from given file names. For example, the file name "jquery-min.2.3.4.js" @@ -122815,7 +122834,7 @@ var ts; // depth of 2, so we access `node_modules/foo` but not `node_modules/foo/bar` var fileNames = host.readDirectory(packagesFolderPath, [".json" /* Json */], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); if (log) - log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(fileNames)); + log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(fileNames))); var packageNames = []; for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; @@ -122842,7 +122861,7 @@ var ts; if (ownTypes) { var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName)); if (log) - log(" Package '" + packageJson.name + "' provides its own types."); + log(" Package '".concat(packageJson.name, "' provides its own types.")); inferredTypings.set(packageJson.name, absolutePath); } else { @@ -122914,15 +122933,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: @@ -125480,7 +125499,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)); @@ -125728,7 +125747,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; } @@ -125838,7 +125857,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) { @@ -126210,7 +126229,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]; } @@ -126317,13 +126336,13 @@ var ts; ts.getNameForExportedSymbol = getNameForExportedSymbol; 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 @@ -126531,7 +126550,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, @@ -126544,7 +126563,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("|")); @@ -126624,7 +126643,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; @@ -126678,7 +126697,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; @@ -127211,7 +127230,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); @@ -128079,7 +128098,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); @@ -128808,10 +128827,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) { @@ -129114,15 +129133,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); @@ -129136,7 +129155,7 @@ var ts; if (isJsxInitializer) { if (insertText === undefined) insertText = name; - insertText = "{" + insertText + "}"; + insertText = "{".concat(insertText, "}"); if (typeof isJsxInitializer !== "boolean") { replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile); } @@ -129149,8 +129168,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)) { @@ -129181,7 +129200,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 { @@ -129190,7 +129209,7 @@ var ts; } } if (useBraces_1) { - insertText = ts.escapeSnippetText(name) + "={$1}"; + insertText = "".concat(ts.escapeSnippetText(name), "={$1}"); isSnippet = true; } } @@ -129454,14 +129473,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) { @@ -132360,7 +132379,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) { @@ -133372,7 +133391,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: @@ -133952,7 +133971,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) @@ -135236,8 +135255,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"); @@ -136498,7 +136517,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 @@ -136630,11 +136649,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); }); @@ -137474,7 +137493,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); @@ -137484,7 +137503,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 */; @@ -137680,10 +137699,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 ""; @@ -137696,7 +137715,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; @@ -140128,7 +140147,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 }; @@ -140300,7 +140319,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"; @@ -140364,7 +140383,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, @@ -140372,7 +140391,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, @@ -140380,7 +140399,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, @@ -140915,7 +140934,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; @@ -145033,7 +145052,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) { @@ -145233,7 +145252,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) { @@ -145267,7 +145286,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 */)); } @@ -145324,7 +145343,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 }); } } @@ -145369,7 +145388,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), " ") }); } } }; @@ -145471,7 +145490,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. @@ -145568,7 +145587,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; } @@ -148040,7 +148059,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; @@ -148140,7 +148159,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) { @@ -148191,7 +148210,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]; @@ -148325,7 +148344,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)); } } /** @@ -148382,7 +148401,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; @@ -148462,7 +148481,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], @@ -148859,7 +148878,7 @@ var ts; 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 @@ -148903,7 +148922,7 @@ var ts; return newEntry; } function newImportsKey(moduleSpecifier, topLevelTypeOnly) { - return (topLevelTypeOnly ? 1 : 0) + "|" + moduleSpecifier; + return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier); } } function writeFixes(changeTracker) { @@ -149356,7 +149375,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) { @@ -149463,7 +149482,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]; @@ -149487,7 +149506,7 @@ var ts; return [importKind === 1 /* Default */ ? ts.Diagnostics.Import_default_0_from_module_1 : ts.Diagnostics.Import_0_from_module_1, symbolName, moduleSpecifier]; } default: - return ts.Debug.assertNever(fix, "Unexpected fix kind " + fix.kind); + return ts.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind)); } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, compilerOptions) { @@ -149583,7 +149602,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; @@ -149676,7 +149695,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 = {})); @@ -150876,7 +150895,7 @@ var ts; break; } default: - ts.Debug.fail("Bad fixId: " + context.fixId); + ts.Debug.fail("Bad fixId: ".concat(context.fixId)); } }); }, @@ -151324,7 +151343,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 = {})); @@ -151515,11 +151534,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))); } }); } @@ -151855,7 +151874,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); @@ -153004,7 +153023,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 */; @@ -153107,7 +153126,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)) { @@ -153373,7 +153392,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 @@ -153408,7 +153427,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); @@ -153659,7 +153678,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), @@ -154683,7 +154702,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)); } } } @@ -154771,7 +154790,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) { @@ -155335,7 +155354,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, @@ -155480,7 +155499,7 @@ var ts; usedFunctionNames.set(description, true); functionActions.push({ description: description, - name: "function_scope_" + i, + name: "function_scope_".concat(i), kind: extractFunctionAction.kind }); } @@ -155488,7 +155507,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 }; @@ -155504,7 +155523,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 }); } @@ -155512,7 +155531,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 }; @@ -156096,28 +156115,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; @@ -157584,7 +157603,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) { @@ -157621,7 +157640,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) { @@ -157708,7 +157727,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) { @@ -157808,7 +157827,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) { @@ -157915,7 +157934,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) { @@ -158030,7 +158049,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) { @@ -158091,7 +158110,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) { @@ -158113,7 +158132,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;` */ @@ -158751,7 +158770,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 = {})); @@ -159455,7 +159474,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)); } @@ -160337,7 +160356,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; }); @@ -161012,7 +161031,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: "" }; + return { newText: "") }; } var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent : ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined; @@ -161118,7 +161137,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. @@ -161513,14 +161532,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; @@ -162502,13 +162521,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; @@ -162590,7 +162609,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 () { @@ -162606,43 +162625,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; @@ -162658,7 +162677,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 /** @@ -162667,7 +162686,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 @@ -162675,12 +162694,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 /** @@ -162689,7 +162708,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 @@ -162697,7 +162716,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 /** @@ -162706,7 +162725,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 /** @@ -162715,37 +162734,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); }); @@ -162753,23 +162772,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)); @@ -162784,108 +162803,108 @@ var ts; */ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences) { var _this = this; - return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); }); + return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ")"), function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); }); }; /** 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)); @@ -162935,7 +162954,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; @@ -162950,7 +162969,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 { @@ -162962,7 +162981,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 { @@ -162977,7 +162996,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); }); @@ -162999,7 +163018,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); @@ -163189,7 +163208,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 = {})); @@ -163230,12 +163249,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() { @@ -163270,7 +163289,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) { @@ -163284,7 +163303,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(); @@ -163313,7 +163332,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(); }; @@ -163665,8 +163684,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; @@ -163809,7 +163828,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 }; } @@ -164185,14 +164204,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 = {})); @@ -164504,11 +164523,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; @@ -164656,12 +164675,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); } @@ -164839,7 +164858,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); } @@ -164942,7 +164961,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; }); }; @@ -165185,7 +165204,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(); @@ -165287,7 +165306,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); } @@ -165347,7 +165366,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)) @@ -165399,20 +165418,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) { @@ -165574,7 +165593,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; @@ -165587,9 +165606,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); }; @@ -165612,13 +165631,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 = { @@ -165635,7 +165654,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]; } } @@ -165644,7 +165663,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*/ @@ -166159,7 +166178,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 @@ -166585,7 +166604,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; @@ -166790,7 +166809,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); @@ -166808,7 +166827,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(); } @@ -167130,7 +167149,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); @@ -167253,13 +167272,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()); @@ -167660,15 +167679,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); @@ -167687,8 +167706,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(); }; @@ -167727,7 +167746,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; } @@ -167796,7 +167815,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 @@ -167907,12 +167926,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() }; @@ -167942,7 +167961,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(); @@ -168098,7 +168117,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(); @@ -168237,7 +168256,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 @@ -168421,9 +168440,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; @@ -168602,13 +168621,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)); @@ -168640,7 +168659,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.")); } } }; @@ -168852,7 +168871,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) { @@ -168864,7 +168883,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) @@ -168918,7 +168937,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 { @@ -168948,7 +168967,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) { @@ -169010,7 +169029,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); @@ -169053,7 +169072,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); @@ -169354,7 +169373,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++) { @@ -169379,7 +169398,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 "\\*"; } @@ -169427,7 +169446,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; @@ -169557,8 +169576,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 @@ -169796,7 +169815,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 }; @@ -169955,10 +169974,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; /** @@ -170023,7 +170042,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()) { @@ -170808,14 +170827,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; @@ -170890,7 +170909,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 @@ -170920,17 +170939,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++; @@ -170945,12 +170964,12 @@ 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; } 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) { @@ -171088,7 +171107,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(); @@ -171502,7 +171521,7 @@ var ts; var refs = references.map(function (entry) { return referenceEntryToReferencesResponseItem(_this.projectService, entry); }); return { refs: refs, - symbolName: "\"" + args.file + "\"" + symbolName: "\"".concat(args.file, "\"") }; }; /** @@ -172046,7 +172065,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; } @@ -172323,7 +172342,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); }; @@ -172352,8 +172371,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 }; } }; @@ -172364,7 +172383,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; @@ -172380,10 +172399,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 6076298b6efed..6b649f9a34a6b 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -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 = "4.5.2"; + ts.version = "4.5.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -335,7 +335,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 */ @@ -1698,7 +1698,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. */ @@ -1789,7 +1789,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); @@ -2239,7 +2239,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; /** @@ -2552,7 +2552,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); } @@ -2560,12 +2560,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()); } @@ -2575,26 +2575,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; @@ -2635,42 +2635,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; @@ -2691,7 +2691,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; /** @@ -2712,7 +2712,7 @@ var ts; break; } if (enumValue !== 0 && enumValue & value) { - result = "" + result + (result ? "|" : "") + enumName; + result = "".concat(result).concat(result ? "|" : "").concat(enumName); remainingFlags &= ~enumValue; } } @@ -2822,7 +2822,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); } }, @@ -2861,7 +2861,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); } } }); @@ -2916,7 +2916,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); } } @@ -2926,11 +2926,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" : @@ -2949,7 +2949,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); } }, @@ -2985,11 +2985,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" : @@ -3021,7 +3021,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); } }, @@ -3068,10 +3068,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) { @@ -3202,11 +3202,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); @@ -3473,7 +3473,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*/ @@ -3771,7 +3771,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; @@ -3783,11 +3783,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, @@ -3877,7 +3877,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) { @@ -3886,11 +3886,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"); @@ -6697,7 +6697,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; @@ -7162,7 +7162,7 @@ var ts; } function onTimerToUpdateChildWatches() { timerToUpdateChildWatches = undefined; - ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size)); var start = ts.timestamp(); var invokeMap = new ts.Map(); while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { @@ -7175,7 +7175,7 @@ var ts; var hasChanges = updateChildWatches(dirName, dirPath, options); invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames); } - ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size)); callbackCache.forEach(function (callbacks, rootDirName) { var existing = invokeMap.get(rootDirName); if (existing) { @@ -7191,7 +7191,7 @@ var ts; } }); var elapsed = ts.timestamp() - start; - ts.sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches); + ts.sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches)); } function removeChildWatches(parentWatcher) { if (!parentWatcher) @@ -7651,7 +7651,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) { @@ -7660,7 +7660,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++; } } @@ -7676,7 +7676,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) { @@ -7778,7 +7778,7 @@ var ts; * @param createWatcher */ function invokeCallbackAndUpdateWatcher(createWatcher) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher"); + ts.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 @@ -7803,7 +7803,7 @@ var ts; } } if (hitSystemWatcherLimit) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } try { @@ -7819,7 +7819,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"); - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } } @@ -10121,7 +10121,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; @@ -13001,7 +13001,7 @@ var ts; return typeof comment === "string" ? comment : comment === null || comment === void 0 ? void 0 : comment.map(function (c) { // TODO: Other kinds here - return c.kind === 319 /* JSDocText */ ? c.text : "{@link " + (c.name ? ts.entityNameToString(c.name) + " " : "") + c.text + "}"; + return c.kind === 319 /* JSDocText */ ? c.text : "{@link ".concat(c.name ? ts.entityNameToString(c.name) + " " : "").concat(c.text, "}"); }).join(""); } ts.getTextOfJSDocComment = getTextOfJSDocComment; @@ -14271,8 +14271,8 @@ var ts; } function packageIdToString(_a) { var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; - var fullName = subModuleName ? name + "/" + subModuleName : name; - return fullName + "@" + version; + var fullName = subModuleName ? "".concat(name, "/").concat(subModuleName) : name; + return "".concat(fullName, "@").concat(version); } ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { @@ -14351,7 +14351,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) { @@ -14490,7 +14490,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(); @@ -14507,10 +14507,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; } } @@ -14725,7 +14725,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) { @@ -17256,11 +17256,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) { @@ -19953,7 +19953,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) { @@ -20070,7 +20070,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 @@ -20083,7 +20083,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 = { @@ -20092,7 +20092,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 = { @@ -20110,10 +20110,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) { @@ -20135,7 +20135,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) { @@ -20213,7 +20213,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"), @@ -20494,7 +20494,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) { @@ -26483,7 +26483,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; @@ -26811,7 +26811,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) { @@ -31349,7 +31349,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; @@ -38113,7 +38113,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; } @@ -39575,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) { @@ -40370,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; @@ -40424,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); } @@ -40445,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; @@ -40861,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; @@ -41106,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); }); @@ -41542,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; } @@ -41653,7 +41653,10 @@ var ts; } } var failedLookupLocations = []; - var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] }; + var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default : + ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault : + NodeResolutionFeatures.None; + var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] }; var resolved = primaryLookup(); var primary = true; if (!resolved) { @@ -41920,7 +41923,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; } @@ -41951,7 +41954,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(); @@ -42098,10 +42101,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); @@ -42304,7 +42307,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; } @@ -42328,13 +42331,15 @@ var ts; // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690 NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures"; + NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default"; + NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault"; NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode"; })(NodeResolutionFeatures || (NodeResolutionFeatures = {})); function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { var containingDirectory = ts.getDirectoryPath(containingFile); @@ -42417,7 +42422,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) { @@ -42803,7 +42808,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) { @@ -43131,7 +43136,7 @@ var ts; } /* @internal */ function getTypesPackageName(packageName) { - return "@types/" + mangleScopedPackageName(packageName); + return "@types/".concat(mangleScopedPackageName(packageName)); } ts.getTypesPackageName = getTypesPackageName; /* @internal */ @@ -43532,7 +43537,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; @@ -43589,7 +43594,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; @@ -43701,7 +43706,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) { @@ -45774,7 +45779,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) { @@ -47863,7 +47868,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 () { @@ -48297,11 +48302,12 @@ var ts; * * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters. */ - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) { + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) { if (excludeGlobals === void 0) { excludeGlobals = false; } - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol); + if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) { var _a, _b, _c; var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; @@ -48618,7 +48624,7 @@ var ts; } } if (!result) { - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (!errorLocation || !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217 !checkAndReportErrorForExtendingInterface(errorLocation) && @@ -48628,7 +48634,7 @@ var ts; !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { var suggestion = void 0; - if (suggestionCount < maximumSuggestionCount) { + if (getSpellingSuggestions && suggestionCount < maximumSuggestionCount) { suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning); var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration); if (isGlobalScopeAugmentationDeclaration) { @@ -48664,7 +48670,7 @@ var ts; return undefined; } // Perform extra checks only if error reporting was requested - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields)) { // We have a match, but the reference occurred within a property initializer and the identifier also binds // to a local variable in the constructor where the code will be emitted. Note that this is actually allowed @@ -50502,7 +50508,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); } @@ -51350,7 +51356,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()); } @@ -51619,7 +51625,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; } @@ -51734,7 +51740,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) ]; } @@ -51748,7 +51754,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); @@ -52256,7 +52262,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); @@ -52582,7 +52588,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) { @@ -53667,7 +53673,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) { @@ -53742,7 +53748,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 */)); @@ -53789,7 +53795,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) { @@ -53897,15 +53903,15 @@ var ts; if (nameType.flags & 384 /* StringOrNumberLiteral */) { var name = "" + nameType.value; if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) { - return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\""; + return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\""); } if (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), "]"); } } } @@ -56679,7 +56685,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; } @@ -58598,7 +58604,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 @@ -58784,7 +58790,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 : @@ -58795,7 +58801,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 */)); @@ -58868,7 +58874,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; @@ -59069,7 +59075,7 @@ var ts; } function getGlobalSymbol(name, meaning, diagnostic) { // Don't track references for global symbols anyway, so value if `isReference` is arbitrary - return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false); + return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false); } function getGlobalType(name, arity, reportErrors) { var symbol = getGlobalTypeSymbol(name, reportErrors); @@ -59792,9 +59798,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) { @@ -60316,7 +60322,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)); @@ -60376,7 +60382,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)); @@ -61396,7 +61402,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) { @@ -62939,7 +62945,7 @@ var ts; return true; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { - var related = relation.get(getRelationKey(source, target, 0 /* None */, relation)); + var related = relation.get(getRelationKey(source, target, 0 /* None */, relation, /*ignoreConstraints*/ false)); if (related !== undefined) { return !!(related & 1 /* Succeeded */); } @@ -63085,24 +63091,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; } @@ -63131,7 +63137,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; } @@ -63144,7 +63150,7 @@ var ts; break; } default: - return ts.Debug.fail("Unhandled Diagnostic: " + msg.code); + return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code)); } } if (path) { @@ -63788,7 +63794,8 @@ var ts; if (overflow) { return 0 /* False */; } - var id = getRelationKey(source, target, intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0), relation); + var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0); + var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false); var entry = relation.get(id); if (entry !== undefined) { if (reportErrors && entry & 2 /* Failed */ && !(entry & 4 /* Reported */)) { @@ -63815,16 +63822,13 @@ var ts; targetStack = []; } else { - // generate a key where all type parameter id positions are replaced with unconstrained type parameter ids - // this isn't perfect - nested type references passed as type arguments will muck up the indexes and thus - // prevent finding matches- but it should hit up the common cases - var broadestEquivalentId = id.split(",").map(function (i) { return i.replace(/-\d+/g, function (_match, offset) { - var index = ts.length(id.slice(0, offset).match(/[-=]/g) || undefined); - return "=" + index; - }); }).join(","); + // A key that starts with "*" is an indication that we have type references that reference constrained + // type parameters. For such keys we also check against the key we would have gotten if all type parameters + // were unconstrained. + var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, /*ignoreConstraints*/ true) : undefined; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions - if (id === maybeKeys[i] || broadestEquivalentId === maybeKeys[i]) { + if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) { return 3 /* Maybe */; } } @@ -65331,48 +65335,56 @@ var ts; function isTypeReferenceWithGenericArguments(type) { return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return !!(t.flags & 262144 /* TypeParameter */) || isTypeReferenceWithGenericArguments(t); }); } - /** - * getTypeReferenceId(A) returns "111=0-12=1" - * where A.id=111 and number.id=12 - */ - function getTypeReferenceId(type, typeParameters, depth) { - if (depth === void 0) { depth = 0; } - var result = "" + type.target.id; - for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { - var t = _a[_i]; - if (isUnconstrainedTypeParameter(t)) { - var index = typeParameters.indexOf(t); - if (index < 0) { - index = typeParameters.length; - typeParameters.push(t); + function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) { + var typeParameters = []; + var constraintMarker = ""; + var sourceId = getTypeReferenceId(source, 0); + var targetId = getTypeReferenceId(target, 0); + 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) { + if (depth === void 0) { depth = 0; } + var result = "" + type.target.id; + for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 262144 /* TypeParameter */) { + if (ignoreConstraints || isUnconstrainedTypeParameter(t)) { + var index = typeParameters.indexOf(t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + continue; + } + // We mark type references that reference constrained type parameters such that we know to obtain + // and look for a "broadest equivalent key" in the cache. + constraintMarker = "*"; + } + else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { + result += "<" + getTypeReferenceId(t, depth + 1) + ">"; + continue; } - result += "=" + index; - } - else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { - result += "<" + getTypeReferenceId(t, typeParameters, depth + 1) + ">"; - } - else { result += "-" + t.id; } + return result; } - return result; } /** * To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters. * For other cases, the types ids are used. */ - function getRelationKey(source, target, intersectionState, relation) { + function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) { if (relation === identityRelation && source.id > target.id) { var temp = source; source = target; target = temp; } var postFix = intersectionState ? ":" + intersectionState : ""; - if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { - var typeParameters = []; - return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters) + postFix; - } - return source.id + "," + target.id + postFix; + return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? + getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : + "".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. @@ -65420,28 +65432,35 @@ var ts; !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; } // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons - // for 5 or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, + // for maxDepth or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely - // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5 + // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least maxDepth // levels, but unequal at some level beyond that. - // In addition, this will also detect when an indexed access has been chained off of 5 or more times (which is essentially - // the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding false positives - // for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). - // It also detects when a recursive type reference has expanded 5 or more times, eg, if the true branch of + // In addition, this will also detect when an indexed access has been chained off of maxDepth more times (which is + // essentially the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding + // false positives for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). + // It also detects when a recursive type reference has expanded maxDepth or more times, e.g. if the true branch of // `type A = null extends T ? [A>] : [T]` - // has expanded into `[A>>>>>]` - // in such cases we need to terminate the expansion, and we do so here. + // has expanded into `[A>>>>>]`. In such cases we need + // to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth, maxDepth) { - if (maxDepth === void 0) { maxDepth = 5; } + if (maxDepth === void 0) { maxDepth = 3; } if (depth >= maxDepth) { var identity_1 = getRecursionIdentity(type); var count = 0; + var lastTypeId = 0; for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= maxDepth) { - return true; + var t = stack[i]; + if (getRecursionIdentity(t) === identity_1) { + // We only count occurrences with a higher type id than the previous occurrence, since higher + // type ids are an indicator of newer instantiations caused by recursion. + if (t.id >= lastTypeId) { + count++; + if (count >= maxDepth) { + return true; + } } + lastTypeId = t.id; } } } @@ -67484,11 +67503,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); @@ -71250,7 +71269,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; } @@ -73031,7 +73050,7 @@ var ts; } function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ true, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function @@ -81163,7 +81182,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 @@ -88135,7 +88154,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 */ : @@ -88210,7 +88229,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; } @@ -91876,7 +91895,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; } @@ -93268,8 +93287,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); } @@ -95167,7 +95186,7 @@ var ts; specifierSourceImports = ts.createMap(); 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); @@ -96306,11 +96325,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); } } @@ -105119,7 +105138,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 */) { @@ -105330,7 +105349,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() { @@ -106088,7 +106107,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); @@ -106277,7 +106296,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)) { @@ -106568,7 +106587,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, @@ -106609,7 +106628,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; @@ -107501,13 +107520,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")); } } } @@ -107576,7 +107595,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++) { @@ -107595,7 +107614,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*/ @@ -107821,7 +107840,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) { @@ -107870,7 +107889,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) { @@ -108050,7 +108069,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 }); }, @@ -108910,7 +108929,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); @@ -109080,13 +109099,13 @@ 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(snippet) { - nonEscapingWrite("$" + snippet.order); + nonEscapingWrite("$".concat(snippet.order)); } // // Identifiers @@ -110808,17 +110827,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(); } @@ -110826,7 +110845,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(); @@ -110834,7 +110853,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(); @@ -110842,7 +110861,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(); @@ -111617,9 +111636,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); @@ -112096,8 +112115,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(); @@ -112818,7 +112837,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; @@ -112827,11 +112846,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) @@ -112855,7 +112874,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; @@ -112923,36 +112942,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)); } }; } @@ -112962,16 +112981,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; @@ -113278,12 +113297,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; } @@ -113371,9 +113390,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; @@ -113387,7 +113406,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(); @@ -113496,7 +113515,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); } @@ -115580,7 +115599,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; @@ -116401,12 +116420,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; @@ -116459,7 +116478,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; @@ -116917,7 +116936,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); @@ -117425,7 +117444,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); }); @@ -118570,7 +118589,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 { @@ -119684,7 +119703,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); @@ -119787,8 +119806,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) { @@ -119796,8 +119815,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); }; } @@ -119825,7 +119844,7 @@ var ts; if (errorCount === 0) return ""; var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount); - return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine; + return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine); } ts.getErrorSummaryText = getErrorSummaryText; function isBuilderProgram(program) { @@ -119851,9 +119870,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; @@ -119893,7 +119912,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; @@ -119902,7 +119921,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) { @@ -120026,7 +120045,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); } @@ -120354,7 +120373,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); @@ -120503,10 +120522,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; @@ -120667,7 +120686,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() { @@ -120727,7 +120746,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(); @@ -120768,7 +120787,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); @@ -121072,8 +121091,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); }; } @@ -121848,7 +121867,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) { @@ -121877,7 +121896,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); @@ -121905,7 +121924,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) { @@ -122264,7 +122283,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; } @@ -122597,7 +122616,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 = {})); @@ -122608,7 +122627,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; @@ -122661,7 +122680,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) { @@ -122740,7 +122759,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 = []; @@ -122754,7 +122773,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)) { @@ -122763,7 +122782,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); } /** @@ -122776,7 +122795,7 @@ var ts; filesToWatch.push(jsonPath); var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config; var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys); - addInferredTypings(jsonTypingNames, "Typing names in '" + jsonPath + "' dependencies"); + addInferredTypings(jsonTypingNames, "Typing names in '".concat(jsonPath, "' dependencies")); } /** * Infer typing names from given file names. For example, the file name "jquery-min.2.3.4.js" @@ -122815,7 +122834,7 @@ var ts; // depth of 2, so we access `node_modules/foo` but not `node_modules/foo/bar` var fileNames = host.readDirectory(packagesFolderPath, [".json" /* Json */], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); if (log) - log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(fileNames)); + log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(fileNames))); var packageNames = []; for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; @@ -122842,7 +122861,7 @@ var ts; if (ownTypes) { var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName)); if (log) - log(" Package '" + packageJson.name + "' provides its own types."); + log(" Package '".concat(packageJson.name, "' provides its own types.")); inferredTypings.set(packageJson.name, absolutePath); } else { @@ -122914,15 +122933,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: @@ -125480,7 +125499,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)); @@ -125728,7 +125747,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; } @@ -125838,7 +125857,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) { @@ -126210,7 +126229,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]; } @@ -126317,13 +126336,13 @@ var ts; ts.getNameForExportedSymbol = getNameForExportedSymbol; 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 @@ -126531,7 +126550,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, @@ -126544,7 +126563,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("|")); @@ -126624,7 +126643,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; @@ -126678,7 +126697,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; @@ -127211,7 +127230,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); @@ -128079,7 +128098,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); @@ -128808,10 +128827,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) { @@ -129114,15 +129133,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); @@ -129136,7 +129155,7 @@ var ts; if (isJsxInitializer) { if (insertText === undefined) insertText = name; - insertText = "{" + insertText + "}"; + insertText = "{".concat(insertText, "}"); if (typeof isJsxInitializer !== "boolean") { replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile); } @@ -129149,8 +129168,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)) { @@ -129181,7 +129200,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 { @@ -129190,7 +129209,7 @@ var ts; } } if (useBraces_1) { - insertText = ts.escapeSnippetText(name) + "={$1}"; + insertText = "".concat(ts.escapeSnippetText(name), "={$1}"); isSnippet = true; } } @@ -129454,14 +129473,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) { @@ -132360,7 +132379,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) { @@ -133372,7 +133391,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: @@ -133952,7 +133971,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) @@ -135236,8 +135255,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"); @@ -136498,7 +136517,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 @@ -136630,11 +136649,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); }); @@ -137474,7 +137493,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); @@ -137484,7 +137503,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 */; @@ -137680,10 +137699,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 ""; @@ -137696,7 +137715,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; @@ -140128,7 +140147,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 }; @@ -140300,7 +140319,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"; @@ -140364,7 +140383,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, @@ -140372,7 +140391,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, @@ -140380,7 +140399,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, @@ -140915,7 +140934,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; @@ -145033,7 +145052,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) { @@ -145233,7 +145252,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) { @@ -145267,7 +145286,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 */)); } @@ -145324,7 +145343,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 }); } } @@ -145369,7 +145388,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), " ") }); } } }; @@ -145471,7 +145490,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. @@ -145568,7 +145587,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; } @@ -148040,7 +148059,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; @@ -148140,7 +148159,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) { @@ -148191,7 +148210,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]; @@ -148325,7 +148344,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)); } } /** @@ -148382,7 +148401,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; @@ -148462,7 +148481,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], @@ -148859,7 +148878,7 @@ var ts; 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 @@ -148903,7 +148922,7 @@ var ts; return newEntry; } function newImportsKey(moduleSpecifier, topLevelTypeOnly) { - return (topLevelTypeOnly ? 1 : 0) + "|" + moduleSpecifier; + return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier); } } function writeFixes(changeTracker) { @@ -149356,7 +149375,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) { @@ -149463,7 +149482,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]; @@ -149487,7 +149506,7 @@ var ts; return [importKind === 1 /* Default */ ? ts.Diagnostics.Import_default_0_from_module_1 : ts.Diagnostics.Import_0_from_module_1, symbolName, moduleSpecifier]; } default: - return ts.Debug.assertNever(fix, "Unexpected fix kind " + fix.kind); + return ts.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind)); } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, compilerOptions) { @@ -149583,7 +149602,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; @@ -149676,7 +149695,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 = {})); @@ -150876,7 +150895,7 @@ var ts; break; } default: - ts.Debug.fail("Bad fixId: " + context.fixId); + ts.Debug.fail("Bad fixId: ".concat(context.fixId)); } }); }, @@ -151324,7 +151343,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 = {})); @@ -151515,11 +151534,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))); } }); } @@ -151855,7 +151874,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); @@ -153004,7 +153023,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 */; @@ -153107,7 +153126,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)) { @@ -153373,7 +153392,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 @@ -153408,7 +153427,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); @@ -153659,7 +153678,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), @@ -154683,7 +154702,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)); } } } @@ -154771,7 +154790,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) { @@ -155335,7 +155354,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, @@ -155480,7 +155499,7 @@ var ts; usedFunctionNames.set(description, true); functionActions.push({ description: description, - name: "function_scope_" + i, + name: "function_scope_".concat(i), kind: extractFunctionAction.kind }); } @@ -155488,7 +155507,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 }; @@ -155504,7 +155523,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 }); } @@ -155512,7 +155531,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 }; @@ -156096,28 +156115,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; @@ -157584,7 +157603,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) { @@ -157621,7 +157640,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) { @@ -157708,7 +157727,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) { @@ -157808,7 +157827,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) { @@ -157915,7 +157934,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) { @@ -158030,7 +158049,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) { @@ -158091,7 +158110,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) { @@ -158113,7 +158132,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;` */ @@ -158751,7 +158770,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 = {})); @@ -159455,7 +159474,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)); } @@ -160337,7 +160356,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; }); @@ -161012,7 +161031,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: "" }; + return { newText: "") }; } var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent : ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined; @@ -161118,7 +161137,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. @@ -161513,14 +161532,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; @@ -162502,13 +162521,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; @@ -162590,7 +162609,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 () { @@ -162606,43 +162625,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; @@ -162658,7 +162677,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 /** @@ -162667,7 +162686,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 @@ -162675,12 +162694,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 /** @@ -162689,7 +162708,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 @@ -162697,7 +162716,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 /** @@ -162706,7 +162725,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 /** @@ -162715,37 +162734,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); }); @@ -162753,23 +162772,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)); @@ -162784,108 +162803,108 @@ var ts; */ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences) { var _this = this; - return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); }); + return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ")"), function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); }); }; /** 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)); @@ -162935,7 +162954,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; @@ -162950,7 +162969,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 { @@ -162962,7 +162981,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 { @@ -162977,7 +162996,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); }); @@ -162999,7 +163018,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 83e1c8ae85997..92e96e7957e39 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -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 = "4.5.2"; + ts.version = "4.5.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -335,7 +335,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 */ @@ -1698,7 +1698,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. */ @@ -1789,7 +1789,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); @@ -2239,7 +2239,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; /** @@ -2552,7 +2552,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); } @@ -2560,12 +2560,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()); } @@ -2575,26 +2575,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; @@ -2635,42 +2635,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; @@ -2691,7 +2691,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; /** @@ -2712,7 +2712,7 @@ var ts; break; } if (enumValue !== 0 && enumValue & value) { - result = "" + result + (result ? "|" : "") + enumName; + result = "".concat(result).concat(result ? "|" : "").concat(enumName); remainingFlags &= ~enumValue; } } @@ -2822,7 +2822,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); } }, @@ -2861,7 +2861,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); } } }); @@ -2916,7 +2916,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); } } @@ -2926,11 +2926,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" : @@ -2949,7 +2949,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); } }, @@ -2985,11 +2985,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" : @@ -3021,7 +3021,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); } }, @@ -3068,10 +3068,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) { @@ -3202,11 +3202,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); @@ -3473,7 +3473,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*/ @@ -3771,7 +3771,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; @@ -3783,11 +3783,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, @@ -3877,7 +3877,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) { @@ -3886,11 +3886,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"); @@ -6697,7 +6697,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; @@ -7162,7 +7162,7 @@ var ts; } function onTimerToUpdateChildWatches() { timerToUpdateChildWatches = undefined; - ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size)); var start = ts.timestamp(); var invokeMap = new ts.Map(); while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { @@ -7175,7 +7175,7 @@ var ts; var hasChanges = updateChildWatches(dirName, dirPath, options); invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames); } - ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size)); callbackCache.forEach(function (callbacks, rootDirName) { var existing = invokeMap.get(rootDirName); if (existing) { @@ -7191,7 +7191,7 @@ var ts; } }); var elapsed = ts.timestamp() - start; - ts.sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches); + ts.sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches)); } function removeChildWatches(parentWatcher) { if (!parentWatcher) @@ -7651,7 +7651,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) { @@ -7660,7 +7660,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++; } } @@ -7676,7 +7676,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) { @@ -7778,7 +7778,7 @@ var ts; * @param createWatcher */ function invokeCallbackAndUpdateWatcher(createWatcher) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher"); + ts.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 @@ -7803,7 +7803,7 @@ var ts; } } if (hitSystemWatcherLimit) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } try { @@ -7819,7 +7819,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"); - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } } @@ -10121,7 +10121,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; @@ -13001,7 +13001,7 @@ var ts; return typeof comment === "string" ? comment : comment === null || comment === void 0 ? void 0 : comment.map(function (c) { // TODO: Other kinds here - return c.kind === 319 /* JSDocText */ ? c.text : "{@link " + (c.name ? ts.entityNameToString(c.name) + " " : "") + c.text + "}"; + return c.kind === 319 /* JSDocText */ ? c.text : "{@link ".concat(c.name ? ts.entityNameToString(c.name) + " " : "").concat(c.text, "}"); }).join(""); } ts.getTextOfJSDocComment = getTextOfJSDocComment; @@ -14271,8 +14271,8 @@ var ts; } function packageIdToString(_a) { var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; - var fullName = subModuleName ? name + "/" + subModuleName : name; - return fullName + "@" + version; + var fullName = subModuleName ? "".concat(name, "/").concat(subModuleName) : name; + return "".concat(fullName, "@").concat(version); } ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { @@ -14351,7 +14351,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) { @@ -14490,7 +14490,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(); @@ -14507,10 +14507,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; } } @@ -14725,7 +14725,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) { @@ -17256,11 +17256,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) { @@ -19953,7 +19953,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) { @@ -20070,7 +20070,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 @@ -20083,7 +20083,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 = { @@ -20092,7 +20092,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 = { @@ -20110,10 +20110,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) { @@ -20135,7 +20135,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) { @@ -20213,7 +20213,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"), @@ -20494,7 +20494,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) { @@ -26483,7 +26483,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; @@ -26811,7 +26811,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) { @@ -31349,7 +31349,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; @@ -38113,7 +38113,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; } @@ -39575,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) { @@ -40370,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; @@ -40424,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); } @@ -40445,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; @@ -40861,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; @@ -41106,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); }); @@ -41542,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; } @@ -41653,7 +41653,10 @@ var ts; } } var failedLookupLocations = []; - var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] }; + var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default : + ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault : + NodeResolutionFeatures.None; + var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] }; var resolved = primaryLookup(); var primary = true; if (!resolved) { @@ -41920,7 +41923,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; } @@ -41951,7 +41954,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(); @@ -42098,10 +42101,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); @@ -42304,7 +42307,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; } @@ -42328,13 +42331,15 @@ var ts; // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690 NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures"; + NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default"; + NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault"; NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode"; })(NodeResolutionFeatures || (NodeResolutionFeatures = {})); function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { var containingDirectory = ts.getDirectoryPath(containingFile); @@ -42417,7 +42422,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) { @@ -42803,7 +42808,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) { @@ -43131,7 +43136,7 @@ var ts; } /* @internal */ function getTypesPackageName(packageName) { - return "@types/" + mangleScopedPackageName(packageName); + return "@types/".concat(mangleScopedPackageName(packageName)); } ts.getTypesPackageName = getTypesPackageName; /* @internal */ @@ -43532,7 +43537,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; @@ -43589,7 +43594,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; @@ -43701,7 +43706,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) { @@ -45774,7 +45779,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) { @@ -47863,7 +47868,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 () { @@ -48297,11 +48302,12 @@ var ts; * * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters. */ - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) { + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) { if (excludeGlobals === void 0) { excludeGlobals = false; } - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol); + if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) { var _a, _b, _c; var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; @@ -48618,7 +48624,7 @@ var ts; } } if (!result) { - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (!errorLocation || !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217 !checkAndReportErrorForExtendingInterface(errorLocation) && @@ -48628,7 +48634,7 @@ var ts; !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { var suggestion = void 0; - if (suggestionCount < maximumSuggestionCount) { + if (getSpellingSuggestions && suggestionCount < maximumSuggestionCount) { suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning); var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration); if (isGlobalScopeAugmentationDeclaration) { @@ -48664,7 +48670,7 @@ var ts; return undefined; } // Perform extra checks only if error reporting was requested - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields)) { // We have a match, but the reference occurred within a property initializer and the identifier also binds // to a local variable in the constructor where the code will be emitted. Note that this is actually allowed @@ -50502,7 +50508,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); } @@ -51350,7 +51356,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()); } @@ -51619,7 +51625,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; } @@ -51734,7 +51740,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) ]; } @@ -51748,7 +51754,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); @@ -52256,7 +52262,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); @@ -52582,7 +52588,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) { @@ -53667,7 +53673,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) { @@ -53742,7 +53748,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 */)); @@ -53789,7 +53795,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) { @@ -53897,15 +53903,15 @@ var ts; if (nameType.flags & 384 /* StringOrNumberLiteral */) { var name = "" + nameType.value; if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) { - return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\""; + return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\""); } if (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), "]"); } } } @@ -56679,7 +56685,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; } @@ -58598,7 +58604,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 @@ -58784,7 +58790,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 : @@ -58795,7 +58801,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 */)); @@ -58868,7 +58874,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; @@ -59069,7 +59075,7 @@ var ts; } function getGlobalSymbol(name, meaning, diagnostic) { // Don't track references for global symbols anyway, so value if `isReference` is arbitrary - return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false); + return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false); } function getGlobalType(name, arity, reportErrors) { var symbol = getGlobalTypeSymbol(name, reportErrors); @@ -59792,9 +59798,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) { @@ -60316,7 +60322,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)); @@ -60376,7 +60382,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)); @@ -61396,7 +61402,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) { @@ -62939,7 +62945,7 @@ var ts; return true; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { - var related = relation.get(getRelationKey(source, target, 0 /* None */, relation)); + var related = relation.get(getRelationKey(source, target, 0 /* None */, relation, /*ignoreConstraints*/ false)); if (related !== undefined) { return !!(related & 1 /* Succeeded */); } @@ -63085,24 +63091,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; } @@ -63131,7 +63137,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; } @@ -63144,7 +63150,7 @@ var ts; break; } default: - return ts.Debug.fail("Unhandled Diagnostic: " + msg.code); + return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code)); } } if (path) { @@ -63788,7 +63794,8 @@ var ts; if (overflow) { return 0 /* False */; } - var id = getRelationKey(source, target, intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0), relation); + var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0); + var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false); var entry = relation.get(id); if (entry !== undefined) { if (reportErrors && entry & 2 /* Failed */ && !(entry & 4 /* Reported */)) { @@ -63815,16 +63822,13 @@ var ts; targetStack = []; } else { - // generate a key where all type parameter id positions are replaced with unconstrained type parameter ids - // this isn't perfect - nested type references passed as type arguments will muck up the indexes and thus - // prevent finding matches- but it should hit up the common cases - var broadestEquivalentId = id.split(",").map(function (i) { return i.replace(/-\d+/g, function (_match, offset) { - var index = ts.length(id.slice(0, offset).match(/[-=]/g) || undefined); - return "=" + index; - }); }).join(","); + // A key that starts with "*" is an indication that we have type references that reference constrained + // type parameters. For such keys we also check against the key we would have gotten if all type parameters + // were unconstrained. + var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, /*ignoreConstraints*/ true) : undefined; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions - if (id === maybeKeys[i] || broadestEquivalentId === maybeKeys[i]) { + if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) { return 3 /* Maybe */; } } @@ -65331,48 +65335,56 @@ var ts; function isTypeReferenceWithGenericArguments(type) { return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return !!(t.flags & 262144 /* TypeParameter */) || isTypeReferenceWithGenericArguments(t); }); } - /** - * getTypeReferenceId(A) returns "111=0-12=1" - * where A.id=111 and number.id=12 - */ - function getTypeReferenceId(type, typeParameters, depth) { - if (depth === void 0) { depth = 0; } - var result = "" + type.target.id; - for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { - var t = _a[_i]; - if (isUnconstrainedTypeParameter(t)) { - var index = typeParameters.indexOf(t); - if (index < 0) { - index = typeParameters.length; - typeParameters.push(t); + function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) { + var typeParameters = []; + var constraintMarker = ""; + var sourceId = getTypeReferenceId(source, 0); + var targetId = getTypeReferenceId(target, 0); + 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) { + if (depth === void 0) { depth = 0; } + var result = "" + type.target.id; + for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 262144 /* TypeParameter */) { + if (ignoreConstraints || isUnconstrainedTypeParameter(t)) { + var index = typeParameters.indexOf(t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + continue; + } + // We mark type references that reference constrained type parameters such that we know to obtain + // and look for a "broadest equivalent key" in the cache. + constraintMarker = "*"; + } + else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { + result += "<" + getTypeReferenceId(t, depth + 1) + ">"; + continue; } - result += "=" + index; - } - else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { - result += "<" + getTypeReferenceId(t, typeParameters, depth + 1) + ">"; - } - else { result += "-" + t.id; } + return result; } - return result; } /** * To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters. * For other cases, the types ids are used. */ - function getRelationKey(source, target, intersectionState, relation) { + function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) { if (relation === identityRelation && source.id > target.id) { var temp = source; source = target; target = temp; } var postFix = intersectionState ? ":" + intersectionState : ""; - if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { - var typeParameters = []; - return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters) + postFix; - } - return source.id + "," + target.id + postFix; + return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? + getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : + "".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. @@ -65420,28 +65432,35 @@ var ts; !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; } // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons - // for 5 or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, + // for maxDepth or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely - // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5 + // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least maxDepth // levels, but unequal at some level beyond that. - // In addition, this will also detect when an indexed access has been chained off of 5 or more times (which is essentially - // the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding false positives - // for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). - // It also detects when a recursive type reference has expanded 5 or more times, eg, if the true branch of + // In addition, this will also detect when an indexed access has been chained off of maxDepth more times (which is + // essentially the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding + // false positives for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). + // It also detects when a recursive type reference has expanded maxDepth or more times, e.g. if the true branch of // `type A = null extends T ? [A>] : [T]` - // has expanded into `[A>>>>>]` - // in such cases we need to terminate the expansion, and we do so here. + // has expanded into `[A>>>>>]`. In such cases we need + // to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth, maxDepth) { - if (maxDepth === void 0) { maxDepth = 5; } + if (maxDepth === void 0) { maxDepth = 3; } if (depth >= maxDepth) { var identity_1 = getRecursionIdentity(type); var count = 0; + var lastTypeId = 0; for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= maxDepth) { - return true; + var t = stack[i]; + if (getRecursionIdentity(t) === identity_1) { + // We only count occurrences with a higher type id than the previous occurrence, since higher + // type ids are an indicator of newer instantiations caused by recursion. + if (t.id >= lastTypeId) { + count++; + if (count >= maxDepth) { + return true; + } } + lastTypeId = t.id; } } } @@ -67484,11 +67503,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); @@ -71250,7 +71269,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; } @@ -73031,7 +73050,7 @@ var ts; } function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ true, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function @@ -81163,7 +81182,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 @@ -88135,7 +88154,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 */ : @@ -88210,7 +88229,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; } @@ -91876,7 +91895,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; } @@ -93268,8 +93287,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); } @@ -95167,7 +95186,7 @@ var ts; specifierSourceImports = ts.createMap(); 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); @@ -96306,11 +96325,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); } } @@ -105119,7 +105138,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 */) { @@ -105330,7 +105349,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() { @@ -106088,7 +106107,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); @@ -106277,7 +106296,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)) { @@ -106568,7 +106587,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, @@ -106609,7 +106628,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; @@ -107501,13 +107520,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")); } } } @@ -107576,7 +107595,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++) { @@ -107595,7 +107614,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*/ @@ -107821,7 +107840,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) { @@ -107870,7 +107889,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) { @@ -108050,7 +108069,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 }); }, @@ -108910,7 +108929,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); @@ -109080,13 +109099,13 @@ 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(snippet) { - nonEscapingWrite("$" + snippet.order); + nonEscapingWrite("$".concat(snippet.order)); } // // Identifiers @@ -110808,17 +110827,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(); } @@ -110826,7 +110845,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(); @@ -110834,7 +110853,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(); @@ -110842,7 +110861,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(); @@ -111617,9 +111636,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); @@ -112096,8 +112115,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(); @@ -112818,7 +112837,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; @@ -112827,11 +112846,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) @@ -112855,7 +112874,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; @@ -112923,36 +112942,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)); } }; } @@ -112962,16 +112981,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; @@ -113278,12 +113297,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; } @@ -113371,9 +113390,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; @@ -113387,7 +113406,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(); @@ -113496,7 +113515,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); } @@ -115580,7 +115599,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; @@ -116401,12 +116420,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; @@ -116459,7 +116478,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; @@ -116917,7 +116936,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); @@ -117425,7 +117444,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); }); @@ -118570,7 +118589,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 { @@ -119684,7 +119703,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); @@ -119787,8 +119806,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) { @@ -119796,8 +119815,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); }; } @@ -119825,7 +119844,7 @@ var ts; if (errorCount === 0) return ""; var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount); - return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine; + return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine); } ts.getErrorSummaryText = getErrorSummaryText; function isBuilderProgram(program) { @@ -119851,9 +119870,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; @@ -119893,7 +119912,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; @@ -119902,7 +119921,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) { @@ -120026,7 +120045,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); } @@ -120354,7 +120373,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); @@ -120503,10 +120522,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; @@ -120667,7 +120686,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() { @@ -120727,7 +120746,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(); @@ -120768,7 +120787,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); @@ -121072,8 +121091,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); }; } @@ -121848,7 +121867,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) { @@ -121877,7 +121896,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); @@ -121905,7 +121924,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) { @@ -122264,7 +122283,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; } @@ -122597,7 +122616,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 = {})); @@ -122608,7 +122627,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; @@ -122661,7 +122680,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) { @@ -122740,7 +122759,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 = []; @@ -122754,7 +122773,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)) { @@ -122763,7 +122782,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); } /** @@ -122776,7 +122795,7 @@ var ts; filesToWatch.push(jsonPath); var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config; var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys); - addInferredTypings(jsonTypingNames, "Typing names in '" + jsonPath + "' dependencies"); + addInferredTypings(jsonTypingNames, "Typing names in '".concat(jsonPath, "' dependencies")); } /** * Infer typing names from given file names. For example, the file name "jquery-min.2.3.4.js" @@ -122815,7 +122834,7 @@ var ts; // depth of 2, so we access `node_modules/foo` but not `node_modules/foo/bar` var fileNames = host.readDirectory(packagesFolderPath, [".json" /* Json */], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); if (log) - log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(fileNames)); + log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(fileNames))); var packageNames = []; for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; @@ -122842,7 +122861,7 @@ var ts; if (ownTypes) { var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName)); if (log) - log(" Package '" + packageJson.name + "' provides its own types."); + log(" Package '".concat(packageJson.name, "' provides its own types.")); inferredTypings.set(packageJson.name, absolutePath); } else { @@ -122914,15 +122933,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: @@ -125480,7 +125499,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)); @@ -125728,7 +125747,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; } @@ -125838,7 +125857,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) { @@ -126210,7 +126229,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]; } @@ -126317,13 +126336,13 @@ var ts; ts.getNameForExportedSymbol = getNameForExportedSymbol; 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 @@ -126531,7 +126550,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, @@ -126544,7 +126563,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("|")); @@ -126624,7 +126643,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; @@ -126678,7 +126697,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; @@ -127211,7 +127230,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); @@ -128079,7 +128098,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); @@ -128808,10 +128827,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) { @@ -129114,15 +129133,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); @@ -129136,7 +129155,7 @@ var ts; if (isJsxInitializer) { if (insertText === undefined) insertText = name; - insertText = "{" + insertText + "}"; + insertText = "{".concat(insertText, "}"); if (typeof isJsxInitializer !== "boolean") { replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile); } @@ -129149,8 +129168,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)) { @@ -129181,7 +129200,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 { @@ -129190,7 +129209,7 @@ var ts; } } if (useBraces_1) { - insertText = ts.escapeSnippetText(name) + "={$1}"; + insertText = "".concat(ts.escapeSnippetText(name), "={$1}"); isSnippet = true; } } @@ -129454,14 +129473,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) { @@ -132360,7 +132379,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) { @@ -133372,7 +133391,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: @@ -133952,7 +133971,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) @@ -135236,8 +135255,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"); @@ -136498,7 +136517,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 @@ -136630,11 +136649,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); }); @@ -137474,7 +137493,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); @@ -137484,7 +137503,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 */; @@ -137680,10 +137699,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 ""; @@ -137696,7 +137715,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; @@ -140128,7 +140147,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 }; @@ -140300,7 +140319,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"; @@ -140364,7 +140383,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, @@ -140372,7 +140391,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, @@ -140380,7 +140399,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, @@ -140915,7 +140934,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; @@ -145033,7 +145052,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) { @@ -145233,7 +145252,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) { @@ -145267,7 +145286,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 */)); } @@ -145324,7 +145343,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 }); } } @@ -145369,7 +145388,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), " ") }); } } }; @@ -145471,7 +145490,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. @@ -145568,7 +145587,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; } @@ -148040,7 +148059,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; @@ -148140,7 +148159,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) { @@ -148191,7 +148210,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]; @@ -148325,7 +148344,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)); } } /** @@ -148382,7 +148401,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; @@ -148462,7 +148481,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], @@ -148859,7 +148878,7 @@ var ts; 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 @@ -148903,7 +148922,7 @@ var ts; return newEntry; } function newImportsKey(moduleSpecifier, topLevelTypeOnly) { - return (topLevelTypeOnly ? 1 : 0) + "|" + moduleSpecifier; + return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier); } } function writeFixes(changeTracker) { @@ -149356,7 +149375,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) { @@ -149463,7 +149482,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]; @@ -149487,7 +149506,7 @@ var ts; return [importKind === 1 /* Default */ ? ts.Diagnostics.Import_default_0_from_module_1 : ts.Diagnostics.Import_0_from_module_1, symbolName, moduleSpecifier]; } default: - return ts.Debug.assertNever(fix, "Unexpected fix kind " + fix.kind); + return ts.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind)); } } function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImports, compilerOptions) { @@ -149583,7 +149602,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; @@ -149676,7 +149695,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 = {})); @@ -150876,7 +150895,7 @@ var ts; break; } default: - ts.Debug.fail("Bad fixId: " + context.fixId); + ts.Debug.fail("Bad fixId: ".concat(context.fixId)); } }); }, @@ -151324,7 +151343,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 = {})); @@ -151515,11 +151534,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))); } }); } @@ -151855,7 +151874,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); @@ -153004,7 +153023,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 */; @@ -153107,7 +153126,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)) { @@ -153373,7 +153392,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 @@ -153408,7 +153427,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); @@ -153659,7 +153678,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), @@ -154683,7 +154702,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)); } } } @@ -154771,7 +154790,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) { @@ -155335,7 +155354,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, @@ -155480,7 +155499,7 @@ var ts; usedFunctionNames.set(description, true); functionActions.push({ description: description, - name: "function_scope_" + i, + name: "function_scope_".concat(i), kind: extractFunctionAction.kind }); } @@ -155488,7 +155507,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 }; @@ -155504,7 +155523,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 }); } @@ -155512,7 +155531,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 }; @@ -156096,28 +156115,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; @@ -157584,7 +157603,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) { @@ -157621,7 +157640,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) { @@ -157708,7 +157727,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) { @@ -157808,7 +157827,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) { @@ -157915,7 +157934,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) { @@ -158030,7 +158049,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) { @@ -158091,7 +158110,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) { @@ -158113,7 +158132,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;` */ @@ -158751,7 +158770,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 = {})); @@ -159455,7 +159474,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)); } @@ -160337,7 +160356,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; }); @@ -161012,7 +161031,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: "" }; + return { newText: "") }; } var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent : ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined; @@ -161118,7 +161137,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. @@ -161513,14 +161532,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; @@ -162502,13 +162521,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; @@ -162590,7 +162609,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 () { @@ -162606,43 +162625,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; @@ -162658,7 +162677,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 /** @@ -162667,7 +162686,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 @@ -162675,12 +162694,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 /** @@ -162689,7 +162708,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 @@ -162697,7 +162716,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 /** @@ -162706,7 +162725,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 /** @@ -162715,37 +162734,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); }); @@ -162753,23 +162772,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)); @@ -162784,108 +162803,108 @@ var ts; */ LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences) { var _this = this; - return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); }); + return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ")"), function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences); }); }; /** 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)); @@ -162935,7 +162954,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; @@ -162950,7 +162969,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 { @@ -162962,7 +162981,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 { @@ -162977,7 +162996,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); }); @@ -162999,7 +163018,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 63ac645e4dd6c..033d5341f111b 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -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 = "4.5.2"; + ts.version = "4.5.3"; /* @internal */ var Comparison; (function (Comparison) { @@ -130,7 +130,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 */ @@ -1493,7 +1493,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. */ @@ -1584,7 +1584,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); @@ -2034,7 +2034,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; /** @@ -2347,7 +2347,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); } @@ -2355,12 +2355,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()); } @@ -2370,26 +2370,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; @@ -2430,42 +2430,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; @@ -2486,7 +2486,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; /** @@ -2507,7 +2507,7 @@ var ts; break; } if (enumValue !== 0 && enumValue & value) { - result = "" + result + (result ? "|" : "") + enumName; + result = "".concat(result).concat(result ? "|" : "").concat(enumName); remainingFlags &= ~enumValue; } } @@ -2617,7 +2617,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); } }, @@ -2656,7 +2656,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); } } }); @@ -2711,7 +2711,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); } } @@ -2721,11 +2721,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" : @@ -2744,7 +2744,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); } }, @@ -2780,11 +2780,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" : @@ -2816,7 +2816,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); } }, @@ -2863,10 +2863,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) { @@ -2997,11 +2997,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); @@ -3268,7 +3268,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*/ @@ -3566,7 +3566,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; @@ -3578,11 +3578,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, @@ -3672,7 +3672,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) { @@ -3681,11 +3681,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"); @@ -6492,7 +6492,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; @@ -6957,7 +6957,7 @@ var ts; } function onTimerToUpdateChildWatches() { timerToUpdateChildWatches = undefined; - ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: ".concat(cacheToUpdateChildWatches.size)); var start = ts.timestamp(); var invokeMap = new ts.Map(); while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { @@ -6970,7 +6970,7 @@ var ts; var hasChanges = updateChildWatches(dirName, dirPath, options); invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames); } - ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size); + ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: ".concat(ts.timestamp() - start, "ms:: ").concat(cacheToUpdateChildWatches.size)); callbackCache.forEach(function (callbacks, rootDirName) { var existing = invokeMap.get(rootDirName); if (existing) { @@ -6986,7 +6986,7 @@ var ts; } }); var elapsed = ts.timestamp() - start; - ts.sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches); + ts.sysLog("sysLog:: Elapsed:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(timerToUpdateChildWatches)); } function removeChildWatches(parentWatcher) { if (!parentWatcher) @@ -7446,7 +7446,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) { @@ -7455,7 +7455,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++; } } @@ -7471,7 +7471,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) { @@ -7573,7 +7573,7 @@ var ts; * @param createWatcher */ function invokeCallbackAndUpdateWatcher(createWatcher) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher"); + ts.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 @@ -7598,7 +7598,7 @@ var ts; } } if (hitSystemWatcherLimit) { - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Defaulting to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } try { @@ -7614,7 +7614,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"); - ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile"); + ts.sysLog("sysLog:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile")); return watchPresentFileSystemEntryWithFsWatchFile(); } } @@ -9916,7 +9916,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; @@ -12796,7 +12796,7 @@ var ts; return typeof comment === "string" ? comment : comment === null || comment === void 0 ? void 0 : comment.map(function (c) { // TODO: Other kinds here - return c.kind === 319 /* JSDocText */ ? c.text : "{@link " + (c.name ? ts.entityNameToString(c.name) + " " : "") + c.text + "}"; + return c.kind === 319 /* JSDocText */ ? c.text : "{@link ".concat(c.name ? ts.entityNameToString(c.name) + " " : "").concat(c.text, "}"); }).join(""); } ts.getTextOfJSDocComment = getTextOfJSDocComment; @@ -14066,8 +14066,8 @@ var ts; } function packageIdToString(_a) { var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; - var fullName = subModuleName ? name + "/" + subModuleName : name; - return fullName + "@" + version; + var fullName = subModuleName ? "".concat(name, "/").concat(subModuleName) : name; + return "".concat(fullName, "@").concat(version); } ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { @@ -14146,7 +14146,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) { @@ -14285,7 +14285,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(); @@ -14302,10 +14302,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; } } @@ -14520,7 +14520,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) { @@ -17051,11 +17051,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) { @@ -19748,7 +19748,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) { @@ -19865,7 +19865,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 @@ -19878,7 +19878,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 = { @@ -19887,7 +19887,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 = { @@ -19905,10 +19905,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) { @@ -19930,7 +19930,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) { @@ -20008,7 +20008,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"), @@ -20289,7 +20289,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) { @@ -26278,7 +26278,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; @@ -26606,7 +26606,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) { @@ -31144,7 +31144,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; @@ -37908,7 +37908,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; } @@ -39370,8 +39370,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) { @@ -40165,10 +40165,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; @@ -40219,19 +40219,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); } @@ -40240,25 +40240,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; @@ -40656,7 +40656,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; @@ -40901,7 +40901,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); }); @@ -41337,7 +41337,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; } @@ -41448,7 +41448,10 @@ var ts; } } var failedLookupLocations = []; - var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] }; + var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default : + ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault : + NodeResolutionFeatures.None; + var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] }; var resolved = primaryLookup(); var primary = true; if (!resolved) { @@ -41715,7 +41718,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; } @@ -41746,7 +41749,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(); @@ -41893,10 +41896,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); @@ -42099,7 +42102,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; } @@ -42123,13 +42126,15 @@ var ts; // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690 NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers"; NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures"; + NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default"; + NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault"; NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode"; })(NodeResolutionFeatures || (NodeResolutionFeatures = {})); function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { - return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); + return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); } function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { var containingDirectory = ts.getDirectoryPath(containingFile); @@ -42212,7 +42217,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) { @@ -42598,7 +42603,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) { @@ -42926,7 +42931,7 @@ var ts; } /* @internal */ function getTypesPackageName(packageName) { - return "@types/" + mangleScopedPackageName(packageName); + return "@types/".concat(mangleScopedPackageName(packageName)); } ts.getTypesPackageName = getTypesPackageName; /* @internal */ @@ -43327,7 +43332,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; @@ -43384,7 +43389,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; @@ -43496,7 +43501,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) { @@ -45569,7 +45574,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) { @@ -47658,7 +47663,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 () { @@ -48092,11 +48097,12 @@ var ts; * * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters. */ - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals) { + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) { if (excludeGlobals === void 0) { excludeGlobals = false; } - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol); + if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) { var _a, _b, _c; var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; @@ -48413,7 +48419,7 @@ var ts; } } if (!result) { - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (!errorLocation || !checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) && // TODO: GH#18217 !checkAndReportErrorForExtendingInterface(errorLocation) && @@ -48423,7 +48429,7 @@ var ts; !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) { var suggestion = void 0; - if (suggestionCount < maximumSuggestionCount) { + if (getSpellingSuggestions && suggestionCount < maximumSuggestionCount) { suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning); var isGlobalScopeAugmentationDeclaration = (suggestion === null || suggestion === void 0 ? void 0 : suggestion.valueDeclaration) && ts.isAmbientModule(suggestion.valueDeclaration) && ts.isGlobalScopeAugmentation(suggestion.valueDeclaration); if (isGlobalScopeAugmentationDeclaration) { @@ -48459,7 +48465,7 @@ var ts; return undefined; } // Perform extra checks only if error reporting was requested - if (nameNotFoundMessage) { + if (nameNotFoundMessage && produceDiagnostics) { if (propertyWithInvalidInitializer && !(ts.getEmitScriptTarget(compilerOptions) === 99 /* ESNext */ && useDefineForClassFields)) { // We have a match, but the reference occurred within a property initializer and the identifier also binds // to a local variable in the constructor where the code will be emitted. Note that this is actually allowed @@ -50297,7 +50303,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); } @@ -51145,7 +51151,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()); } @@ -51414,7 +51420,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; } @@ -51529,7 +51535,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) ]; } @@ -51543,7 +51549,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); @@ -52051,7 +52057,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); @@ -52377,7 +52383,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) { @@ -53462,7 +53468,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) { @@ -53537,7 +53543,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 */)); @@ -53584,7 +53590,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) { @@ -53692,15 +53698,15 @@ var ts; if (nameType.flags & 384 /* StringOrNumberLiteral */) { var name = "" + nameType.value; if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) { - return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\""; + return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\""); } if (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), "]"); } } } @@ -56474,7 +56480,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; } @@ -58393,7 +58399,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 @@ -58579,7 +58585,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 : @@ -58590,7 +58596,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 */)); @@ -58663,7 +58669,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; @@ -58864,7 +58870,7 @@ var ts; } function getGlobalSymbol(name, meaning, diagnostic) { // Don't track references for global symbols anyway, so value if `isReference` is arbitrary - return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false); + return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false); } function getGlobalType(name, arity, reportErrors) { var symbol = getGlobalTypeSymbol(name, reportErrors); @@ -59587,9 +59593,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) { @@ -60111,7 +60117,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)); @@ -60171,7 +60177,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)); @@ -61191,7 +61197,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) { @@ -62734,7 +62740,7 @@ var ts; return true; } if (source.flags & 524288 /* Object */ && target.flags & 524288 /* Object */) { - var related = relation.get(getRelationKey(source, target, 0 /* None */, relation)); + var related = relation.get(getRelationKey(source, target, 0 /* None */, relation, /*ignoreConstraints*/ false)); if (related !== undefined) { return !!(related & 1 /* Succeeded */); } @@ -62880,24 +62886,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; } @@ -62926,7 +62932,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; } @@ -62939,7 +62945,7 @@ var ts; break; } default: - return ts.Debug.fail("Unhandled Diagnostic: " + msg.code); + return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code)); } } if (path) { @@ -63583,7 +63589,8 @@ var ts; if (overflow) { return 0 /* False */; } - var id = getRelationKey(source, target, intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0), relation); + var keyIntersectionState = intersectionState | (inPropertyCheck ? 16 /* InPropertyCheck */ : 0); + var id = getRelationKey(source, target, keyIntersectionState, relation, /*ingnoreConstraints*/ false); var entry = relation.get(id); if (entry !== undefined) { if (reportErrors && entry & 2 /* Failed */ && !(entry & 4 /* Reported */)) { @@ -63610,16 +63617,13 @@ var ts; targetStack = []; } else { - // generate a key where all type parameter id positions are replaced with unconstrained type parameter ids - // this isn't perfect - nested type references passed as type arguments will muck up the indexes and thus - // prevent finding matches- but it should hit up the common cases - var broadestEquivalentId = id.split(",").map(function (i) { return i.replace(/-\d+/g, function (_match, offset) { - var index = ts.length(id.slice(0, offset).match(/[-=]/g) || undefined); - return "=" + index; - }); }).join(","); + // A key that starts with "*" is an indication that we have type references that reference constrained + // type parameters. For such keys we also check against the key we would have gotten if all type parameters + // were unconstrained. + var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, /*ignoreConstraints*/ true) : undefined; for (var i = 0; i < maybeCount; i++) { // If source and target are already being compared, consider them related with assumptions - if (id === maybeKeys[i] || broadestEquivalentId === maybeKeys[i]) { + if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) { return 3 /* Maybe */; } } @@ -65126,48 +65130,56 @@ var ts; function isTypeReferenceWithGenericArguments(type) { return isNonDeferredTypeReference(type) && ts.some(getTypeArguments(type), function (t) { return !!(t.flags & 262144 /* TypeParameter */) || isTypeReferenceWithGenericArguments(t); }); } - /** - * getTypeReferenceId(A) returns "111=0-12=1" - * where A.id=111 and number.id=12 - */ - function getTypeReferenceId(type, typeParameters, depth) { - if (depth === void 0) { depth = 0; } - var result = "" + type.target.id; - for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { - var t = _a[_i]; - if (isUnconstrainedTypeParameter(t)) { - var index = typeParameters.indexOf(t); - if (index < 0) { - index = typeParameters.length; - typeParameters.push(t); + function getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) { + var typeParameters = []; + var constraintMarker = ""; + var sourceId = getTypeReferenceId(source, 0); + var targetId = getTypeReferenceId(target, 0); + 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) { + if (depth === void 0) { depth = 0; } + var result = "" + type.target.id; + for (var _i = 0, _a = getTypeArguments(type); _i < _a.length; _i++) { + var t = _a[_i]; + if (t.flags & 262144 /* TypeParameter */) { + if (ignoreConstraints || isUnconstrainedTypeParameter(t)) { + var index = typeParameters.indexOf(t); + if (index < 0) { + index = typeParameters.length; + typeParameters.push(t); + } + result += "=" + index; + continue; + } + // We mark type references that reference constrained type parameters such that we know to obtain + // and look for a "broadest equivalent key" in the cache. + constraintMarker = "*"; + } + else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { + result += "<" + getTypeReferenceId(t, depth + 1) + ">"; + continue; } - result += "=" + index; - } - else if (depth < 4 && isTypeReferenceWithGenericArguments(t)) { - result += "<" + getTypeReferenceId(t, typeParameters, depth + 1) + ">"; - } - else { result += "-" + t.id; } + return result; } - return result; } /** * To improve caching, the relation key for two generic types uses the target's id plus ids of the type parameters. * For other cases, the types ids are used. */ - function getRelationKey(source, target, intersectionState, relation) { + function getRelationKey(source, target, intersectionState, relation, ignoreConstraints) { if (relation === identityRelation && source.id > target.id) { var temp = source; source = target; target = temp; } var postFix = intersectionState ? ":" + intersectionState : ""; - if (isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target)) { - var typeParameters = []; - return getTypeReferenceId(source, typeParameters) + "," + getTypeReferenceId(target, typeParameters) + postFix; - } - return source.id + "," + target.id + postFix; + return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ? + getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) : + "".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. @@ -65215,28 +65227,35 @@ var ts; !hasBaseType(checkClass, getDeclaringClass(p)) : false; }) ? undefined : checkClass; } // Return true if the given type is deeply nested. We consider this to be the case when structural type comparisons - // for 5 or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, + // for maxDepth or more occurrences or instantiations of the type have been recorded on the given stack. It is possible, // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely - // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least 5 + // expanding. Effectively, we will generate a false positive when two types are structurally equal to at least maxDepth // levels, but unequal at some level beyond that. - // In addition, this will also detect when an indexed access has been chained off of 5 or more times (which is essentially - // the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding false positives - // for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). - // It also detects when a recursive type reference has expanded 5 or more times, eg, if the true branch of + // In addition, this will also detect when an indexed access has been chained off of maxDepth more times (which is + // essentially the dual of the structural comparison), and likewise mark the type as deeply nested, potentially adding + // false positives for finite but deeply expanding indexed accesses (eg, for `Q[P1][P2][P3][P4][P5]`). + // It also detects when a recursive type reference has expanded maxDepth or more times, e.g. if the true branch of // `type A = null extends T ? [A>] : [T]` - // has expanded into `[A>>>>>]` - // in such cases we need to terminate the expansion, and we do so here. + // has expanded into `[A>>>>>]`. In such cases we need + // to terminate the expansion, and we do so here. function isDeeplyNestedType(type, stack, depth, maxDepth) { - if (maxDepth === void 0) { maxDepth = 5; } + if (maxDepth === void 0) { maxDepth = 3; } if (depth >= maxDepth) { var identity_1 = getRecursionIdentity(type); var count = 0; + var lastTypeId = 0; for (var i = 0; i < depth; i++) { - if (getRecursionIdentity(stack[i]) === identity_1) { - count++; - if (count >= maxDepth) { - return true; + var t = stack[i]; + if (getRecursionIdentity(t) === identity_1) { + // We only count occurrences with a higher type id than the previous occurrence, since higher + // type ids are an indicator of newer instantiations caused by recursion. + if (t.id >= lastTypeId) { + count++; + if (count >= maxDepth) { + return true; + } } + lastTypeId = t.id; } } } @@ -67279,11 +67298,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); @@ -71045,7 +71064,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; } @@ -72826,7 +72845,7 @@ var ts; } function getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ true, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function @@ -80958,7 +80977,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 @@ -87930,7 +87949,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 */ : @@ -88005,7 +88024,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; } @@ -91671,7 +91690,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; } @@ -93063,8 +93082,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); } @@ -94962,7 +94981,7 @@ var ts; specifierSourceImports = ts.createMap(); 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); @@ -96101,11 +96120,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); } } @@ -104914,7 +104933,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 */) { @@ -105125,7 +105144,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() { @@ -105883,7 +105902,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); @@ -106072,7 +106091,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)) { @@ -106363,7 +106382,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, @@ -106404,7 +106423,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; @@ -107296,13 +107315,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")); } } } @@ -107371,7 +107390,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++) { @@ -107390,7 +107409,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*/ @@ -107616,7 +107635,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) { @@ -107665,7 +107684,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) { @@ -107845,7 +107864,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 }); }, @@ -108705,7 +108724,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); @@ -108875,13 +108894,13 @@ 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(snippet) { - nonEscapingWrite("$" + snippet.order); + nonEscapingWrite("$".concat(snippet.order)); } // // Identifiers @@ -110603,17 +110622,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(); } @@ -110621,7 +110640,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(); @@ -110629,7 +110648,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(); @@ -110637,7 +110656,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(); @@ -111412,9 +111431,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); @@ -111891,8 +111910,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(); @@ -112613,7 +112632,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; @@ -112622,11 +112641,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) @@ -112650,7 +112669,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; @@ -112718,36 +112737,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)); } }; } @@ -112757,16 +112776,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; @@ -113073,12 +113092,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; } @@ -113166,9 +113185,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; @@ -113182,7 +113201,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(); @@ -113291,7 +113310,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); } @@ -115375,7 +115394,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; @@ -116196,12 +116215,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; @@ -116254,7 +116273,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; @@ -116712,7 +116731,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); @@ -117220,7 +117239,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); }); @@ -118365,7 +118384,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 { @@ -119479,7 +119498,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); @@ -119582,8 +119601,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) { @@ -119591,8 +119610,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); }; } @@ -119620,7 +119639,7 @@ var ts; if (errorCount === 0) return ""; var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount); - return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine; + return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine); } ts.getErrorSummaryText = getErrorSummaryText; function isBuilderProgram(program) { @@ -119646,9 +119665,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; @@ -119688,7 +119707,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; @@ -119697,7 +119716,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) { @@ -119821,7 +119840,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); } @@ -120149,7 +120168,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); @@ -120298,10 +120317,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; @@ -120462,7 +120481,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() { @@ -120522,7 +120541,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(); @@ -120563,7 +120582,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); @@ -120867,8 +120886,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); }; } @@ -121643,7 +121662,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) { @@ -121672,7 +121691,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); @@ -121700,7 +121719,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) { @@ -122059,7 +122078,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; } @@ -122392,7 +122411,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 = {})); @@ -122403,7 +122422,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; @@ -122456,7 +122475,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) { @@ -122535,7 +122554,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 = []; @@ -122549,7 +122568,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)) { @@ -122558,7 +122577,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); } /** @@ -122571,7 +122590,7 @@ var ts; filesToWatch.push(jsonPath); var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config; var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys); - addInferredTypings(jsonTypingNames, "Typing names in '" + jsonPath + "' dependencies"); + addInferredTypings(jsonTypingNames, "Typing names in '".concat(jsonPath, "' dependencies")); } /** * Infer typing names from given file names. For example, the file name "jquery-min.2.3.4.js" @@ -122610,7 +122629,7 @@ var ts; // depth of 2, so we access `node_modules/foo` but not `node_modules/foo/bar` var fileNames = host.readDirectory(packagesFolderPath, [".json" /* Json */], /*excludes*/ undefined, /*includes*/ undefined, /*depth*/ 2); if (log) - log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(fileNames)); + log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(fileNames))); var packageNames = []; for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { var fileName = fileNames_1[_i]; @@ -122637,7 +122656,7 @@ var ts; if (ownTypes) { var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName)); if (log) - log(" Package '" + packageJson.name + "' provides its own types."); + log(" Package '".concat(packageJson.name, "' provides its own types.")); inferredTypings.set(packageJson.name, absolutePath); } else { @@ -122709,15 +122728,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: @@ -122743,7 +122762,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; } @@ -122764,7 +122783,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; } @@ -122791,7 +122810,7 @@ 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) { @@ -122815,7 +122834,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); @@ -122825,30 +122844,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); } @@ -122857,7 +122876,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); @@ -122877,17 +122896,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()) { @@ -122898,14 +122917,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) { @@ -122929,11 +122948,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; @@ -122946,7 +122965,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); }; @@ -122956,7 +122975,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); @@ -122969,12 +122988,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; @@ -122983,11 +123002,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 }'); @@ -122996,7 +123015,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) { @@ -123023,7 +123042,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]; @@ -123033,7 +123052,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++) { @@ -123045,13 +123064,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))); } @@ -123105,7 +123124,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 () { @@ -123126,7 +123145,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); @@ -123201,7 +123220,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 = {})); @@ -123226,7 +123245,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; @@ -123242,7 +123261,7 @@ var ts; return npmPath; } if (host.fileExists(npmPath)) { - return "\"" + npmPath + "\""; + return "\"".concat(npmPath, "\""); } } return "npm"; @@ -123250,7 +123269,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(); } @@ -123260,14 +123279,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); @@ -123275,27 +123294,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", @@ -123334,7 +123353,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); }); @@ -123352,7 +123371,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()) { @@ -123362,29 +123381,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; } }; @@ -123407,7 +123426,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 () { @@ -123420,7 +123439,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 c4acaba0ef48c..2d49734bf82a2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "4.5.2", + "version": "4.5.3", "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 55fd254725f7c..0ee3f7e1b4ea0 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 = "4.5.2" as string; + export const version = "4.5.3" as string; /** * Type of objects whose values are all of the same type.