typescript 4.5.0-dev.20211029 → 4.5.1-rc

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.
@@ -22,7 +22,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
22
22
  ar[i] = from[i];
23
23
  }
24
24
  }
25
- return to.concat(ar || from);
25
+ return to.concat(ar || Array.prototype.slice.call(from));
26
26
  };
27
27
  var __assign = (this && this.__assign) || function () {
28
28
  __assign = Object.assign || function(t) {
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20211029";
92
+ ts.version = ts.versionMajorMinor + ".1-rc";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -5115,7 +5115,7 @@ var ts;
5115
5115
  (function (ModuleResolutionKind) {
5116
5116
  ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
5117
5117
  ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
5118
- // Starting with node12, node's module resolver has significant departures from tranditional cjs resolution
5118
+ // Starting with node12, node's module resolver has significant departures from traditional cjs resolution
5119
5119
  // to better support ecmascript modules and their use within node - more features are still being added, so
5120
5120
  // we can expect it to change over time, and as such, offer both a `NodeNext` moving resolution target, and a `Node12`
5121
5121
  // version-anchored resolution target
@@ -8693,6 +8693,8 @@ var ts;
8693
8693
  Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext: diag(2821, ts.DiagnosticCategory.Error, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext'."),
8694
8694
  Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
8695
8695
  Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
8696
+ Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path."),
8697
+ Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),
8696
8698
  Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
8697
8699
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
8698
8700
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -8799,6 +8801,7 @@ var ts;
8799
8801
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),
8800
8802
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
8801
8803
  This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
8804
+ Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, ts.DiagnosticCategory.Error, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
8802
8805
  The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
8803
8806
  Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
8804
8807
  File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
@@ -9456,6 +9459,7 @@ var ts;
9456
9459
  Remove_unused_destructuring_declaration: diag(90039, ts.DiagnosticCategory.Message, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"),
9457
9460
  Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
9458
9461
  Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."),
9462
+ Includes_imports_of_types_referenced_by_0: diag(90054, ts.DiagnosticCategory.Message, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"),
9459
9463
  Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
9460
9464
  Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
9461
9465
  Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
@@ -47357,6 +47361,21 @@ var ts;
47357
47361
  var enumRelation = new ts.Map();
47358
47362
  var builtinGlobals = ts.createSymbolTable();
47359
47363
  builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
47364
+ // Extensions suggested for path imports when module resolution is node12 or higher.
47365
+ // The first element of each tuple is the extension a file has.
47366
+ // The second element of each tuple is the extension that should be used in a path import.
47367
+ // e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs".
47368
+ var suggestedExtensions = [
47369
+ [".mts", ".mjs"],
47370
+ [".ts", ".js"],
47371
+ [".cts", ".cjs"],
47372
+ [".mjs", ".mjs"],
47373
+ [".js", ".js"],
47374
+ [".cjs", ".cjs"],
47375
+ [".tsx", compilerOptions.jsx === 1 /* Preserve */ ? ".jsx" : ".js"],
47376
+ [".jsx", ".jsx"],
47377
+ [".json", ".json"],
47378
+ ];
47360
47379
  initializeTypeChecker();
47361
47380
  return checker;
47362
47381
  function getJsxNamespace(location) {
@@ -49572,7 +49591,7 @@ var ts;
49572
49591
  : undefined;
49573
49592
  }
49574
49593
  function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) {
49575
- var _a, _b, _c, _d, _e, _f;
49594
+ var _a, _b, _c, _d, _e, _f, _g;
49576
49595
  if (isForAugmentation === void 0) { isForAugmentation = false; }
49577
49596
  if (ts.startsWith(moduleReference, "@types/")) {
49578
49597
  var diag = ts.Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
@@ -49593,7 +49612,7 @@ var ts;
49593
49612
  ((_e = (ts.isModuleDeclaration(location) ? location : location.parent && ts.isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)) === null || _e === void 0 ? void 0 : _e.name) ||
49594
49613
  ((_f = (ts.isLiteralImportTypeNode(location) ? location : undefined)) === null || _f === void 0 ? void 0 : _f.argument.literal);
49595
49614
  var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
49596
- var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode); // TODO: GH#18217
49615
+ var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
49597
49616
  var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
49598
49617
  var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
49599
49618
  if (sourceFile) {
@@ -49659,6 +49678,10 @@ var ts;
49659
49678
  }
49660
49679
  else {
49661
49680
  var tsExtension = ts.tryExtractTSExtension(moduleReference);
49681
+ var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
49682
+ var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
49683
+ var resolutionIsNode12OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node12 ||
49684
+ moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
49662
49685
  if (tsExtension) {
49663
49686
  var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
49664
49687
  var importSourceWithoutExtension = ts.removeExtension(moduleReference, tsExtension);
@@ -49678,6 +49701,19 @@ var ts;
49678
49701
  ts.hasJsonModuleEmitEnabled(compilerOptions)) {
49679
49702
  error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
49680
49703
  }
49704
+ else if (mode === ts.ModuleKind.ESNext && resolutionIsNode12OrNext && isExtensionlessRelativePathImport) {
49705
+ var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
49706
+ var suggestedExt = (_g = suggestedExtensions.find(function (_a) {
49707
+ var actualExt = _a[0], _importExt = _a[1];
49708
+ return host.fileExists(absoluteRef_1 + actualExt);
49709
+ })) === null || _g === void 0 ? void 0 : _g[1];
49710
+ if (suggestedExt) {
49711
+ error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
49712
+ }
49713
+ else {
49714
+ error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path);
49715
+ }
49716
+ }
49681
49717
  else {
49682
49718
  error(errorNode, moduleNotFoundError, moduleReference);
49683
49719
  }
@@ -61590,7 +61626,8 @@ var ts;
61590
61626
  if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
61591
61627
  if (!type.declaration.nameType) {
61592
61628
  var constraint = void 0;
61593
- if (isArrayType(t) || (t.flags & 1 /* Any */) && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, ts.or(isArrayType, isTupleType))) {
61629
+ if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 &&
61630
+ (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, ts.or(isArrayType, isTupleType))) {
61594
61631
  return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
61595
61632
  }
61596
61633
  if (isGenericTupleType(t)) {
@@ -94893,11 +94930,11 @@ var ts;
94893
94930
  currentFileState.filenameDeclaration = declaration;
94894
94931
  return currentFileState.filenameDeclaration.name;
94895
94932
  }
94896
- function getJsxFactoryCalleePrimitive(childrenLength) {
94897
- return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : childrenLength > 1 ? "jsxs" : "jsx";
94933
+ function getJsxFactoryCalleePrimitive(isStaticChildren) {
94934
+ return compilerOptions.jsx === 5 /* ReactJSXDev */ ? "jsxDEV" : isStaticChildren ? "jsxs" : "jsx";
94898
94935
  }
94899
- function getJsxFactoryCallee(childrenLength) {
94900
- var type = getJsxFactoryCalleePrimitive(childrenLength);
94936
+ function getJsxFactoryCallee(isStaticChildren) {
94937
+ var type = getJsxFactoryCalleePrimitive(isStaticChildren);
94901
94938
  return getImplicitImportForName(type);
94902
94939
  }
94903
94940
  function getImplicitJsxFragmentReference() {
@@ -95049,7 +95086,7 @@ var ts;
95049
95086
  }
95050
95087
  function convertJsxChildrenToChildrenPropAssignment(children) {
95051
95088
  var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
95052
- if (ts.length(nonWhitespaceChildren) === 1) {
95089
+ if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
95053
95090
  var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
95054
95091
  return result_12 && factory.createPropertyAssignment("children", result_12);
95055
95092
  }
@@ -95063,15 +95100,18 @@ var ts;
95063
95100
  var attrs = keyAttr ? ts.filter(node.attributes.properties, function (p) { return p !== keyAttr; }) : node.attributes.properties;
95064
95101
  var objectProperties = ts.length(attrs) ? transformJsxAttributesToObjectProps(attrs, childrenProp) :
95065
95102
  factory.createObjectLiteralExpression(childrenProp ? [childrenProp] : ts.emptyArray); // When there are no attributes, React wants {}
95066
- return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, ts.length(ts.getSemanticJsxChildren(children || ts.emptyArray)), isChild, location);
95103
+ return visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children || ts.emptyArray, isChild, location);
95067
95104
  }
95068
- function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, childrenLength, isChild, location) {
95105
+ function visitJsxOpeningLikeElementOrFragmentJSX(tagName, objectProperties, keyAttr, children, isChild, location) {
95106
+ var _a;
95107
+ var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
95108
+ var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
95069
95109
  var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
95070
95110
  if (compilerOptions.jsx === 5 /* ReactJSXDev */) {
95071
95111
  var originalFile = ts.getOriginalNode(currentSourceFile);
95072
95112
  if (originalFile && ts.isSourceFile(originalFile)) {
95073
95113
  // isStaticChildren development flag
95074
- args.push(childrenLength > 1 ? factory.createTrue() : factory.createFalse());
95114
+ args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
95075
95115
  // __source development flag
95076
95116
  var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
95077
95117
  args.push(factory.createObjectLiteralExpression([
@@ -95083,7 +95123,7 @@ var ts;
95083
95123
  args.push(factory.createThis());
95084
95124
  }
95085
95125
  }
95086
- var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(childrenLength), /*typeArguments*/ undefined, args), location);
95126
+ var element = ts.setTextRange(factory.createCallExpression(getJsxFactoryCallee(isStaticChildren), /*typeArguments*/ undefined, args), location);
95087
95127
  if (isChild) {
95088
95128
  ts.startOnNewLine(element);
95089
95129
  }
@@ -95113,7 +95153,7 @@ var ts;
95113
95153
  }
95114
95154
  }
95115
95155
  return visitJsxOpeningLikeElementOrFragmentJSX(getImplicitJsxFragmentReference(), childrenProps || factory.createObjectLiteralExpression([]),
95116
- /*keyAttr*/ undefined, ts.length(ts.getSemanticJsxChildren(children)), isChild, location);
95156
+ /*keyAttr*/ undefined, children, isChild, location);
95117
95157
  }
95118
95158
  function visitJsxOpeningFragmentCreateElement(node, children, isChild, location) {
95119
95159
  var element = ts.createExpressionForJsxFragment(factory, context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), context.getEmitResolver().getJsxFragmentFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, // TODO: GH#18217
@@ -114189,8 +114229,8 @@ var ts;
114189
114229
  var typesReferenceDirectives = ts.map(newSourceFile.typeReferenceDirectives, function (ref) { return ts.toFileNameLowerCase(ref.fileName); });
114190
114230
  var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
114191
114231
  // ensure that types resolutions are still correct
114192
- var typeReferenceEesolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
114193
- if (typeReferenceEesolutionsChanged) {
114232
+ var typeReferenceResolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
114233
+ if (typeReferenceResolutionsChanged) {
114194
114234
  structureIsReused = 1 /* SafeModules */;
114195
114235
  newSourceFile.resolvedTypeReferenceDirectiveNames = ts.zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions);
114196
114236
  }
@@ -115478,6 +115518,21 @@ var ts;
115478
115518
  return resolvedRef;
115479
115519
  }
115480
115520
  function verifyCompilerOptions() {
115521
+ var isNightly = ts.stringContains(ts.version, "-dev");
115522
+ if (!isNightly) {
115523
+ if (ts.getEmitModuleKind(options) === ts.ModuleKind.Node12) {
115524
+ createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "node12");
115525
+ }
115526
+ else if (ts.getEmitModuleKind(options) === ts.ModuleKind.NodeNext) {
115527
+ createOptionValueDiagnostic("module", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "module", "nodenext");
115528
+ }
115529
+ else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12) {
115530
+ createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "node12");
115531
+ }
115532
+ else if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
115533
+ createOptionValueDiagnostic("moduleResolution", ts.Diagnostics.Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next, "moduleResolution", "nodenext");
115534
+ }
115535
+ }
115481
115536
  if (options.strictPropertyInitialization && !ts.getStrictOptionValue(options, "strictNullChecks")) {
115482
115537
  createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks");
115483
115538
  }
@@ -115956,8 +116011,8 @@ var ts;
115956
116011
  function createDiagnosticForOptionName(message, option1, option2, option3) {
115957
116012
  createDiagnosticForOption(/*onKey*/ true, option1, option2, message, option1, option2, option3);
115958
116013
  }
115959
- function createOptionValueDiagnostic(option1, message, arg0) {
115960
- createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0);
116014
+ function createOptionValueDiagnostic(option1, message, arg0, arg1) {
116015
+ createDiagnosticForOption(/*onKey*/ false, option1, /*option2*/ undefined, message, arg0, arg1);
115961
116016
  }
115962
116017
  function createDiagnosticForReference(sourceFile, index, message, arg0, arg1) {
115963
116018
  var referencesSyntax = ts.firstDefined(ts.getTsConfigPropArray(sourceFile || options.configFile, "references"), function (property) { return ts.isArrayLiteralExpression(property.initializer) ? property.initializer : undefined; });
@@ -118201,6 +118256,9 @@ var ts;
118201
118256
  else {
118202
118257
  resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
118203
118258
  perDirectoryResolution.set(name, mode, resolution);
118259
+ if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
118260
+ resolutionHost.onDiscoveredSymlink();
118261
+ }
118204
118262
  }
118205
118263
  resolutionsInFile.set(name, mode, resolution);
118206
118264
  watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
@@ -118669,6 +118727,11 @@ var ts;
118669
118727
  }
118670
118728
  }
118671
118729
  ts.createResolutionCache = createResolutionCache;
118730
+ function resolutionIsSymlink(resolution) {
118731
+ var _a, _b;
118732
+ return !!(((_a = resolution.resolvedModule) === null || _a === void 0 ? void 0 : _a.originalPath) ||
118733
+ ((_b = resolution.resolvedTypeReferenceDirective) === null || _b === void 0 ? void 0 : _b.originalPath));
118734
+ }
118672
118735
  })(ts || (ts = {}));
118673
118736
  // Used by importFixes, getEditsForFileRename, and declaration emit to synthesize import module specifiers.
118674
118737
  /* @internal */
@@ -839,6 +839,7 @@
839
839
  "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "JSDoc \"@typedef\" 标记应具有类型注释,或其后跟有 \"@property\" 或 \"@member\" 标记。",
840
840
  "JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "JSDoc 类型只能在文档注释内部使用。",
841
841
  "JSDoc_types_may_be_moved_to_TypeScript_types_80004": "JSDoc 类型可能会移到 TypeScript 类型。",
842
+ "JSON_imports_are_experimental_in_ES_module_mode_imports_7062": "JSON 导入在 ES 模块模式导入中是实验性的。",
842
843
  "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000": "只能为 JSX 属性分配非空“表达式”。",
843
844
  "JSX_element_0_has_no_corresponding_closing_tag_17008": "JSX 元素“{0}”没有相应的结束标记。",
844
845
  "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607": "JSX 元素类不支持特性,因为它不具有“{0}”属性。",
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": "4.5.0-dev.20211029",
5
+ "version": "4.5.1-rc",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -128,4 +128,4 @@
128
128
  "volta": {
129
129
  "node": "14.15.5"
130
130
  }
131
- }
131
+ }