@typescript-deploys/pr-build 5.4.0-pr-57116-10 → 5.4.0-pr-55842-40

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.4";
21
- var version = `${versionMajorMinor}.0-insiders.20240215`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240216`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -57358,7 +57358,7 @@ function createTypeChecker(host) {
57358
57358
  return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
57359
57359
  }
57360
57360
  function createNormalizedTupleType(target, elementTypes) {
57361
- var _a, _b, _c, _d;
57361
+ var _a, _b, _c;
57362
57362
  if (!(target.combinedFlags & 14 /* NonRequired */)) {
57363
57363
  return createTypeReference(target, elementTypes);
57364
57364
  }
@@ -57378,10 +57378,8 @@ function createTypeChecker(host) {
57378
57378
  const type = elementTypes[i];
57379
57379
  const flags = target.elementFlags[i];
57380
57380
  if (flags & 8 /* Variadic */) {
57381
- if (type.flags & 1 /* Any */) {
57382
- addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
57383
- } else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
57384
- addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
57381
+ if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
57382
+ addElement(type, 8 /* Variadic */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
57385
57383
  } else if (isTupleType(type)) {
57386
57384
  const elements = getElementTypes(type);
57387
57385
  if (elements.length + expandedTypes.length >= 1e4) {
@@ -57396,10 +57394,10 @@ function createTypeChecker(host) {
57396
57394
  return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
57397
57395
  });
57398
57396
  } else {
57399
- addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
57397
+ addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
57400
57398
  }
57401
57399
  } else {
57402
- addElement(type, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i]);
57400
+ addElement(type, flags, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
57403
57401
  }
57404
57402
  }
57405
57403
  for (let i = 0; i < lastRequiredIndex; i++) {
@@ -58410,6 +58408,9 @@ function createTypeChecker(host) {
58410
58408
  if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
58411
58409
  return objectType;
58412
58410
  }
58411
+ if (indexType === neverType || indexType === implicitNeverType) {
58412
+ return neverType;
58413
+ }
58413
58414
  const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
58414
58415
  if (indexInfo) {
58415
58416
  if (accessFlags & 2 /* NoIndexSignatures */ && indexInfo.keyType !== numberType) {
@@ -58433,9 +58434,6 @@ function createTypeChecker(host) {
58433
58434
  }
58434
58435
  return indexInfo.type;
58435
58436
  }
58436
- if (indexType.flags & 131072 /* Never */) {
58437
- return neverType;
58438
- }
58439
58437
  if (isJSLiteralType(objectType)) {
58440
58438
  return anyType;
58441
58439
  }
@@ -58694,7 +58692,7 @@ function createTypeChecker(host) {
58694
58692
  return wildcardType;
58695
58693
  }
58696
58694
  objectType = getReducedType(objectType);
58697
- if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
58695
+ if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && !(indexType.flags & 131072 /* Never */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
58698
58696
  indexType = stringType;
58699
58697
  }
58700
58698
  if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
@@ -115288,7 +115286,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115288
115286
  return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
115289
115287
  }
115290
115288
  }
115291
- const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target === 99 /* ESNext */ ? 8 /* AllowNumericSeparator */ : 0);
115289
+ const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target >= 8 /* ES2021 */ ? 8 /* AllowNumericSeparator */ : 0);
115292
115290
  return getLiteralText(node, currentSourceFile, flags);
115293
115291
  }
115294
115292
  function pushNameGenerationScope(node) {
package/lib/tsserver.js CHANGED
@@ -2340,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
2340
2340
 
2341
2341
  // src/compiler/corePublic.ts
2342
2342
  var versionMajorMinor = "5.4";
2343
- var version = `${versionMajorMinor}.0-insiders.20240215`;
2343
+ var version = `${versionMajorMinor}.0-insiders.20240216`;
2344
2344
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2345
2345
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2346
2346
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -62102,7 +62102,7 @@ function createTypeChecker(host) {
62102
62102
  return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
62103
62103
  }
62104
62104
  function createNormalizedTupleType(target, elementTypes) {
62105
- var _a, _b, _c, _d;
62105
+ var _a, _b, _c;
62106
62106
  if (!(target.combinedFlags & 14 /* NonRequired */)) {
62107
62107
  return createTypeReference(target, elementTypes);
62108
62108
  }
@@ -62122,10 +62122,8 @@ function createTypeChecker(host) {
62122
62122
  const type = elementTypes[i];
62123
62123
  const flags = target.elementFlags[i];
62124
62124
  if (flags & 8 /* Variadic */) {
62125
- if (type.flags & 1 /* Any */) {
62126
- addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
62127
- } else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
62128
- addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
62125
+ if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
62126
+ addElement(type, 8 /* Variadic */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
62129
62127
  } else if (isTupleType(type)) {
62130
62128
  const elements = getElementTypes(type);
62131
62129
  if (elements.length + expandedTypes.length >= 1e4) {
@@ -62140,10 +62138,10 @@ function createTypeChecker(host) {
62140
62138
  return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
62141
62139
  });
62142
62140
  } else {
62143
- addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
62141
+ addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
62144
62142
  }
62145
62143
  } else {
62146
- addElement(type, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i]);
62144
+ addElement(type, flags, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
62147
62145
  }
62148
62146
  }
62149
62147
  for (let i = 0; i < lastRequiredIndex; i++) {
@@ -63154,6 +63152,9 @@ function createTypeChecker(host) {
63154
63152
  if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
63155
63153
  return objectType;
63156
63154
  }
63155
+ if (indexType === neverType || indexType === implicitNeverType) {
63156
+ return neverType;
63157
+ }
63157
63158
  const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
63158
63159
  if (indexInfo) {
63159
63160
  if (accessFlags & 2 /* NoIndexSignatures */ && indexInfo.keyType !== numberType) {
@@ -63177,9 +63178,6 @@ function createTypeChecker(host) {
63177
63178
  }
63178
63179
  return indexInfo.type;
63179
63180
  }
63180
- if (indexType.flags & 131072 /* Never */) {
63181
- return neverType;
63182
- }
63183
63181
  if (isJSLiteralType(objectType)) {
63184
63182
  return anyType;
63185
63183
  }
@@ -63438,7 +63436,7 @@ function createTypeChecker(host) {
63438
63436
  return wildcardType;
63439
63437
  }
63440
63438
  objectType = getReducedType(objectType);
63441
- if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
63439
+ if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && !(indexType.flags & 131072 /* Never */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
63442
63440
  indexType = stringType;
63443
63441
  }
63444
63442
  if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
@@ -120214,7 +120212,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
120214
120212
  return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
120215
120213
  }
120216
120214
  }
120217
- const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target === 99 /* ESNext */ ? 8 /* AllowNumericSeparator */ : 0);
120215
+ const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target >= 8 /* ES2021 */ ? 8 /* AllowNumericSeparator */ : 0);
120218
120216
  return getLiteralText(node, currentSourceFile, flags);
120219
120217
  }
120220
120218
  function pushNameGenerationScope(node) {
@@ -139664,6 +139662,7 @@ __export(ts_refactor_exports, {
139664
139662
  addExports: () => addExports,
139665
139663
  addNewFileToTsconfig: () => addNewFileToTsconfig,
139666
139664
  addOrRemoveBracesToArrowFunction: () => ts_refactor_addOrRemoveBracesToArrowFunction_exports,
139665
+ containsJsx: () => containsJsx,
139667
139666
  convertArrowFunctionOrFunctionExpression: () => ts_refactor_convertArrowFunctionOrFunctionExpression_exports,
139668
139667
  convertParamsToDestructuredObject: () => ts_refactor_convertParamsToDestructuredObject_exports,
139669
139668
  convertStringOrTemplateLiteral: () => ts_refactor_convertStringOrTemplateLiteral_exports,
@@ -140724,14 +140723,14 @@ registerRefactor(refactorName5, {
140724
140723
  getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) {
140725
140724
  Debug.assert(actionName2 === refactorName5, "Wrong refactor invoked");
140726
140725
  const statements = Debug.checkDefined(getStatementsToMove(context));
140727
- const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange3(context.file, context.program, statements, t, context.host, context.preferences, context));
140726
+ const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange3(context.file, context.program, statements, t, context.host, context.preferences));
140728
140727
  return { edits, renameFilename: void 0, renameLocation: void 0 };
140729
140728
  }
140730
140729
  });
140731
- function doChange3(oldFile, program, toMove, changes, host, preferences, context) {
140730
+ function doChange3(oldFile, program, toMove, changes, host, preferences) {
140732
140731
  const checker = program.getTypeChecker();
140733
140732
  const usage = getUsageInfo(oldFile, toMove.all, checker);
140734
- const newFilename = createNewFileName(oldFile, program, context, host);
140733
+ const newFilename = createNewFileName(oldFile, program, host, toMove);
140735
140734
  changes.createNewFile(oldFile, newFilename, getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, host, newFilename, preferences));
140736
140735
  addNewFileToTsconfig(program, changes, oldFile.fileName, newFilename, hostGetCanonicalFileName(host));
140737
140736
  }
@@ -141444,12 +141443,10 @@ function addExportToChanges(sourceFile, decl, name, changes, useEs6Exports) {
141444
141443
  changes.insertNodesAfter(sourceFile, decl, names.map(createExportAssignment));
141445
141444
  }
141446
141445
  }
141447
- function createNewFileName(oldFile, program, context, host) {
141446
+ function createNewFileName(oldFile, program, host, toMove) {
141448
141447
  const checker = program.getTypeChecker();
141449
- const toMove = getStatementsToMove(context);
141450
- let usage;
141451
141448
  if (toMove) {
141452
- usage = getUsageInfo(oldFile, toMove.all, checker);
141449
+ const usage = getUsageInfo(oldFile, toMove.all, checker);
141453
141450
  const currentDirectory = getDirectoryPath(oldFile.fileName);
141454
141451
  const extension = extensionFromPath(oldFile.fileName);
141455
141452
  const newFileName = combinePaths(
@@ -141507,6 +141504,9 @@ function getStatementsToMove(context) {
141507
141504
  });
141508
141505
  return all.length === 0 ? void 0 : { all, ranges };
141509
141506
  }
141507
+ function containsJsx(statements) {
141508
+ return find(statements, (statement) => !!(statement.transformFlags & 2 /* ContainsJsx */));
141509
+ }
141510
141510
  function isAllowedStatementToMove(statement) {
141511
141511
  return !isPureImport(statement) && !isPrologueDirective(statement);
141512
141512
  }
@@ -141530,8 +141530,7 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
141530
141530
  const movedSymbols = /* @__PURE__ */ new Set();
141531
141531
  const oldImportsNeededByTargetFile = /* @__PURE__ */ new Map();
141532
141532
  const targetFileImportsFromOldFile = /* @__PURE__ */ new Set();
141533
- const containsJsx = find(toMove, (statement) => !!(statement.transformFlags & 2 /* ContainsJsx */));
141534
- const jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx);
141533
+ const jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx(toMove));
141535
141534
  if (jsxNamespaceSymbol) {
141536
141535
  oldImportsNeededByTargetFile.set(jsxNamespaceSymbol, false);
141537
141536
  }
@@ -147259,9 +147258,14 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
147259
147258
  const sourceFile = getValidSourceFile(fileName);
147260
147259
  const allFiles = Debug.checkDefined(program.getSourceFiles());
147261
147260
  const extension = extensionFromPath(fileName);
147262
- const files = mapDefined(allFiles, (file) => !(program == null ? void 0 : program.isSourceFileFromExternalLibrary(sourceFile)) && !(sourceFile === getValidSourceFile(file.fileName) || extension === ".ts" /* Ts */ && extensionFromPath(file.fileName) === ".d.ts" /* Dts */ || extension === ".d.ts" /* Dts */ && startsWith(getBaseFileName(file.fileName), "lib.") && extensionFromPath(file.fileName) === ".d.ts" /* Dts */) && extension === extensionFromPath(file.fileName) ? file.fileName : void 0);
147263
- const newFileName = createNewFileName(sourceFile, program, getRefactorContext(sourceFile, positionOrRange, preferences, emptyOptions), host);
147264
- return { newFileName, files };
147261
+ const toMove = getStatementsToMove(getRefactorContext(sourceFile, positionOrRange, preferences, emptyOptions));
147262
+ const toMoveContainsJsx = containsJsx(toMove == null ? void 0 : toMove.all);
147263
+ const files = mapDefined(allFiles, (file) => {
147264
+ const fileNameExtension = extensionFromPath(file.fileName);
147265
+ const isValidSourceFile = !(program == null ? void 0 : program.isSourceFileFromExternalLibrary(sourceFile)) && !(sourceFile === getValidSourceFile(file.fileName) || extension === ".ts" /* Ts */ && fileNameExtension === ".d.ts" /* Dts */ || extension === ".d.ts" /* Dts */ && startsWith(getBaseFileName(file.fileName), "lib.") && fileNameExtension === ".d.ts" /* Dts */);
147266
+ return isValidSourceFile && (extension === fileNameExtension || (extension === ".tsx" /* Tsx */ && fileNameExtension === ".ts" /* Ts */ || extension === ".jsx" /* Jsx */ && fileNameExtension === ".js" /* Js */) && !toMoveContainsJsx) ? file.fileName : void 0;
147267
+ });
147268
+ return { newFileName: createNewFileName(sourceFile, program, host, toMove), files };
147265
147269
  }
147266
147270
  function getEditsForRefactor2(fileName, formatOptions, positionOrRange, refactorName14, actionName2, preferences = emptyOptions, interactiveRefactorArguments) {
147267
147271
  synchronizeHostData();
@@ -153805,7 +153809,7 @@ registerCodeFix({
153805
153809
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
153806
153810
  eachDiagnostic(context, errorCodes27, (diag2) => {
153807
153811
  const info = getInfo10(diag2.file, diag2.start, diag2.code, checker, context.program);
153808
- if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + info.token.text)) {
153812
+ if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 /* ObjectLiteral */ ? info.identifier : info.token.text))) {
153809
153813
  return;
153810
153814
  }
153811
153815
  if (fixId52 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
@@ -153877,7 +153881,22 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
153877
153881
  ));
153878
153882
  if (!length(properties))
153879
153883
  return void 0;
153880
- return { kind: 3 /* ObjectLiteral */, token: param.name, properties, parentDeclaration: parent2 };
153884
+ return { kind: 3 /* ObjectLiteral */, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent2 };
153885
+ }
153886
+ if (token.kind === 19 /* OpenBraceToken */ && isObjectLiteralExpression(parent2)) {
153887
+ const targetType = checker.getContextualType(parent2) || checker.getTypeAtLocation(parent2);
153888
+ const properties = arrayFrom(checker.getUnmatchedProperties(
153889
+ checker.getTypeAtLocation(parent2),
153890
+ targetType,
153891
+ /*requireOptionalProperties*/
153892
+ false,
153893
+ /*matchDiscriminantProperties*/
153894
+ false
153895
+ ));
153896
+ if (!length(properties))
153897
+ return void 0;
153898
+ const identifier = "";
153899
+ return { kind: 3 /* ObjectLiteral */, token: parent2, identifier, properties, parentDeclaration: parent2 };
153881
153900
  }
153882
153901
  if (!isMemberName(token))
153883
153902
  return void 0;
@@ -153893,7 +153912,7 @@ function getInfo10(sourceFile, tokenPos, errorCode, checker, program) {
153893
153912
  ));
153894
153913
  if (!length(properties))
153895
153914
  return void 0;
153896
- return { kind: 3 /* ObjectLiteral */, token, properties, parentDeclaration: parent2.initializer };
153915
+ return { kind: 3 /* ObjectLiteral */, token, identifier: token.text, properties, parentDeclaration: parent2.initializer };
153897
153916
  }
153898
153917
  if (isIdentifier(token) && isJsxOpeningLikeElement(token.parent)) {
153899
153918
  const target = getEmitScriptTarget(program.getCompilerOptions());
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.4";
38
- version = `${versionMajorMinor}.0-insiders.20240215`;
38
+ version = `${versionMajorMinor}.0-insiders.20240216`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -59857,7 +59857,7 @@ ${lanes.join("\n")}
59857
59857
  return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
59858
59858
  }
59859
59859
  function createNormalizedTupleType(target, elementTypes) {
59860
- var _a, _b, _c, _d;
59860
+ var _a, _b, _c;
59861
59861
  if (!(target.combinedFlags & 14 /* NonRequired */)) {
59862
59862
  return createTypeReference(target, elementTypes);
59863
59863
  }
@@ -59877,10 +59877,8 @@ ${lanes.join("\n")}
59877
59877
  const type = elementTypes[i];
59878
59878
  const flags = target.elementFlags[i];
59879
59879
  if (flags & 8 /* Variadic */) {
59880
- if (type.flags & 1 /* Any */) {
59881
- addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
59882
- } else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
59883
- addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
59880
+ if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
59881
+ addElement(type, 8 /* Variadic */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
59884
59882
  } else if (isTupleType(type)) {
59885
59883
  const elements = getElementTypes(type);
59886
59884
  if (elements.length + expandedTypes.length >= 1e4) {
@@ -59895,10 +59893,10 @@ ${lanes.join("\n")}
59895
59893
  return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
59896
59894
  });
59897
59895
  } else {
59898
- addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
59896
+ addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
59899
59897
  }
59900
59898
  } else {
59901
- addElement(type, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i]);
59899
+ addElement(type, flags, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
59902
59900
  }
59903
59901
  }
59904
59902
  for (let i = 0; i < lastRequiredIndex; i++) {
@@ -60909,6 +60907,9 @@ ${lanes.join("\n")}
60909
60907
  if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
60910
60908
  return objectType;
60911
60909
  }
60910
+ if (indexType === neverType || indexType === implicitNeverType) {
60911
+ return neverType;
60912
+ }
60912
60913
  const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
60913
60914
  if (indexInfo) {
60914
60915
  if (accessFlags & 2 /* NoIndexSignatures */ && indexInfo.keyType !== numberType) {
@@ -60932,9 +60933,6 @@ ${lanes.join("\n")}
60932
60933
  }
60933
60934
  return indexInfo.type;
60934
60935
  }
60935
- if (indexType.flags & 131072 /* Never */) {
60936
- return neverType;
60937
- }
60938
60936
  if (isJSLiteralType(objectType)) {
60939
60937
  return anyType;
60940
60938
  }
@@ -61193,7 +61191,7 @@ ${lanes.join("\n")}
61193
61191
  return wildcardType;
61194
61192
  }
61195
61193
  objectType = getReducedType(objectType);
61196
- if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
61194
+ if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && !(indexType.flags & 131072 /* Never */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
61197
61195
  indexType = stringType;
61198
61196
  }
61199
61197
  if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
@@ -118246,7 +118244,7 @@ ${lanes.join("\n")}
118246
118244
  return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
118247
118245
  }
118248
118246
  }
118249
- const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target === 99 /* ESNext */ ? 8 /* AllowNumericSeparator */ : 0);
118247
+ const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target >= 8 /* ES2021 */ ? 8 /* AllowNumericSeparator */ : 0);
118250
118248
  return getLiteralText(node, currentSourceFile, flags);
118251
118249
  }
118252
118250
  function pushNameGenerationScope(node) {
@@ -139100,10 +139098,10 @@ ${lanes.join("\n")}
139100
139098
  });
139101
139099
 
139102
139100
  // src/services/refactors/moveToNewFile.ts
139103
- function doChange3(oldFile, program, toMove, changes, host, preferences, context) {
139101
+ function doChange3(oldFile, program, toMove, changes, host, preferences) {
139104
139102
  const checker = program.getTypeChecker();
139105
139103
  const usage = getUsageInfo(oldFile, toMove.all, checker);
139106
- const newFilename = createNewFileName(oldFile, program, context, host);
139104
+ const newFilename = createNewFileName(oldFile, program, host, toMove);
139107
139105
  changes.createNewFile(oldFile, newFilename, getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, host, newFilename, preferences));
139108
139106
  addNewFileToTsconfig(program, changes, oldFile.fileName, newFilename, hostGetCanonicalFileName(host));
139109
139107
  }
@@ -139208,7 +139206,7 @@ ${lanes.join("\n")}
139208
139206
  getEditsForAction: function getRefactorEditsToMoveToNewFile(context, actionName2) {
139209
139207
  Debug.assert(actionName2 === refactorName5, "Wrong refactor invoked");
139210
139208
  const statements = Debug.checkDefined(getStatementsToMove(context));
139211
- const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange3(context.file, context.program, statements, t, context.host, context.preferences, context));
139209
+ const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange3(context.file, context.program, statements, t, context.host, context.preferences));
139212
139210
  return { edits, renameFilename: void 0, renameLocation: void 0 };
139213
139211
  }
139214
139212
  });
@@ -139812,12 +139810,10 @@ ${lanes.join("\n")}
139812
139810
  changes.insertNodesAfter(sourceFile, decl, names.map(createExportAssignment));
139813
139811
  }
139814
139812
  }
139815
- function createNewFileName(oldFile, program, context, host) {
139813
+ function createNewFileName(oldFile, program, host, toMove) {
139816
139814
  const checker = program.getTypeChecker();
139817
- const toMove = getStatementsToMove(context);
139818
- let usage;
139819
139815
  if (toMove) {
139820
- usage = getUsageInfo(oldFile, toMove.all, checker);
139816
+ const usage = getUsageInfo(oldFile, toMove.all, checker);
139821
139817
  const currentDirectory = getDirectoryPath(oldFile.fileName);
139822
139818
  const extension = extensionFromPath(oldFile.fileName);
139823
139819
  const newFileName = combinePaths(
@@ -139875,6 +139871,9 @@ ${lanes.join("\n")}
139875
139871
  });
139876
139872
  return all.length === 0 ? void 0 : { all, ranges };
139877
139873
  }
139874
+ function containsJsx(statements) {
139875
+ return find(statements, (statement) => !!(statement.transformFlags & 2 /* ContainsJsx */));
139876
+ }
139878
139877
  function isAllowedStatementToMove(statement) {
139879
139878
  return !isPureImport(statement) && !isPrologueDirective(statement);
139880
139879
  }
@@ -139898,8 +139897,7 @@ ${lanes.join("\n")}
139898
139897
  const movedSymbols = /* @__PURE__ */ new Set();
139899
139898
  const oldImportsNeededByTargetFile = /* @__PURE__ */ new Map();
139900
139899
  const targetFileImportsFromOldFile = /* @__PURE__ */ new Set();
139901
- const containsJsx = find(toMove, (statement) => !!(statement.transformFlags & 2 /* ContainsJsx */));
139902
- const jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx);
139900
+ const jsxNamespaceSymbol = getJsxNamespaceSymbol(containsJsx(toMove));
139903
139901
  if (jsxNamespaceSymbol) {
139904
139902
  oldImportsNeededByTargetFile.set(jsxNamespaceSymbol, false);
139905
139903
  }
@@ -143616,6 +143614,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
143616
143614
  addExports: () => addExports,
143617
143615
  addNewFileToTsconfig: () => addNewFileToTsconfig,
143618
143616
  addOrRemoveBracesToArrowFunction: () => ts_refactor_addOrRemoveBracesToArrowFunction_exports,
143617
+ containsJsx: () => containsJsx,
143619
143618
  convertArrowFunctionOrFunctionExpression: () => ts_refactor_convertArrowFunctionOrFunctionExpression_exports,
143620
143619
  convertParamsToDestructuredObject: () => ts_refactor_convertParamsToDestructuredObject_exports,
143621
143620
  convertStringOrTemplateLiteral: () => ts_refactor_convertStringOrTemplateLiteral_exports,
@@ -145191,9 +145190,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
145191
145190
  const sourceFile = getValidSourceFile(fileName);
145192
145191
  const allFiles = Debug.checkDefined(program.getSourceFiles());
145193
145192
  const extension = extensionFromPath(fileName);
145194
- const files = mapDefined(allFiles, (file) => !(program == null ? void 0 : program.isSourceFileFromExternalLibrary(sourceFile)) && !(sourceFile === getValidSourceFile(file.fileName) || extension === ".ts" /* Ts */ && extensionFromPath(file.fileName) === ".d.ts" /* Dts */ || extension === ".d.ts" /* Dts */ && startsWith(getBaseFileName(file.fileName), "lib.") && extensionFromPath(file.fileName) === ".d.ts" /* Dts */) && extension === extensionFromPath(file.fileName) ? file.fileName : void 0);
145195
- const newFileName = createNewFileName(sourceFile, program, getRefactorContext(sourceFile, positionOrRange, preferences, emptyOptions), host);
145196
- return { newFileName, files };
145193
+ const toMove = getStatementsToMove(getRefactorContext(sourceFile, positionOrRange, preferences, emptyOptions));
145194
+ const toMoveContainsJsx = containsJsx(toMove == null ? void 0 : toMove.all);
145195
+ const files = mapDefined(allFiles, (file) => {
145196
+ const fileNameExtension = extensionFromPath(file.fileName);
145197
+ const isValidSourceFile = !(program == null ? void 0 : program.isSourceFileFromExternalLibrary(sourceFile)) && !(sourceFile === getValidSourceFile(file.fileName) || extension === ".ts" /* Ts */ && fileNameExtension === ".d.ts" /* Dts */ || extension === ".d.ts" /* Dts */ && startsWith(getBaseFileName(file.fileName), "lib.") && fileNameExtension === ".d.ts" /* Dts */);
145198
+ return isValidSourceFile && (extension === fileNameExtension || (extension === ".tsx" /* Tsx */ && fileNameExtension === ".ts" /* Ts */ || extension === ".jsx" /* Jsx */ && fileNameExtension === ".js" /* Js */) && !toMoveContainsJsx) ? file.fileName : void 0;
145199
+ });
145200
+ return { newFileName: createNewFileName(sourceFile, program, host, toMove), files };
145197
145201
  }
145198
145202
  function getEditsForRefactor2(fileName, formatOptions, positionOrRange, refactorName14, actionName2, preferences = emptyOptions, interactiveRefactorArguments) {
145199
145203
  synchronizeHostData();
@@ -152620,7 +152624,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
152620
152624
  ));
152621
152625
  if (!length(properties))
152622
152626
  return void 0;
152623
- return { kind: 3 /* ObjectLiteral */, token: param.name, properties, parentDeclaration: parent2 };
152627
+ return { kind: 3 /* ObjectLiteral */, token: param.name, identifier: param.name.text, properties, parentDeclaration: parent2 };
152628
+ }
152629
+ if (token.kind === 19 /* OpenBraceToken */ && isObjectLiteralExpression(parent2)) {
152630
+ const targetType = checker.getContextualType(parent2) || checker.getTypeAtLocation(parent2);
152631
+ const properties = arrayFrom(checker.getUnmatchedProperties(
152632
+ checker.getTypeAtLocation(parent2),
152633
+ targetType,
152634
+ /*requireOptionalProperties*/
152635
+ false,
152636
+ /*matchDiscriminantProperties*/
152637
+ false
152638
+ ));
152639
+ if (!length(properties))
152640
+ return void 0;
152641
+ const identifier = "";
152642
+ return { kind: 3 /* ObjectLiteral */, token: parent2, identifier, properties, parentDeclaration: parent2 };
152624
152643
  }
152625
152644
  if (!isMemberName(token))
152626
152645
  return void 0;
@@ -152636,7 +152655,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
152636
152655
  ));
152637
152656
  if (!length(properties))
152638
152657
  return void 0;
152639
- return { kind: 3 /* ObjectLiteral */, token, properties, parentDeclaration: parent2.initializer };
152658
+ return { kind: 3 /* ObjectLiteral */, token, identifier: token.text, properties, parentDeclaration: parent2.initializer };
152640
152659
  }
152641
152660
  if (isIdentifier(token) && isJsxOpeningLikeElement(token.parent)) {
152642
152661
  const target = getEmitScriptTarget(program.getCompilerOptions());
@@ -153183,7 +153202,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
153183
153202
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
153184
153203
  eachDiagnostic(context, errorCodes27, (diag2) => {
153185
153204
  const info = getInfo10(diag2.file, diag2.start, diag2.code, checker, context.program);
153186
- if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + info.token.text)) {
153205
+ if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 /* ObjectLiteral */ ? info.identifier : info.token.text))) {
153187
153206
  return;
153188
153207
  }
153189
153208
  if (fixId52 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-insiders.20240215`;
57
+ var version = `${versionMajorMinor}.0-insiders.20240216`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.4.0-pr-57116-10",
5
+ "version": "5.4.0-pr-55842-40",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "d699c813b58a106f0c6e8608c288a8937aecaec1"
117
+ "gitHead": "96388867c1d18a4e26cb7de47c9bda73d9b4f1ec"
118
118
  }