@typescript-deploys/pr-build 4.8.0-pr-49619-2 → 4.8.0-pr-49668-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/lib.es5.d.ts CHANGED
@@ -933,12 +933,24 @@ interface DateConstructor {
933
933
  declare var Date: DateConstructor;
934
934
 
935
935
  interface RegExpMatchArray extends Array<string> {
936
+ /**
937
+ * The index of the search at which the result was found.
938
+ */
936
939
  index?: number;
940
+ /**
941
+ * A copy of the search string.
942
+ */
937
943
  input?: string;
938
944
  }
939
945
 
940
946
  interface RegExpExecArray extends Array<string> {
947
+ /**
948
+ * The index of the search at which the result was found.
949
+ */
941
950
  index: number;
951
+ /**
952
+ * A copy of the search string.
953
+ */
942
954
  input: string;
943
955
  }
944
956
 
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.8";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20220621";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220624";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -1278,6 +1278,41 @@ var ts;
1278
1278
  return createMultiMap();
1279
1279
  }
1280
1280
  ts.createUnderscoreEscapedMultiMap = createUnderscoreEscapedMultiMap;
1281
+ function createQueue(items) {
1282
+ var elements = (items === null || items === void 0 ? void 0 : items.slice()) || [];
1283
+ var headIndex = 0;
1284
+ function isEmpty() {
1285
+ return headIndex === elements.length;
1286
+ }
1287
+ function enqueue() {
1288
+ var items = [];
1289
+ for (var _i = 0; _i < arguments.length; _i++) {
1290
+ items[_i] = arguments[_i];
1291
+ }
1292
+ elements.push.apply(elements, items);
1293
+ }
1294
+ function dequeue() {
1295
+ if (isEmpty()) {
1296
+ throw new Error("Queue is empty");
1297
+ }
1298
+ var result = elements[headIndex];
1299
+ elements[headIndex] = undefined;
1300
+ headIndex++;
1301
+ if (headIndex > 100 && headIndex > (elements.length >> 1)) {
1302
+ var newLength = elements.length - headIndex;
1303
+ elements.copyWithin(0, headIndex);
1304
+ elements.length = newLength;
1305
+ headIndex = 0;
1306
+ }
1307
+ return result;
1308
+ }
1309
+ return {
1310
+ enqueue: enqueue,
1311
+ dequeue: dequeue,
1312
+ isEmpty: isEmpty,
1313
+ };
1314
+ }
1315
+ ts.createQueue = createQueue;
1281
1316
  function createSet(getHashCode, equals) {
1282
1317
  var multiMap = new ts.Map();
1283
1318
  var size = 0;
@@ -2015,6 +2050,14 @@ var ts;
2015
2050
  }
2016
2051
  return s.slice(0, end + 1);
2017
2052
  }
2053
+ function startWhitespaceCount(s) {
2054
+ for (var i = 0; i < s.length; i++) {
2055
+ if (!ts.isWhiteSpaceLike(s.charCodeAt(i)))
2056
+ return i;
2057
+ }
2058
+ return s.length;
2059
+ }
2060
+ ts.startWhitespaceCount = startWhitespaceCount;
2018
2061
  })(ts || (ts = {}));
2019
2062
  var ts;
2020
2063
  (function (ts) {
@@ -39498,10 +39541,11 @@ var ts;
39498
39541
  }
39499
39542
  function isExportsOrModuleExportsOrAlias(sourceFile, node) {
39500
39543
  var i = 0;
39501
- var q = [node];
39502
- while (q.length && i < 100) {
39544
+ var q = ts.createQueue();
39545
+ q.enqueue(node);
39546
+ while (!q.isEmpty() && i < 100) {
39503
39547
  i++;
39504
- node = q.shift();
39548
+ node = q.dequeue();
39505
39549
  if (ts.isExportsIdentifier(node) || ts.isModuleExportsAccessExpression(node)) {
39506
39550
  return true;
39507
39551
  }
@@ -39509,10 +39553,10 @@ var ts;
39509
39553
  var symbol = lookupSymbolForName(sourceFile, node.escapedText);
39510
39554
  if (!!symbol && !!symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) {
39511
39555
  var init = symbol.valueDeclaration.initializer;
39512
- q.push(init);
39556
+ q.enqueue(init);
39513
39557
  if (ts.isAssignmentExpression(init, true)) {
39514
- q.push(init.left);
39515
- q.push(init.right);
39558
+ q.enqueue(init.left);
39559
+ q.enqueue(init.right);
39516
39560
  }
39517
39561
  }
39518
39562
  }
@@ -53831,7 +53875,7 @@ var ts;
53831
53875
  });
53832
53876
  }
53833
53877
  function elaborateArrayLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) {
53834
- if (target.flags & 131068)
53878
+ if (target.flags & (131068 | 131072))
53835
53879
  return false;
53836
53880
  if (isTupleLikeType(source)) {
53837
53881
  return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer);
@@ -53896,7 +53940,7 @@ var ts;
53896
53940
  });
53897
53941
  }
53898
53942
  function elaborateObjectLiteral(node, source, target, relation, containingMessageChain, errorOutputContainer) {
53899
- if (target.flags & 131068)
53943
+ if (target.flags & (131068 | 131072))
53900
53944
  return false;
53901
53945
  return elaborateElementwise(generateObjectLiteralElements(node), source, target, relation, containingMessageChain, errorOutputContainer);
53902
53946
  }
@@ -58335,7 +58379,7 @@ var ts;
58335
58379
  }
58336
58380
  if (ts.isEntityNameExpression(node.argumentExpression)) {
58337
58381
  var symbol = resolveEntityName(node.argumentExpression, 111551, true);
58338
- if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8)))
58382
+ if (!symbol || !isConstVariable(symbol))
58339
58383
  return undefined;
58340
58384
  var declaration = symbol.valueDeclaration;
58341
58385
  if (declaration === undefined)
@@ -64072,6 +64116,8 @@ var ts;
64072
64116
  if (result) {
64073
64117
  return result;
64074
64118
  }
64119
+ result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
64120
+ getNodeLinks(node).resolvedSignature = result;
64075
64121
  if (reportErrors) {
64076
64122
  if (candidatesForArgumentError) {
64077
64123
  if (candidatesForArgumentError.length === 1 || candidatesForArgumentError.length > 3) {
@@ -64157,7 +64203,7 @@ var ts;
64157
64203
  }
64158
64204
  }
64159
64205
  }
64160
- return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
64206
+ return result;
64161
64207
  function addImplementationSuccessElaboration(failed, diagnostic) {
64162
64208
  var _a, _b;
64163
64209
  var oldCandidatesForArgumentError = candidatesForArgumentError;
@@ -96656,8 +96702,8 @@ var ts;
96656
96702
  var gutterSeparator = " ";
96657
96703
  var resetEscapeSequence = "\u001b[0m";
96658
96704
  var ellipsis = "...";
96705
+ var bullet = "● ";
96659
96706
  var halfIndent = " ";
96660
- var indent = " ";
96661
96707
  function getCategoryFormat(category) {
96662
96708
  switch (category) {
96663
96709
  case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red;
@@ -96670,14 +96716,21 @@ var ts;
96670
96716
  return formatStyle + text + resetEscapeSequence;
96671
96717
  }
96672
96718
  ts.formatColorAndReset = formatColorAndReset;
96673
- function formatCodeSpan(file, start, length, indent, squiggleColor, host) {
96719
+ function formatCodeSpan(file, start, length, indent, underlineColor, host) {
96674
96720
  var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character;
96675
96721
  var _b = ts.getLineAndCharacterOfPosition(file, start + length), lastLine = _b.line, lastLineChar = _b.character;
96676
96722
  var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line;
96723
+ var gutterWidth = 1;
96677
96724
  var hasMoreThanFiveLines = (lastLine - firstLine) >= 4;
96678
- var gutterWidth = (lastLine + 1 + "").length;
96679
- if (hasMoreThanFiveLines) {
96680
- gutterWidth = Math.max(ellipsis.length, gutterWidth);
96725
+ var whitespaceToTrim = Number.MAX_VALUE;
96726
+ for (var i = firstLine; i <= lastLine; i++) {
96727
+ if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
96728
+ i = lastLine - 1;
96729
+ }
96730
+ var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0);
96731
+ var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
96732
+ var lineContent = file.text.slice(lineStart, lineEnd);
96733
+ whitespaceToTrim = Math.min(whitespaceToTrim, ts.startWhitespaceCount(lineContent));
96681
96734
  }
96682
96735
  var context = "";
96683
96736
  for (var i = firstLine; i <= lastLine; i++) {
@@ -96690,21 +96743,24 @@ var ts;
96690
96743
  var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
96691
96744
  var lineContent = file.text.slice(lineStart, lineEnd);
96692
96745
  lineContent = ts.trimStringEnd(lineContent);
96746
+ lineContent = lineContent.slice(whitespaceToTrim);
96693
96747
  lineContent = lineContent.replace(/\t/g, " ");
96694
- context += indent + formatColorAndReset(ts.padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
96748
+ var gutterLine = "|";
96749
+ context += indent + ts.padLeft(gutterLine, gutterWidth) + gutterSeparator;
96695
96750
  context += lineContent + host.getNewLine();
96696
- context += indent + formatColorAndReset(ts.padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
96697
- context += squiggleColor;
96751
+ context += indent + ts.padLeft("", gutterWidth) + gutterSeparator;
96752
+ context += underlineColor;
96698
96753
  if (i === firstLine) {
96699
96754
  var lastCharForLine = i === lastLine ? lastLineChar : undefined;
96700
- context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
96701
- context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~");
96755
+ context += lineContent.slice(0, firstLineChar - whitespaceToTrim).replace(/\S/g, " ");
96756
+ var amendedLastChar = lastCharForLine ? lastCharForLine - whitespaceToTrim : undefined;
96757
+ context += lineContent.slice(firstLineChar - whitespaceToTrim, amendedLastChar).replace(/./g, "▔");
96702
96758
  }
96703
96759
  else if (i === lastLine) {
96704
- context += lineContent.slice(0, lastLineChar).replace(/./g, "~");
96760
+ context += lineContent.slice(0, lastLineChar).replace(/./g, "▔");
96705
96761
  }
96706
96762
  else {
96707
- context += lineContent.replace(/./g, "~");
96763
+ context += lineContent.replace(/./g, "▔");
96708
96764
  }
96709
96765
  context += resetEscapeSequence;
96710
96766
  }
@@ -96724,41 +96780,56 @@ var ts;
96724
96780
  }
96725
96781
  ts.formatLocation = formatLocation;
96726
96782
  function formatDiagnosticsWithColorAndContext(diagnostics, host) {
96783
+ var _a, _b;
96784
+ var terminalWidth = (_b = (_a = ts.sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(ts.sys)) !== null && _b !== void 0 ? _b : 0;
96785
+ var indent = terminalWidth < 60 ? "" : halfIndent;
96727
96786
  var output = "";
96728
96787
  for (var _i = 0, diagnostics_4 = diagnostics; _i < diagnostics_4.length; _i++) {
96729
96788
  var diagnostic = diagnostics_4[_i];
96789
+ var diagnosticCode = "TS" + diagnostic.code;
96790
+ var diagnosticCatName = ts.diagnosticCategoryName(diagnostic, false);
96791
+ var diagnosticCatNameColored = formatColorAndReset(diagnosticCatName, getCategoryFormat(diagnostic.category));
96730
96792
  if (diagnostic.file) {
96731
96793
  var file = diagnostic.file, start = diagnostic.start;
96732
- output += formatLocation(file, start, host);
96733
- output += " - ";
96734
- }
96735
- output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
96736
- output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
96737
- output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
96738
- if (diagnostic.file) {
96794
+ var location = formatLocation(file, start, host);
96795
+ var locationLength = location.replace(/\u001b[[0-9]+m/g, "").length;
96796
+ var codeLength = diagnosticCode.length;
96797
+ output += formatColorAndReset(bullet, getCategoryFormat(diagnostic.category)) + location;
96798
+ var defaultPad = codeLength + 1;
96799
+ var padWidth = terminalWidth < 60 ? defaultPad : terminalWidth - (bullet.length + locationLength + codeLength + diagnosticCatName.length + 2);
96800
+ if (padWidth < diagnosticCode.length)
96801
+ padWidth = defaultPad;
96802
+ output += ts.padLeft(diagnosticCatNameColored, padWidth + (diagnosticCatNameColored.length - diagnosticCatName.length));
96803
+ output += " " + diagnosticCode;
96804
+ output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, indent, getCategoryFormat(diagnostic.category), host);
96739
96805
  output += host.getNewLine();
96740
- output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, "", getCategoryFormat(diagnostic.category), host);
96741
96806
  }
96807
+ else {
96808
+ output += formatColorAndReset(bullet, getCategoryFormat(diagnostic.category)) + " " + diagnosticCatNameColored + " " + diagnosticCode;
96809
+ }
96810
+ var diagnosticText = flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine(), 0, true);
96811
+ diagnosticText = ts.map(diagnosticText.split(host.getNewLine()), function (text) { return indent + text; }).join(host.getNewLine());
96812
+ output += diagnosticText;
96813
+ output += host.getNewLine();
96742
96814
  if (diagnostic.relatedInformation) {
96743
96815
  output += host.getNewLine();
96744
- for (var _a = 0, _b = diagnostic.relatedInformation; _a < _b.length; _a++) {
96745
- var _c = _b[_a], file = _c.file, start = _c.start, length_9 = _c.length, messageText = _c.messageText;
96816
+ for (var _c = 0, _d = diagnostic.relatedInformation; _c < _d.length; _c++) {
96817
+ var _e = _d[_c], file = _e.file, start = _e.start, length_9 = _e.length, messageText = _e.messageText;
96818
+ output += indent + ts.trimStringStart(flattenDiagnosticMessageText(messageText, host.getNewLine(), 0, true));
96746
96819
  if (file) {
96820
+ output += " " + formatLocation(file, start, host);
96747
96821
  output += host.getNewLine();
96748
- output += halfIndent + formatLocation(file, start, host);
96749
- output += formatCodeSpan(file, start, length_9, indent, ForegroundColorEscapeSequences.Cyan, host);
96822
+ output += formatCodeSpan(file, start, length_9, indent + " ", ForegroundColorEscapeSequences.Cyan, host);
96750
96823
  }
96751
- output += host.getNewLine();
96752
- output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
96753
96824
  }
96754
96825
  }
96755
- output += host.getNewLine();
96756
96826
  }
96757
96827
  return output;
96758
96828
  }
96759
96829
  ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext;
96760
- function flattenDiagnosticMessageText(diag, newLine, indent) {
96830
+ function flattenDiagnosticMessageText(diag, newLine, indent, pretty) {
96761
96831
  if (indent === void 0) { indent = 0; }
96832
+ if (pretty === void 0) { pretty = false; }
96762
96833
  if (ts.isString(diag)) {
96763
96834
  return diag;
96764
96835
  }
@@ -96768,9 +96839,14 @@ var ts;
96768
96839
  var result = "";
96769
96840
  if (indent) {
96770
96841
  result += newLine;
96771
- for (var i = 0; i < indent; i++) {
96772
- result += " ";
96842
+ var indentsToReplaceWithNewLines = pretty ? 1 : 0;
96843
+ if (indent > indentsToReplaceWithNewLines) {
96844
+ for (var i = indentsToReplaceWithNewLines; i < indent; i++) {
96845
+ result += " ";
96846
+ }
96773
96847
  }
96848
+ else
96849
+ result += newLine;
96774
96850
  }
96775
96851
  result += diag.messageText;
96776
96852
  indent++;