typescript 5.7.0-dev.20241016 → 5.7.0-dev.20241017

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/_tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.7";
21
- var version = `${versionMajorMinor}.0-dev.20241016`;
21
+ var version = `${versionMajorMinor}.0-dev.20241017`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -17376,6 +17376,13 @@ function getLastChild(node) {
17376
17376
  });
17377
17377
  return lastChild;
17378
17378
  }
17379
+ function addToSeen(seen, key) {
17380
+ if (seen.has(key)) {
17381
+ return false;
17382
+ }
17383
+ seen.add(key);
17384
+ return true;
17385
+ }
17379
17386
  function isTypeNodeKind(kind) {
17380
17387
  return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 133 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 150 /* NumberKeyword */ || kind === 163 /* BigIntKeyword */ || kind === 151 /* ObjectKeyword */ || kind === 136 /* BooleanKeyword */ || kind === 154 /* StringKeyword */ || kind === 155 /* SymbolKeyword */ || kind === 116 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 146 /* NeverKeyword */ || kind === 141 /* IntrinsicKeyword */ || kind === 233 /* ExpressionWithTypeArguments */ || kind === 312 /* JSDocAllType */ || kind === 313 /* JSDocUnknownType */ || kind === 314 /* JSDocNullableType */ || kind === 315 /* JSDocNonNullableType */ || kind === 316 /* JSDocOptionalType */ || kind === 317 /* JSDocFunctionType */ || kind === 318 /* JSDocVariadicType */;
17381
17388
  }
@@ -38167,7 +38174,7 @@ function convertToTSConfig(configParseResult, configFileName, host) {
38167
38174
  const providedKeys = new Set(optionMap.keys());
38168
38175
  const impliedCompilerOptions = {};
38169
38176
  for (const option in computedOptions) {
38170
- if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
38177
+ if (!providedKeys.has(option) && optionDependsOn(option, providedKeys)) {
38171
38178
  const implied = computedOptions[option].computeValue(configParseResult.options);
38172
38179
  const defaultValue = computedOptions[option].computeValue({});
38173
38180
  if (implied !== defaultValue) {
@@ -38178,6 +38185,17 @@ function convertToTSConfig(configParseResult, configFileName, host) {
38178
38185
  assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
38179
38186
  return config;
38180
38187
  }
38188
+ function optionDependsOn(option, dependsOn) {
38189
+ const seen = /* @__PURE__ */ new Set();
38190
+ return optionDependsOnRecursive(option);
38191
+ function optionDependsOnRecursive(option2) {
38192
+ var _a;
38193
+ if (addToSeen(seen, option2)) {
38194
+ return some((_a = computedOptions[option2]) == null ? void 0 : _a.dependencies, (dep) => dependsOn.has(dep) || optionDependsOnRecursive(dep));
38195
+ }
38196
+ return false;
38197
+ }
38198
+ }
38181
38199
  function optionMapToObject(optionMap) {
38182
38200
  return Object.fromEntries(optionMap);
38183
38201
  }
package/lib/typescript.js CHANGED
@@ -2277,7 +2277,7 @@ module.exports = __toCommonJS(typescript_exports);
2277
2277
 
2278
2278
  // src/compiler/corePublic.ts
2279
2279
  var versionMajorMinor = "5.7";
2280
- var version = `${versionMajorMinor}.0-dev.20241016`;
2280
+ var version = `${versionMajorMinor}.0-dev.20241017`;
2281
2281
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2282
2282
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2283
2283
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -21262,11 +21262,11 @@ function getLastChild(node) {
21262
21262
  });
21263
21263
  return lastChild;
21264
21264
  }
21265
- function addToSeen(seen, key, value = true) {
21265
+ function addToSeen(seen, key) {
21266
21266
  if (seen.has(key)) {
21267
21267
  return false;
21268
21268
  }
21269
- seen.set(key, value);
21269
+ seen.add(key);
21270
21270
  return true;
21271
21271
  }
21272
21272
  function isObjectTypeDeclaration(node) {
@@ -42429,7 +42429,7 @@ function convertToTSConfig(configParseResult, configFileName, host) {
42429
42429
  const providedKeys = new Set(optionMap.keys());
42430
42430
  const impliedCompilerOptions = {};
42431
42431
  for (const option in computedOptions) {
42432
- if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
42432
+ if (!providedKeys.has(option) && optionDependsOn(option, providedKeys)) {
42433
42433
  const implied = computedOptions[option].computeValue(configParseResult.options);
42434
42434
  const defaultValue = computedOptions[option].computeValue({});
42435
42435
  if (implied !== defaultValue) {
@@ -42440,6 +42440,17 @@ function convertToTSConfig(configParseResult, configFileName, host) {
42440
42440
  assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
42441
42441
  return config;
42442
42442
  }
42443
+ function optionDependsOn(option, dependsOn) {
42444
+ const seen = /* @__PURE__ */ new Set();
42445
+ return optionDependsOnRecursive(option);
42446
+ function optionDependsOnRecursive(option2) {
42447
+ var _a;
42448
+ if (addToSeen(seen, option2)) {
42449
+ return some((_a = computedOptions[option2]) == null ? void 0 : _a.dependencies, (dep) => dependsOn.has(dep) || optionDependsOnRecursive(dep));
42450
+ }
42451
+ return false;
42452
+ }
42453
+ }
42443
42454
  function optionMapToObject(optionMap) {
42444
42455
  return Object.fromEntries(optionMap);
42445
42456
  }
@@ -140971,7 +140982,7 @@ function getExportInfoMap(importingFile, host, program, preferences, cancellatio
140971
140982
  true,
140972
140983
  (moduleSymbol, moduleFile, program2, isFromPackageJson) => {
140973
140984
  if (++moduleCount % 100 === 0) cancellationToken == null ? void 0 : cancellationToken.throwIfCancellationRequested();
140974
- const seenExports = /* @__PURE__ */ new Map();
140985
+ const seenExports = /* @__PURE__ */ new Set();
140975
140986
  const checker = program2.getTypeChecker();
140976
140987
  const defaultInfo = getDefaultLikeExportInfo(moduleSymbol, checker);
140977
140988
  if (defaultInfo && isImportableSymbol(defaultInfo.symbol, checker)) {
@@ -141033,7 +141044,7 @@ function getNamesForExportedSymbol(defaultExport, checker, scriptTarget) {
141033
141044
  function forEachNameOfDefaultExport(defaultExport, checker, scriptTarget, cb) {
141034
141045
  let chain;
141035
141046
  let current = defaultExport;
141036
- const seen = /* @__PURE__ */ new Map();
141047
+ const seen = /* @__PURE__ */ new Set();
141037
141048
  while (current) {
141038
141049
  const fromDeclaration = getDefaultLikeExportNameFromDeclaration(current);
141039
141050
  if (fromDeclaration) {
@@ -145499,7 +145510,7 @@ function flattenTypeLiteralNodeReference(checker, selection) {
145499
145510
  }
145500
145511
  if (isIntersectionTypeNode(selection)) {
145501
145512
  const result = [];
145502
- const seen = /* @__PURE__ */ new Map();
145513
+ const seen = /* @__PURE__ */ new Set();
145503
145514
  for (const type of selection.types) {
145504
145515
  const flattenedTypeMembers = flattenTypeLiteralNodeReference(checker, type);
145505
145516
  if (!flattenedTypeMembers || !flattenedTypeMembers.every((type2) => type2.name && addToSeen(seen, getNameFromPropertyName(type2.name)))) {
@@ -156171,7 +156182,7 @@ registerCodeFix({
156171
156182
  },
156172
156183
  fixIds: [fixId13],
156173
156184
  getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyExport(context) {
156174
- const fixedExportDeclarations = /* @__PURE__ */ new Map();
156185
+ const fixedExportDeclarations = /* @__PURE__ */ new Set();
156175
156186
  return codeFixAll(context, errorCodes14, (changes, diag2) => {
156176
156187
  const exportSpecifier = getExportSpecifierForDiagnosticSpan(diag2, context.sourceFile);
156177
156188
  if (exportSpecifier && addToSeen(fixedExportDeclarations, getNodeId(exportSpecifier.parent.parent))) {
@@ -156650,7 +156661,7 @@ registerCodeFix({
156650
156661
  },
156651
156662
  fixIds: [fixId17],
156652
156663
  getAllCodeActions(context) {
156653
- const seenClassDeclarations = /* @__PURE__ */ new Map();
156664
+ const seenClassDeclarations = /* @__PURE__ */ new Set();
156654
156665
  return codeFixAll(context, errorCodes18, (changes, diag2) => {
156655
156666
  const classDeclaration = getClass(diag2.file, diag2.start);
156656
156667
  if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) {
@@ -158277,7 +158288,7 @@ registerCodeFix({
158277
158288
  fixIds: [fixId18],
158278
158289
  getAllCodeActions: (context) => {
158279
158290
  const { program, preferences, host } = context;
158280
- const seen = /* @__PURE__ */ new Map();
158291
+ const seen = /* @__PURE__ */ new Set();
158281
158292
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
158282
158293
  eachDiagnostic(context, errorCodes20, (diag2) => {
158283
158294
  const info = getInfo6(program, diag2.file, createTextSpan(diag2.start, diag2.length));
@@ -159211,7 +159222,7 @@ registerCodeFix({
159211
159222
  getAllCodeActions: (context) => {
159212
159223
  const { program, fixId: fixId56 } = context;
159213
159224
  const checker = program.getTypeChecker();
159214
- const seen = /* @__PURE__ */ new Map();
159225
+ const seen = /* @__PURE__ */ new Set();
159215
159226
  const typeDeclToMembers = /* @__PURE__ */ new Map();
159216
159227
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
159217
159228
  eachDiagnostic(context, errorCodes28, (diag2) => {
@@ -160136,7 +160147,7 @@ registerCodeFix({
160136
160147
  },
160137
160148
  fixIds: [fixId26],
160138
160149
  getAllCodeActions: function getAllCodeActionsToFixClassDoesntImplementInheritedAbstractMember(context) {
160139
- const seenClassDeclarations = /* @__PURE__ */ new Map();
160150
+ const seenClassDeclarations = /* @__PURE__ */ new Set();
160140
160151
  return codeFixAll(context, errorCodes32, (changes, diag2) => {
160141
160152
  const classDeclaration = getClass2(diag2.file, diag2.start);
160142
160153
  if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) {
@@ -160179,7 +160190,7 @@ registerCodeFix({
160179
160190
  fixIds: [fixId27],
160180
160191
  getAllCodeActions(context) {
160181
160192
  const { sourceFile } = context;
160182
- const seenClasses = /* @__PURE__ */ new Map();
160193
+ const seenClasses = /* @__PURE__ */ new Set();
160183
160194
  return codeFixAll(context, errorCodes33, (changes, diag2) => {
160184
160195
  const nodes = getNodes(diag2.file, diag2.start);
160185
160196
  if (!nodes) return;
@@ -162123,7 +162134,7 @@ registerCodeFix({
162123
162134
  },
162124
162135
  fixIds: [fixId38],
162125
162136
  getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context) {
162126
- const seen = /* @__PURE__ */ new Map();
162137
+ const seen = /* @__PURE__ */ new Set();
162127
162138
  return codeFixAll(context, errorCodes49, (changes, diag2) => {
162128
162139
  const nodes = getNodes3(diag2.file, diag2.start);
162129
162140
  if (!nodes || !addToSeen(seen, getNodeId(nodes.insertBefore))) return;
@@ -164989,7 +165000,7 @@ registerCodeFix({
164989
165000
  },
164990
165001
  getAllCodeActions: (context) => {
164991
165002
  const { program } = context;
164992
- const seen = /* @__PURE__ */ new Map();
165003
+ const seen = /* @__PURE__ */ new Set();
164993
165004
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
164994
165005
  eachDiagnostic(context, errorCodes65, (diag2) => {
164995
165006
  const info = getInfo21(diag2.file, diag2.start, program);
@@ -167428,7 +167439,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
167428
167439
  let importSpecifierResolver;
167429
167440
  const symbolToOriginInfoMap = [];
167430
167441
  const symbolToSortTextMap = [];
167431
- const seenPropertySymbols = /* @__PURE__ */ new Map();
167442
+ const seenPropertySymbols = /* @__PURE__ */ new Set();
167432
167443
  const isTypeOnlyLocation = isTypeOnlyCompletion();
167433
167444
  const getModuleSpecifierResolutionHost = memoizeOne((isFromPackageJson) => {
167434
167445
  return createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host);
@@ -169192,10 +169203,10 @@ function isArrowFunctionBody(node) {
169192
169203
  return node.parent && isArrowFunction(node.parent) && (node.parent.body === node || // const a = () => /**/;
169193
169204
  node.kind === 39 /* EqualsGreaterThanToken */);
169194
169205
  }
169195
- function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules = /* @__PURE__ */ new Map()) {
169206
+ function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules = /* @__PURE__ */ new Set()) {
169196
169207
  return nonAliasCanBeReferencedAtTypeLocation(symbol) || nonAliasCanBeReferencedAtTypeLocation(skipAlias(symbol.exportSymbol || symbol, checker));
169197
169208
  function nonAliasCanBeReferencedAtTypeLocation(symbol2) {
169198
- return !!(symbol2.flags & 788968 /* Type */) || checker.isUnknownSymbol(symbol2) || !!(symbol2.flags & 1536 /* Module */) && addToSeen(seenModules, getSymbolId(symbol2)) && checker.getExportsOfModule(symbol2).some((e) => symbolCanBeReferencedAtTypeLocation(e, checker, seenModules));
169209
+ return !!(symbol2.flags & 788968 /* Type */) || checker.isUnknownSymbol(symbol2) || !!(symbol2.flags & 1536 /* Module */) && addToSeen(seenModules, symbol2) && checker.getExportsOfModule(symbol2).some((e) => symbolCanBeReferencedAtTypeLocation(e, checker, seenModules));
169199
169210
  }
169200
169211
  }
169201
169212
  function isDeprecated(symbol, checker) {
@@ -169540,7 +169551,7 @@ function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
169540
169551
  }
169541
169552
  function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
169542
169553
  let isNewIdentifier = false;
169543
- const uniques = /* @__PURE__ */ new Map();
169554
+ const uniques = /* @__PURE__ */ new Set();
169544
169555
  const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
169545
169556
  const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument);
169546
169557
  const types = flatMap(candidates, (candidate) => {
@@ -169580,7 +169591,7 @@ function stringLiteralCompletionsForObjectLiteral(checker, objectLiteralExpressi
169580
169591
  hasIndexSignature: hasIndexSignature(contextualType)
169581
169592
  };
169582
169593
  }
169583
- function getStringLiteralTypes(type, uniques = /* @__PURE__ */ new Map()) {
169594
+ function getStringLiteralTypes(type, uniques = /* @__PURE__ */ new Set()) {
169584
169595
  if (!type) return emptyArray;
169585
169596
  type = skipConstraint(type);
169586
169597
  return type.isUnion() ? flatMap(type.types, (t) => getStringLiteralTypes(t, uniques)) : type.isStringLiteral() && !(type.flags & 1024 /* EnumLiteral */) && addToSeen(uniques, type.value) ? [type] : emptyArray;
@@ -170868,7 +170879,7 @@ function getImplementationsAtPosition(program, cancellationToken, sourceFiles, s
170868
170879
  referenceEntries = entries && [...entries];
170869
170880
  } else if (entries) {
170870
170881
  const queue = createQueue(entries);
170871
- const seenNodes = /* @__PURE__ */ new Map();
170882
+ const seenNodes = /* @__PURE__ */ new Set();
170872
170883
  while (!queue.isEmpty()) {
170873
170884
  const entry = queue.dequeue();
170874
170885
  if (!addToSeen(seenNodes, getNodeId(entry.node))) {
@@ -172520,10 +172531,10 @@ var Core;
172520
172531
  }
172521
172532
  }
172522
172533
  function getPropertySymbolsFromBaseTypes(symbol, propertyName, checker, cb) {
172523
- const seen = /* @__PURE__ */ new Map();
172534
+ const seen = /* @__PURE__ */ new Set();
172524
172535
  return recur(symbol);
172525
172536
  function recur(symbol2) {
172526
- if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, getSymbolId(symbol2))) return;
172537
+ if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, symbol2)) return;
172527
172538
  return firstDefined(symbol2.declarations, (declaration) => firstDefined(getAllSuperTypeNodes(declaration), (typeReference) => {
172528
172539
  const type = checker.getTypeAtLocation(typeReference);
172529
172540
  const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
@@ -177670,7 +177681,10 @@ var ChangeTracker = class _ChangeTracker {
177670
177681
  getInsertNodeAtStartInsertOptions(sourceFile, node, indentation) {
177671
177682
  const members = getMembersOrProperties(node);
177672
177683
  const isEmpty = members.length === 0;
177673
- const isFirstInsertion = addToSeen(this.classesWithNodesInsertedAtStart, getNodeId(node), { node, sourceFile });
177684
+ const isFirstInsertion = !this.classesWithNodesInsertedAtStart.has(getNodeId(node));
177685
+ if (isFirstInsertion) {
177686
+ this.classesWithNodesInsertedAtStart.set(getNodeId(node), { node, sourceFile });
177687
+ }
177674
177688
  const insertTrailingComma = isObjectLiteralExpression(node) && (!isJsonSourceFile(sourceFile) || !isEmpty);
177675
177689
  const insertLeadingComma = isObjectLiteralExpression(node) && isJsonSourceFile(sourceFile) && isEmpty && !isFirstInsertion;
177676
177690
  return {
@@ -188056,7 +188070,7 @@ var _ProjectService = class _ProjectService {
188056
188070
  */
188057
188071
  this.filenameToScriptInfoVersion = /* @__PURE__ */ new Map();
188058
188072
  // Set of all '.js' files ever opened.
188059
- this.allJsFilesForOpenFileTelemetry = /* @__PURE__ */ new Map();
188073
+ this.allJsFilesForOpenFileTelemetry = /* @__PURE__ */ new Set();
188060
188074
  /**
188061
188075
  * maps external project file name to list of config files that were the part of this project
188062
188076
  */
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.7.0-dev.20241016",
5
+ "version": "5.7.0-dev.20241017",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -116,5 +116,5 @@
116
116
  "node": "20.1.0",
117
117
  "npm": "8.19.4"
118
118
  },
119
- "gitHead": "bd1641f7691909450147cc38cc6f5e55b79e0545"
119
+ "gitHead": "b8e4ed8aeb0b228f544c5736908c31f136a9f7e3"
120
120
  }